Alexandre Julliard : explorer: Build with msvcrt.

Alexandre Julliard julliard at winehq.org
Fri May 3 15:46:17 CDT 2019


Module: wine
Branch: master
Commit: e5e79bb7aac02dade2aeb427744dfc89414871e5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e5e79bb7aac02dade2aeb427744dfc89414871e5

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri May  3 12:28:45 2019 +0200

explorer: Build with msvcrt.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/explorer/Makefile.in |  3 ++-
 programs/explorer/appbar.c    |  1 -
 programs/explorer/desktop.c   | 45 ++++++++++++++++++++-----------------------
 programs/explorer/explorer.c  | 17 ++++++++--------
 4 files changed, 31 insertions(+), 35 deletions(-)

diff --git a/programs/explorer/Makefile.in b/programs/explorer/Makefile.in
index a06887c..374c6aa 100644
--- a/programs/explorer/Makefile.in
+++ b/programs/explorer/Makefile.in
@@ -1,8 +1,9 @@
 MODULE    = explorer.exe
-APPMODE   = -mwindows -municode
 IMPORTS   = rpcrt4 user32 gdi32 advapi32
 DELAYIMPORTS = comctl32 shell32 oleaut32 ole32 shlwapi
 
+EXTRADLLFLAGS = -mwindows -municode -mno-cygwin
+
 C_SRCS = \
 	appbar.c \
 	desktop.c \
diff --git a/programs/explorer/appbar.c b/programs/explorer/appbar.c
index 329ef47..01dda7e 100644
--- a/programs/explorer/appbar.c
+++ b/programs/explorer/appbar.c
@@ -29,7 +29,6 @@
 
 #include "windows.h"
 #include "shellapi.h"
-#include "wine/unicode.h"
 #include "wine/debug.h"
 #include "explorer_private.h"
 
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c
index f4cc7b1..2857fcf 100644
--- a/programs/explorer/desktop.c
+++ b/programs/explorer/desktop.c
@@ -19,8 +19,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-#include "wine/port.h"
 #include <stdio.h>
 
 #define COBJMACROS
@@ -31,7 +29,6 @@
 #include <shellapi.h>
 #include "exdisp.h"
 
-#include "wine/unicode.h"
 #include "wine/debug.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 )
 {
-    int len_path = strlenW( path );
+    int len_path = lstrlenW( path );
     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) )))
         return NULL;
     memcpy( ret, path, len_path * sizeof(WCHAR) );
@@ -314,7 +311,7 @@ static WCHAR *build_title( const WCHAR *filename, int len )
     const WCHAR *p;
     WCHAR *ret;
 
-    if (len == -1) len = strlenW( filename );
+    if (len == -1) len = lstrlenW( filename );
     for (p = filename + len - 1; p >= filename; 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;
     for (i = 0; i < nb_launchers; i++)
     {
-        if (!strcmpiW( launchers[i]->path, path ))
+        if (!wcsicmp( launchers[i]->path, path ))
         {
             free_launcher( launchers[i] );
             if (--nb_launchers)
@@ -514,14 +511,14 @@ error:
 static void add_folder( const WCHAR *folder )
 {
     static const WCHAR lnkW[] = {'\\','*','.','l','n','k',0};
-    int len = strlenW( folder ) + strlenW( lnkW );
+    int len = lstrlenW( folder ) + lstrlenW( lnkW );
     WIN32_FIND_DATAW data;
     HANDLE handle;
     WCHAR *glob;
 
     if (!(glob = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return;
-    strcpyW( glob, folder );
-    strcatW( glob, lnkW );
+    lstrcpyW( glob, folder );
+    lstrcatW( glob, lnkW );
 
     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;
 
-    *width = strtoulW( size, &end, 10 );
+    *width = wcstoul( size, &end, 10 );
     if (end == size) return FALSE;
     if (*end != 'x') return FALSE;
     size = end + 1;
-    *height = strtoulW( size, &end, 10 );
+    *height = wcstoul( size, &end, 10 );
     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 (strcmpiW( buffer, defaultW )) return buffer;
+        if (wcsicmp( buffer, defaultW )) return buffer;
     }
 
     /* @@ Wine registry key: HKCU\Software\Wine\Explorer */
@@ -779,7 +776,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid )
 
     if (!driver)
     {
-        strcpyW( buffer, default_driver );
+        lstrcpyW( buffer, default_driver );
 
         /* @@ Wine registry key: HKCU\Software\Wine\Drivers */
         if (!RegOpenKeyW( HKEY_CURRENT_USER, driversW, &hkey ))
@@ -794,10 +791,10 @@ static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid )
     name = buffer;
     while (name)
     {
-        next = strchrW( name, ',' );
+        next = wcschr( name, ',' );
         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;
         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) );
     }
 
-    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[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)
             RegSetValueExW( hkey, graphics_driverW, 0, REG_SZ,
-                            (BYTE *)buffer, (strlenW(buffer) + 1) * sizeof(WCHAR) );
+                            (BYTE *)buffer, (lstrlenW(buffer) + 1) * sizeof(WCHAR) );
         else
             RegSetValueExA( hkey, "DriverError", 0, REG_SZ, (BYTE *)error, strlen(error) + 1 );
         RegCloseKey( hkey );
@@ -866,7 +863,7 @@ static void set_desktop_window_title( HWND hwnd, const WCHAR *name )
         return;
     }
 
-    window_title_len = strlenW(name) * sizeof(WCHAR)
+    window_title_len = lstrlenW(name) * sizeof(WCHAR)
                      + sizeof(desktop_name_separatorW)
                      + sizeof(desktop_nameW);
     window_titleW = HeapAlloc( GetProcessHeap(), 0, window_title_len );
@@ -876,9 +873,9 @@ static void set_desktop_window_title( HWND hwnd, const WCHAR *name )
         return;
     }
 
-    strcpyW( window_titleW, name );
-    strcatW( window_titleW, desktop_name_separatorW );
-    strcatW( window_titleW, desktop_nameW );
+    lstrcpyW( window_titleW, name );
+    lstrcatW( window_titleW, desktop_name_separatorW );
+    lstrcatW( window_titleW, desktop_nameW );
 
     SetWindowTextW( hwnd, window_titleW );
     HeapFree( GetProcessHeap(), 0, window_titleW );
@@ -920,10 +917,10 @@ void manage_desktop( WCHAR *arg )
     {
         arg++;
         name = arg;
-        if ((p = strchrW( arg, ',' )))
+        if ((p = wcschr( arg, ',' )))
         {
             *p++ = 0;
-            if ((driver = strchrW( p, ',' ))) *driver++ = 0;
+            if ((driver = wcschr( p, ',' ))) *driver++ = 0;
         }
         if (!p || !parse_size( p, &width, &height ))
             get_default_desktop_size( name, &width, &height );
diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c
index 955678d..dcd09ac 100644
--- a/programs/explorer/explorer.c
+++ b/programs/explorer/explorer.c
@@ -22,7 +22,6 @@
 
 #define COBJMACROS
 
-#include "wine/unicode.h"
 #include "wine/debug.h"
 #include "wine/heap.h"
 #include "explorer_private.h"
@@ -671,7 +670,7 @@ static WCHAR *copy_path_string(WCHAR *target, WCHAR *source)
 {
     INT i = 0;
 
-    while (isspaceW(*source)) source++;
+    while (iswspace(*source)) source++;
 
     if (*source == '\"')
     {
@@ -735,23 +734,23 @@ static void parse_command_line(LPWSTR commandline,parameters_struct *parameters)
 
     while (*p)
     {
-        while (isspaceW(*p)) p++;
-        if (strncmpW(p, arg_n, ARRAY_SIZE( arg_n ))==0)
+        while (iswspace(*p)) p++;
+        if (wcsncmp(p, arg_n, ARRAY_SIZE( arg_n ))==0)
         {
             parameters->explorer_mode = FALSE;
             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;
             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 = 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 = 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,
                                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 );
             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 */
-        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 );
             manage_desktop( p );  /* the rest of the command line is handled by desktop mode */




More information about the wine-cvs mailing list