ADVAPI32: implement ChangeServiceConfigA using ChangeServiceConfigW
(take 2)
Mike McCormack
mike at codeweavers.com
Wed Oct 20 04:14:33 CDT 2004
oops. The macro functions for duplicating strings already exist, so use
them instead.
Mike
ChangeLog:
* implement ChangeServiceConfigA using ChangeServiceConfigW
-------------- next part --------------
Index: dlls/advapi32/service.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/service.c,v
retrieving revision 1.60
diff -u -r1.60 service.c
--- dlls/advapi32/service.c 27 Sep 2004 20:35:27 -0000 1.60
+++ dlls/advapi32/service.c 20 Oct 2004 07:28:54 -0000
@@ -810,7 +810,8 @@
static inline VOID SERV_free( LPWSTR wstr )
{
- HeapFree( GetProcessHeap(), 0, wstr );
+ if (wstr)
+ HeapFree( GetProcessHeap(), 0, wstr );
}
/******************************************************************************
@@ -1462,12 +1463,36 @@
LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCSTR lpDependencies,
LPCSTR lpServiceStartName, LPCSTR lpPassword, LPCSTR lpDisplayName)
{
- FIXME("%p %ld %ld %ld %s %s %p %p %s %s %s\n",
+ LPWSTR wBinaryPathName, wLoadOrderGroup, wDependencies;
+ LPWSTR wServiceStartName, wPassword, wDisplayName;
+ BOOL r;
+
+ TRACE("%p %ld %ld %ld %s %s %p %p %s %s %s\n",
hService, dwServiceType, dwStartType, dwErrorControl,
debugstr_a(lpBinaryPathName), debugstr_a(lpLoadOrderGroup),
lpdwTagId, lpDependencies, debugstr_a(lpServiceStartName),
debugstr_a(lpPassword), debugstr_a(lpDisplayName) );
- return TRUE;
+
+ wBinaryPathName = SERV_dup( lpBinaryPathName );
+ wLoadOrderGroup = SERV_dup( lpLoadOrderGroup );
+ wDependencies = SERV_dupmulti( lpDependencies );
+ wServiceStartName = SERV_dup( lpServiceStartName );
+ wPassword = SERV_dup( lpPassword );
+ wDisplayName = SERV_dup( lpDisplayName );
+
+ r = ChangeServiceConfigW( hService, dwServiceType,
+ dwStartType, dwErrorControl, wBinaryPathName,
+ wLoadOrderGroup, lpdwTagId, wDependencies,
+ wServiceStartName, wPassword, wDisplayName);
+
+ SERV_free( wBinaryPathName );
+ SERV_free( wLoadOrderGroup );
+ SERV_free( wDependencies );
+ SERV_free( wServiceStartName );
+ SERV_free( wPassword );
+ SERV_free( wDisplayName );
+
+ return r;
}
/******************************************************************************
More information about the wine-patches
mailing list