Commit 3b8ec304 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

advapi32: Correctly translate SERVICE_REQUIRED_PRIVILEGES_INFO to RPC.

parent e3796fab
...@@ -2448,6 +2448,7 @@ BOOL WINAPI ChangeServiceConfig2A( SC_HANDLE hService, DWORD dwInfoLevel, ...@@ -2448,6 +2448,7 @@ BOOL WINAPI ChangeServiceConfig2A( SC_HANDLE hService, DWORD dwInfoLevel,
BOOL WINAPI ChangeServiceConfig2W( SC_HANDLE hService, DWORD dwInfoLevel, BOOL WINAPI ChangeServiceConfig2W( SC_HANDLE hService, DWORD dwInfoLevel,
LPVOID lpInfo) LPVOID lpInfo)
{ {
SERVICE_RPC_REQUIRED_PRIVILEGES_INFO rpc_privinfo;
DWORD err; DWORD err;
__TRY __TRY
...@@ -2455,7 +2456,19 @@ BOOL WINAPI ChangeServiceConfig2W( SC_HANDLE hService, DWORD dwInfoLevel, ...@@ -2455,7 +2456,19 @@ BOOL WINAPI ChangeServiceConfig2W( SC_HANDLE hService, DWORD dwInfoLevel,
SC_RPC_CONFIG_INFOW info; SC_RPC_CONFIG_INFOW info;
info.dwInfoLevel = dwInfoLevel; info.dwInfoLevel = dwInfoLevel;
info.u.descr = lpInfo; if (dwInfoLevel == SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO)
{
SERVICE_REQUIRED_PRIVILEGES_INFOW *privinfo = lpInfo;
WCHAR *p;
for (p = privinfo->pmszRequiredPrivileges; *p; p += strlenW(p) + 1);
rpc_privinfo.cbRequiredPrivileges =
(p - privinfo->pmszRequiredPrivileges + 1) * sizeof(WCHAR);
rpc_privinfo.pRequiredPrivileges = (BYTE *)privinfo->pmszRequiredPrivileges;
info.u.privinfo = &rpc_privinfo;
}
else
info.u.descr = lpInfo;
err = svcctl_ChangeServiceConfig2W( hService, info ); err = svcctl_ChangeServiceConfig2W( hService, info );
} }
__EXCEPT(rpc_filter) __EXCEPT(rpc_filter)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment