This Time _WITH_ the Patch: Changelog: Remove Some Unicode -> Ascii Cross-calls. -- Matthew Davison <m.davison@virgin.net>
Index: service.c =================================================================== RCS file: /home/wine/wine/dlls/advapi32/service.c,v retrieving revision 1.34 diff -u -r1.34 service.c --- service.c 20 Jan 2003 23:23:12 -0000 1.34 +++ service.c 22 Jan 2003 21:42:27 -0000 @@ -133,13 +133,16 @@ BOOL WINAPI StartServiceCtrlDispatcherW( LPSERVICE_TABLE_ENTRYW servent ) { + static const WCHAR _ServiceStartDataW[] = {'A','D','V','A','P','I','_','S', + 'e','r','v','i','c','e','S','t', + 'a','r','t','D','a','t','a',0}; LPSERVICE_MAIN_FUNCTIONW fpMain; HANDLE wait; DWORD dwNumServiceArgs ; LPWSTR *lpServiceArgVectors ; TRACE("(%p)\n", servent); - wait = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, "ADVAPI32_ServiceStartData"); + wait = OpenSemaphoreW(SEMAPHORE_ALL_ACCESS, FALSE, _ServiceStartDataW); if(wait == 0) { ERR("Couldn't find wait semaphore\n"); @@ -599,37 +607,45 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs, LPCWSTR *lpServiceArgVectors ) { - CHAR path[MAX_PATH],str[MAX_PATH]; + static const WCHAR _ServiceStartDataW[] = {'A','D','V','A','P','I','_','S', + 'e','r','v','i','c','e','S','t', + 'a','r','t','D','a','t','a',0}; + + static const WCHAR _WaitServiceStartW[] = {'A','D','V','A','P','I','_','W', + 'a','i','t','S','e','r','v','i', + 'c','e','S','t','a','r','t',0}; + static const WCHAR _ImagePathW[] = {'I','m','a','g','e','P','a','t','h',0}; + + WCHAR path[MAX_PATH],str[MAX_PATH]; DWORD type,size; long r; HANDLE data,wait; PROCESS_INFORMATION procinfo; - STARTUPINFOA startupinfo; - + STARTUPINFOW startupinfo; TRACE("(%p,%ld,%p)\n",hService,dwNumServiceArgs, lpServiceArgVectors); size = sizeof str; - r = RegQueryValueExA(hService, "ImagePath", NULL, &type, (LPVOID)str, &size); + r = RegQueryValueExW(hService, _ImagePathW, NULL, &type, (LPVOID)str, &size); if (r!=ERROR_SUCCESS) return FALSE; - ExpandEnvironmentStringsA(str,path,sizeof path); + ExpandEnvironmentStringsW(str,path,sizeof path); - TRACE("Starting service %s\n", debugstr_a(path) ); + TRACE("Starting service %s\n", debugstr_w(path) ); - data = CreateSemaphoreA(NULL,1,1,"ADVAPI32_ServiceStartData"); + data = CreateSemaphoreW(NULL,1,1,_ServiceStartDataW); if (!data) { - data = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, "ADVAPI32_ServiceStartData"); + data = OpenSemaphoreW(SEMAPHORE_ALL_ACCESS, FALSE, _ServiceStartDataW); if(data == 0) { ERR("Couldn't create data semaphore\n"); return FALSE; } } - wait = CreateSemaphoreA(NULL,0,1,"ADVAPI32_WaitServiceStart"); + wait = CreateSemaphoreW(NULL,0,1,_WaitServiceStartW); { - wait = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, "ADVAPI32_ServiceStartData"); + wait = OpenSemaphoreW(SEMAPHORE_ALL_ACCESS, FALSE, _ServiceStartDataW); if(wait == 0) { ERR("Couldn't create wait semaphore\n"); @@ -654,10 +670,10 @@ start_dwNumServiceArgs = dwNumServiceArgs; start_lpServiceArgVectors = (LPWSTR *)lpServiceArgVectors; - ZeroMemory(&startupinfo,sizeof(STARTUPINFOA)); - startupinfo.cb = sizeof(STARTUPINFOA); + ZeroMemory(&startupinfo,sizeof(STARTUPINFOW)); + startupinfo.cb = sizeof(STARTUPINFOW); - r = CreateProcessA(path, + r = CreateProcessW(path, NULL, NULL, /* process security attribs */ NULL, /* thread security attribs */