advapi32: Forward to CreateServiceWOW64W() when appropriate.

oldstable
Nikolay Sivov 2015-02-27 01:20:48 +03:00 committed by Alexandre Julliard
parent 0f80d4b619
commit daf0af4313
2 changed files with 46 additions and 9 deletions

View File

@ -1057,11 +1057,22 @@ CreateServiceW( SC_HANDLE hSCManager, LPCWSTR lpServiceName,
__TRY
{
err = svcctl_CreateServiceW(hSCManager, lpServiceName,
lpDisplayName, dwDesiredAccess, dwServiceType, dwStartType, dwErrorControl,
lpBinaryPathName, lpLoadOrderGroup, lpdwTagId, (const BYTE*)lpDependencies,
multisz_cb(lpDependencies), lpServiceStartName, (const BYTE*)lpPassword, passwdlen,
(SC_RPC_HANDLE *)&handle);
BOOL is_wow64;
IsWow64Process(GetCurrentProcess(), &is_wow64);
if (is_wow64)
err = svcctl_CreateServiceWOW64W(hSCManager, lpServiceName,
lpDisplayName, dwDesiredAccess, dwServiceType, dwStartType, dwErrorControl,
lpBinaryPathName, lpLoadOrderGroup, lpdwTagId, (const BYTE*)lpDependencies,
multisz_cb(lpDependencies), lpServiceStartName, (const BYTE*)lpPassword, passwdlen,
(SC_RPC_HANDLE *)&handle);
else
err = svcctl_CreateServiceW(hSCManager, lpServiceName,
lpDisplayName, dwDesiredAccess, dwServiceType, dwStartType, dwErrorControl,
lpBinaryPathName, lpLoadOrderGroup, lpdwTagId, (const BYTE*)lpDependencies,
multisz_cb(lpDependencies), lpServiceStartName, (const BYTE*)lpPassword, passwdlen,
(SC_RPC_HANDLE *)&handle);
}
__EXCEPT(rpc_filter)
{

View File

@ -463,7 +463,7 @@ static DWORD parse_dependencies(const WCHAR *dependencies, struct service_entry
return ERROR_SUCCESS;
}
DWORD __cdecl svcctl_CreateServiceW(
static DWORD create_serviceW(
SC_RPC_HANDLE hSCManager,
LPCWSTR lpServiceName,
LPCWSTR lpDisplayName,
@ -479,7 +479,8 @@ DWORD __cdecl svcctl_CreateServiceW(
LPCWSTR lpServiceStartName,
const BYTE *lpPassword,
DWORD dwPasswordSize,
SC_RPC_HANDLE *phService)
SC_RPC_HANDLE *phService,
BOOL is_wow64)
{
struct service_entry *entry, *found;
struct sc_manager_handle *manager;
@ -562,6 +563,30 @@ DWORD __cdecl svcctl_CreateServiceW(
return create_handle_for_service(entry, dwDesiredAccess, phService);
}
DWORD __cdecl svcctl_CreateServiceW(
SC_RPC_HANDLE hSCManager,
LPCWSTR lpServiceName,
LPCWSTR lpDisplayName,
DWORD dwDesiredAccess,
DWORD dwServiceType,
DWORD dwStartType,
DWORD dwErrorControl,
LPCWSTR lpBinaryPathName,
LPCWSTR lpLoadOrderGroup,
DWORD *lpdwTagId,
const BYTE *lpDependencies,
DWORD dwDependenciesSize,
LPCWSTR lpServiceStartName,
const BYTE *lpPassword,
DWORD dwPasswordSize,
SC_RPC_HANDLE *phService)
{
WINE_TRACE("(%s, %s, 0x%x, %s)\n", wine_dbgstr_w(lpServiceName), wine_dbgstr_w(lpDisplayName), dwDesiredAccess, wine_dbgstr_w(lpBinaryPathName));
return create_serviceW(hSCManager, lpServiceName, lpDisplayName, dwDesiredAccess, dwServiceType, dwStartType,
dwErrorControl, lpBinaryPathName, lpLoadOrderGroup, lpdwTagId, lpDependencies, dwDependenciesSize, lpServiceStartName,
lpPassword, dwPasswordSize, phService, FALSE);
}
DWORD __cdecl svcctl_DeleteService(
SC_RPC_HANDLE hService)
{
@ -1521,8 +1546,9 @@ DWORD __cdecl svcctl_CreateServiceWOW64W(
DWORD password_size,
SC_RPC_HANDLE *service)
{
WINE_FIXME("\n");
return ERROR_CALL_NOT_IMPLEMENTED;
WINE_TRACE("(%s, %s, 0x%x, %s)\n", wine_dbgstr_w(servicename), wine_dbgstr_w(displayname), accessmask, wine_dbgstr_w(imagepath));
return create_serviceW(scmanager, servicename, displayname, accessmask, service_type, start_type, error_control, imagepath,
loadordergroup, tagid, dependencies, depend_size, start_name, password, password_size, service, TRUE);
}
DWORD __cdecl svcctl_unknown46(void)