Index: base/system/services/rpcserver.c =================================================================== --- base/system/services/rpcserver.c (révision 57072) +++ base/system/services/rpcserver.c (copie de travail) @@ -1953,7 +1953,7 @@ if (lpPassword != NULL) { - /* FIXME: Write password */ + /* FIXME: Decrypt and write password */ } done: @@ -2291,7 +2291,7 @@ if (lpPassword != NULL) { - /* FIXME: Write password */ + /* FIXME: Decrypt and write password */ } dwError = ScmCreateServiceHandle(lpService, @@ -3116,7 +3116,7 @@ LPSTR lpBinaryPathName, LPSTR lpLoadOrderGroup, LPDWORD lpdwTagId, - LPSTR lpDependencies, + LPBYTE lpDependencies, DWORD dwDependSize, LPSTR lpServiceStartName, LPBYTE lpPassword, @@ -3132,7 +3132,6 @@ LPWSTR lpCanonicalImagePathW = NULL; LPWSTR lpLoadOrderGroupW = NULL; LPWSTR lpDependenciesW = NULL; - // LPWSTR lpPasswordW = NULL; DPRINT("RChangeServiceConfigA() called\n"); DPRINT("dwServiceType = %lu\n", dwServiceType); @@ -3372,7 +3371,7 @@ { lpDependenciesW = HeapAlloc(GetProcessHeap(), 0, - (strlen(lpDependencies) + 1) * sizeof(WCHAR)); + (strlen((LPSTR)lpDependencies) + 1) * sizeof(WCHAR)); if (lpDependenciesW == NULL) { dwError = ERROR_NOT_ENOUGH_MEMORY; @@ -3381,10 +3380,10 @@ MultiByteToWideChar(CP_ACP, 0, - lpDependencies, + (LPSTR)lpDependencies, dwDependSize, lpDependenciesW, - strlen(lpDependencies) + 1); + strlen((LPSTR)lpDependencies) + 1); dwError = ScmWriteDependencies(hServiceKey, (LPWSTR)lpDependenciesW, @@ -3395,7 +3394,7 @@ if (lpPassword != NULL) { - /* FIXME: Write password */ + /* FIXME: Decrypt and write password */ } done: Index: dll/win32/advapi32/service/scm.c =================================================================== --- dll/win32/advapi32/service/scm.c (révision 57072) +++ dll/win32/advapi32/service/scm.c (copie de travail) @@ -289,6 +289,8 @@ DWORD dwDependenciesLength = 0; DWORD dwLength; LPCSTR lpStr; + DWORD dwPasswordLength = 0; + LPBYTE lpEncryptedPassword = NULL; TRACE("ChangeServiceConfigA() called\n"); @@ -306,6 +308,8 @@ } /* FIXME: Encrypt the password */ + lpEncryptedPassword = (LPBYTE)lpPassword; + dwPasswordLength = (strlen(lpPassword) + 1) * sizeof(CHAR); RpcTryExcept { @@ -317,11 +321,11 @@ (LPSTR)lpBinaryPathName, (LPSTR)lpLoadOrderGroup, lpdwTagId, - (LPSTR)lpDependencies, + (LPBYTE)lpDependencies, dwDependenciesLength, (LPSTR)lpServiceStartName, - NULL, /* FIXME: lpPassword */ - 0, /* FIXME: dwPasswordLength */ + lpEncryptedPassword, + dwPasswordLength, (LPSTR)lpDisplayName); } RpcExcept(EXCEPTION_EXECUTE_HANDLER) @@ -363,6 +367,8 @@ DWORD dwDependenciesLength = 0; DWORD dwLength; LPCWSTR lpStr; + DWORD dwPasswordLength = 0; + LPBYTE lpEncryptedPassword = NULL; TRACE("ChangeServiceConfigW() called\n"); @@ -380,6 +386,8 @@ } /* FIXME: Encrypt the password */ + lpEncryptedPassword = (LPBYTE)lpPassword; + dwPasswordLength = (wcslen(lpPassword) + 1) * sizeof(WCHAR); RpcTryExcept { @@ -394,8 +402,8 @@ (LPBYTE)lpDependencies, dwDependenciesLength, (LPWSTR)lpServiceStartName, - NULL, /* FIXME: lpPassword */ - 0, /* FIXME: dwPasswordLength */ + lpEncryptedPassword, + dwPasswordLength, (LPWSTR)lpDisplayName); } RpcExcept(EXCEPTION_EXECUTE_HANDLER) @@ -541,6 +549,8 @@ DWORD dwError; DWORD dwLength; LPCSTR lpStr; + DWORD dwPasswordLength = 0; + LPBYTE lpEncryptedPassword = NULL; TRACE("CreateServiceA() called\n"); TRACE("%p %s %s\n", hSCManager, @@ -566,6 +576,8 @@ } /* FIXME: Encrypt the password */ + lpEncryptedPassword = (LPBYTE)lpPassword; + dwPasswordLength = (strlen(lpPassword) + 1) * sizeof(CHAR); RpcTryExcept { @@ -583,8 +595,8 @@ (LPBYTE)lpDependencies, dwDependenciesLength, (LPSTR)lpServiceStartName, - NULL, /* FIXME: lpPassword */ - 0, /* FIXME: dwPasswordLength */ + lpEncryptedPassword, + dwPasswordLength, (SC_RPC_HANDLE *)&hService); } RpcExcept(EXCEPTION_EXECUTE_HANDLER) @@ -629,6 +641,8 @@ DWORD dwError; DWORD dwLength; LPCWSTR lpStr; + DWORD dwPasswordLength = 0; + LPBYTE lpEncryptedPassword = NULL; TRACE("CreateServiceW() called\n"); TRACE("%p %S %S\n", hSCManager, @@ -656,6 +670,8 @@ } /* FIXME: Encrypt the password */ + lpEncryptedPassword = (LPBYTE)lpPassword; + dwPasswordLength = (wcslen(lpPassword) + 1) * sizeof(WCHAR); RpcTryExcept { @@ -673,8 +689,8 @@ (LPBYTE)lpDependencies, dwDependenciesLength, lpServiceStartName, - NULL, /* FIXME: lpPassword */ - 0, /* FIXME: dwPasswordLength */ + lpEncryptedPassword, + dwPasswordLength, (SC_RPC_HANDLE *)&hService); } RpcExcept(EXCEPTION_EXECUTE_HANDLER) Index: include/reactos/idl/svcctl.idl =================================================================== --- include/reactos/idl/svcctl.idl (révision 57072) +++ include/reactos/idl/svcctl.idl (copie de travail) @@ -4,7 +4,7 @@ #include -const unsigned int MAX_SERVICE_NAME_LENGTH = 255; +const unsigned int MAX_SERVICE_NAME_LENGTH = 256; const unsigned short SC_MAX_DEPEND_SIZE = 4 * 1024; const unsigned short SC_MAX_NAME_LENGTH = MAX_SERVICE_NAME_LENGTH + 1; const unsigned short SC_MAX_PATH_LENGTH = 32 * 1024; @@ -485,7 +485,7 @@ [in, string, unique] LPSTR lpBinaryPathName, [in, string, unique] LPSTR lpLoadOrderGroup, [in, out, unique] LPDWORD lpdwTagId, - [in, unique, size_is(dwDependSize)] LPSTR lpDependencies, + [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies, [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize, [in, string, unique] LPSTR lpServiceStartName, [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,