advapi32/service.c; patch 1/7: Move up SERV_* functions

Alexander Yaworsky yaworsky at migusoft.ru
Thu Nov 11 21:30:21 CST 2004


Hello.

These functions will be required in the next patch.
Instead of prototyping i decided just move them up.

This is the first and only patch made against cvs tree.
Other patches are made with diff and should be applied sequentially.
I had no internet access in the place where i was writting this ;)

ChangeLog:

Move up SERV_* functions.

Index: dlls/advapi32/service.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/service.c,v
retrieving revision 1.64
diff -u -r1.64 service.c
--- dlls/advapi32/service.c	10 Nov 2004 01:31:39 -0000	1.64
+++ dlls/advapi32/service.c	11 Nov 2004 06:15:41 -0000
@@ -156,6 +156,46 @@
  }

  /******************************************************************************
+ * ASCII to Unicode helper functions
+ */
+static inline LPWSTR SERV_dup( LPCSTR str )
+{
+    UINT len;
+    LPWSTR wstr;
+
+    if( !str )
+        return NULL;
+    len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
+    wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) );
+    MultiByteToWideChar( CP_ACP, 0, str, -1, wstr, len );
+    return wstr;
+}
+
+static inline LPWSTR SERV_dupmulti( LPCSTR str )
+{
+    UINT len = 0, n = 0;
+    LPWSTR wstr;
+
+    if( !str )
+        return NULL;
+    do {
+        len += MultiByteToWideChar( CP_ACP, 0, &str[n], -1, NULL, 0 );
+        n += (strlen( &str[n] ) + 1);
+    } while (str[n]);
+    len++;
+    n++;
+
+    wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) );
+    MultiByteToWideChar( CP_ACP, 0, str, n, wstr, len );
+    return wstr;
+}
+
+static inline VOID SERV_free( LPWSTR wstr )
+{
+    HeapFree( GetProcessHeap(), 0, wstr );
+}
+
+/******************************************************************************
   * EnumServicesStatusA [ADVAPI32.@]
   */
  BOOL WINAPI
@@ -757,44 +797,6 @@
  error:
      free_sc_handle( retval );
      return NULL;
-}
-
-
-static inline LPWSTR SERV_dup( LPCSTR str )
-{
-    UINT len;
-    LPWSTR wstr;
-
-    if( !str )
-        return NULL;
-    len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
-    wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) );
-    MultiByteToWideChar( CP_ACP, 0, str, -1, wstr, len );
-    return wstr;
-}
-
-static inline LPWSTR SERV_dupmulti( LPCSTR str )
-{
-    UINT len = 0, n = 0;
-    LPWSTR wstr;
-
-    if( !str )
-        return NULL;
-    do {
-        len += MultiByteToWideChar( CP_ACP, 0, &str[n], -1, NULL, 0 );
-        n += (strlen( &str[n] ) + 1);
-    } while (str[n]);
-    len++;
-    n++;
-
-    wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) );
-    MultiByteToWideChar( CP_ACP, 0, str, n, wstr, len );
-    return wstr;
-}
-
-static inline VOID SERV_free( LPWSTR wstr )
-{
-    HeapFree( GetProcessHeap(), 0, wstr );
  }

  /******************************************************************************




More information about the wine-patches mailing list