explorer: Build with msvcrt.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Alexandre Julliard 2019-05-03 12:28:45 +02:00
parent ed22f0454b
commit e5e79bb7aa
4 changed files with 31 additions and 35 deletions

View File

@ -1,8 +1,9 @@
MODULE = explorer.exe MODULE = explorer.exe
APPMODE = -mwindows -municode
IMPORTS = rpcrt4 user32 gdi32 advapi32 IMPORTS = rpcrt4 user32 gdi32 advapi32
DELAYIMPORTS = comctl32 shell32 oleaut32 ole32 shlwapi DELAYIMPORTS = comctl32 shell32 oleaut32 ole32 shlwapi
EXTRADLLFLAGS = -mwindows -municode -mno-cygwin
C_SRCS = \ C_SRCS = \
appbar.c \ appbar.c \
desktop.c \ desktop.c \

View File

@ -29,7 +29,6 @@
#include "windows.h" #include "windows.h"
#include "shellapi.h" #include "shellapi.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "explorer_private.h" #include "explorer_private.h"

View File

@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdio.h> #include <stdio.h>
#define COBJMACROS #define COBJMACROS
@ -31,7 +29,6 @@
#include <shellapi.h> #include <shellapi.h>
#include "exdisp.h" #include "exdisp.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "explorer_private.h" #include "explorer_private.h"
@ -249,10 +246,10 @@ static void do_launch( const struct launcher *launcher )
static WCHAR *append_path( const WCHAR *path, const WCHAR *filename, int len_filename ) static WCHAR *append_path( const WCHAR *path, const WCHAR *filename, int len_filename )
{ {
int len_path = strlenW( path ); int len_path = lstrlenW( path );
WCHAR *ret; WCHAR *ret;
if (len_filename == -1) len_filename = strlenW( filename ); if (len_filename == -1) len_filename = lstrlenW( filename );
if (!(ret = HeapAlloc( GetProcessHeap(), 0, (len_path + len_filename + 2) * sizeof(WCHAR) ))) if (!(ret = HeapAlloc( GetProcessHeap(), 0, (len_path + len_filename + 2) * sizeof(WCHAR) )))
return NULL; return NULL;
memcpy( ret, path, len_path * sizeof(WCHAR) ); memcpy( ret, path, len_path * sizeof(WCHAR) );
@ -314,7 +311,7 @@ static WCHAR *build_title( const WCHAR *filename, int len )
const WCHAR *p; const WCHAR *p;
WCHAR *ret; WCHAR *ret;
if (len == -1) len = strlenW( filename ); if (len == -1) len = lstrlenW( filename );
for (p = filename + len - 1; p >= filename; p--) for (p = filename + len - 1; p >= filename; p--)
{ {
if (*p == '.') if (*p == '.')
@ -381,7 +378,7 @@ static BOOL remove_launcher( const WCHAR *folder, const WCHAR *filename, int len
if (!(path = append_path( folder, filename, len_filename ))) return FALSE; if (!(path = append_path( folder, filename, len_filename ))) return FALSE;
for (i = 0; i < nb_launchers; i++) for (i = 0; i < nb_launchers; i++)
{ {
if (!strcmpiW( launchers[i]->path, path )) if (!wcsicmp( launchers[i]->path, path ))
{ {
free_launcher( launchers[i] ); free_launcher( launchers[i] );
if (--nb_launchers) if (--nb_launchers)
@ -514,14 +511,14 @@ error:
static void add_folder( const WCHAR *folder ) static void add_folder( const WCHAR *folder )
{ {
static const WCHAR lnkW[] = {'\\','*','.','l','n','k',0}; static const WCHAR lnkW[] = {'\\','*','.','l','n','k',0};
int len = strlenW( folder ) + strlenW( lnkW ); int len = lstrlenW( folder ) + lstrlenW( lnkW );
WIN32_FIND_DATAW data; WIN32_FIND_DATAW data;
HANDLE handle; HANDLE handle;
WCHAR *glob; WCHAR *glob;
if (!(glob = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return; if (!(glob = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return;
strcpyW( glob, folder ); lstrcpyW( glob, folder );
strcatW( glob, lnkW ); lstrcatW( glob, lnkW );
if ((handle = FindFirstFileW( glob, &data )) != INVALID_HANDLE_VALUE) if ((handle = FindFirstFileW( glob, &data )) != INVALID_HANDLE_VALUE)
{ {
@ -668,11 +665,11 @@ static BOOL parse_size( const WCHAR *size, unsigned int *width, unsigned int *he
{ {
WCHAR *end; WCHAR *end;
*width = strtoulW( size, &end, 10 ); *width = wcstoul( size, &end, 10 );
if (end == size) return FALSE; if (end == size) return FALSE;
if (*end != 'x') return FALSE; if (*end != 'x') return FALSE;
size = end + 1; size = end + 1;
*height = strtoulW( size, &end, 10 ); *height = wcstoul( size, &end, 10 );
return !*end; return !*end;
} }
@ -691,7 +688,7 @@ static const WCHAR *get_default_desktop_name(void)
if (desk && GetUserObjectInformationW( desk, UOI_NAME, buffer, ARRAY_SIZE( buffer ), NULL )) if (desk && GetUserObjectInformationW( desk, UOI_NAME, buffer, ARRAY_SIZE( buffer ), NULL ))
{ {
if (strcmpiW( buffer, defaultW )) return buffer; if (wcsicmp( buffer, defaultW )) return buffer;
} }
/* @@ Wine registry key: HKCU\Software\Wine\Explorer */ /* @@ Wine registry key: HKCU\Software\Wine\Explorer */
@ -779,7 +776,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid )
if (!driver) if (!driver)
{ {
strcpyW( buffer, default_driver ); lstrcpyW( buffer, default_driver );
/* @@ Wine registry key: HKCU\Software\Wine\Drivers */ /* @@ Wine registry key: HKCU\Software\Wine\Drivers */
if (!RegOpenKeyW( HKEY_CURRENT_USER, driversW, &hkey )) if (!RegOpenKeyW( HKEY_CURRENT_USER, driversW, &hkey ))
@ -794,10 +791,10 @@ static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid )
name = buffer; name = buffer;
while (name) while (name)
{ {
next = strchrW( name, ',' ); next = wcschr( name, ',' );
if (next) *next++ = 0; if (next) *next++ = 0;
snprintfW( libname, ARRAY_SIZE( libname ), drv_formatW, name ); swprintf( libname, ARRAY_SIZE( libname ), drv_formatW, name );
if ((module = LoadLibraryW( libname )) != 0) break; if ((module = LoadLibraryW( libname )) != 0) break;
switch (GetLastError()) switch (GetLastError())
{ {
@ -820,7 +817,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid )
TRACE( "display %s driver %s\n", debugstr_guid(guid), debugstr_w(buffer) ); TRACE( "display %s driver %s\n", debugstr_guid(guid), debugstr_w(buffer) );
} }
sprintfW( key, device_keyW, guid->Data1, guid->Data2, guid->Data3, swprintf( key, ARRAY_SIZE(key), device_keyW, guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] ); guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
@ -829,7 +826,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid )
{ {
if (module) if (module)
RegSetValueExW( hkey, graphics_driverW, 0, REG_SZ, RegSetValueExW( hkey, graphics_driverW, 0, REG_SZ,
(BYTE *)buffer, (strlenW(buffer) + 1) * sizeof(WCHAR) ); (BYTE *)buffer, (lstrlenW(buffer) + 1) * sizeof(WCHAR) );
else else
RegSetValueExA( hkey, "DriverError", 0, REG_SZ, (BYTE *)error, strlen(error) + 1 ); RegSetValueExA( hkey, "DriverError", 0, REG_SZ, (BYTE *)error, strlen(error) + 1 );
RegCloseKey( hkey ); RegCloseKey( hkey );
@ -866,7 +863,7 @@ static void set_desktop_window_title( HWND hwnd, const WCHAR *name )
return; return;
} }
window_title_len = strlenW(name) * sizeof(WCHAR) window_title_len = lstrlenW(name) * sizeof(WCHAR)
+ sizeof(desktop_name_separatorW) + sizeof(desktop_name_separatorW)
+ sizeof(desktop_nameW); + sizeof(desktop_nameW);
window_titleW = HeapAlloc( GetProcessHeap(), 0, window_title_len ); window_titleW = HeapAlloc( GetProcessHeap(), 0, window_title_len );
@ -876,9 +873,9 @@ static void set_desktop_window_title( HWND hwnd, const WCHAR *name )
return; return;
} }
strcpyW( window_titleW, name ); lstrcpyW( window_titleW, name );
strcatW( window_titleW, desktop_name_separatorW ); lstrcatW( window_titleW, desktop_name_separatorW );
strcatW( window_titleW, desktop_nameW ); lstrcatW( window_titleW, desktop_nameW );
SetWindowTextW( hwnd, window_titleW ); SetWindowTextW( hwnd, window_titleW );
HeapFree( GetProcessHeap(), 0, window_titleW ); HeapFree( GetProcessHeap(), 0, window_titleW );
@ -920,10 +917,10 @@ void manage_desktop( WCHAR *arg )
{ {
arg++; arg++;
name = arg; name = arg;
if ((p = strchrW( arg, ',' ))) if ((p = wcschr( arg, ',' )))
{ {
*p++ = 0; *p++ = 0;
if ((driver = strchrW( p, ',' ))) *driver++ = 0; if ((driver = wcschr( p, ',' ))) *driver++ = 0;
} }
if (!p || !parse_size( p, &width, &height )) if (!p || !parse_size( p, &width, &height ))
get_default_desktop_size( name, &width, &height ); get_default_desktop_size( name, &width, &height );

View File

@ -22,7 +22,6 @@
#define COBJMACROS #define COBJMACROS
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h" #include "wine/heap.h"
#include "explorer_private.h" #include "explorer_private.h"
@ -671,7 +670,7 @@ static WCHAR *copy_path_string(WCHAR *target, WCHAR *source)
{ {
INT i = 0; INT i = 0;
while (isspaceW(*source)) source++; while (iswspace(*source)) source++;
if (*source == '\"') if (*source == '\"')
{ {
@ -735,23 +734,23 @@ static void parse_command_line(LPWSTR commandline,parameters_struct *parameters)
while (*p) while (*p)
{ {
while (isspaceW(*p)) p++; while (iswspace(*p)) p++;
if (strncmpW(p, arg_n, ARRAY_SIZE( arg_n ))==0) if (wcsncmp(p, arg_n, ARRAY_SIZE( arg_n ))==0)
{ {
parameters->explorer_mode = FALSE; parameters->explorer_mode = FALSE;
p += ARRAY_SIZE( arg_n ); p += ARRAY_SIZE( arg_n );
} }
else if (strncmpW(p, arg_e, ARRAY_SIZE( arg_e ))==0) else if (wcsncmp(p, arg_e, ARRAY_SIZE( arg_e ))==0)
{ {
parameters->explorer_mode = TRUE; parameters->explorer_mode = TRUE;
p += ARRAY_SIZE( arg_e ); p += ARRAY_SIZE( arg_e );
} }
else if (strncmpW(p, arg_root, ARRAY_SIZE( arg_root ))==0) else if (wcsncmp(p, arg_root, ARRAY_SIZE( arg_root ))==0)
{ {
p += ARRAY_SIZE( arg_root ); p += ARRAY_SIZE( arg_root );
p = copy_path_string(parameters->root,p); p = copy_path_string(parameters->root,p);
} }
else if (strncmpW(p, arg_select, ARRAY_SIZE( arg_select ))==0) else if (wcsncmp(p, arg_select, ARRAY_SIZE( arg_select ))==0)
{ {
p += ARRAY_SIZE( arg_select ); p += ARRAY_SIZE( arg_select );
p = copy_path_string(parameters->selection,p); p = copy_path_string(parameters->selection,p);
@ -759,13 +758,13 @@ static void parse_command_line(LPWSTR commandline,parameters_struct *parameters)
copy_path_root(parameters->root, copy_path_root(parameters->root,
parameters->selection); parameters->selection);
} }
else if (strncmpW(p, arg_desktop, ARRAY_SIZE( arg_desktop ))==0) else if (wcsncmp(p, arg_desktop, ARRAY_SIZE( arg_desktop ))==0)
{ {
p += ARRAY_SIZE( arg_desktop ); p += ARRAY_SIZE( arg_desktop );
manage_desktop( p ); /* the rest of the command line is handled by desktop mode */ manage_desktop( p ); /* the rest of the command line is handled by desktop mode */
} }
/* workaround for Worms Armageddon that hardcodes a /desktop option with quotes */ /* workaround for Worms Armageddon that hardcodes a /desktop option with quotes */
else if (strncmpW(p, arg_desktop_quotes, ARRAY_SIZE( arg_desktop_quotes ))==0) else if (wcsncmp(p, arg_desktop_quotes, ARRAY_SIZE( arg_desktop_quotes ))==0)
{ {
p += ARRAY_SIZE( arg_desktop_quotes ); p += ARRAY_SIZE( arg_desktop_quotes );
manage_desktop( p ); /* the rest of the command line is handled by desktop mode */ manage_desktop( p ); /* the rest of the command line is handled by desktop mode */