fix incorrect buffersize passed to MultiByteToWideChar

svn path=/trunk/; revision=36132
This commit is contained in:
Christoph von Wittich 2008-09-11 09:12:13 +00:00
parent eac6a1546a
commit 1eff85acb5

View file

@ -2927,7 +2927,7 @@ DWORD RChangeServiceConfigA(
lpDisplayName, lpDisplayName,
-1, -1,
lpDisplayNameW, lpDisplayNameW,
(wcslen(lpDisplayNameW) + 1) * sizeof(WCHAR)); wcslen(lpDisplayNameW) + 1);
RegSetValueExW(hServiceKey, RegSetValueExW(hServiceKey,
L"DisplayName", L"DisplayName",
@ -2997,7 +2997,7 @@ DWORD RChangeServiceConfigA(
if (lpBinaryPathName != NULL && *lpBinaryPathName != 0) if (lpBinaryPathName != NULL && *lpBinaryPathName != 0)
{ {
lpBinaryPathNameW=HeapAlloc(GetProcessHeap(),0, (strlen(lpBinaryPathName)+1) * sizeof(WCHAR)); lpBinaryPathNameW=HeapAlloc(GetProcessHeap(),0, (strlen(lpBinaryPathName)+1) * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpBinaryPathName, -1, lpBinaryPathNameW, (wcslen(lpBinaryPathNameW)+1) * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, lpBinaryPathName, -1, lpBinaryPathNameW, wcslen(lpBinaryPathNameW)+1);
dwError = RegSetValueExW(hServiceKey, dwError = RegSetValueExW(hServiceKey,
L"ImagePath", L"ImagePath",
0, 0,
@ -3041,7 +3041,7 @@ DWORD RChangeServiceConfigA(
lpLoadOrderGroup, lpLoadOrderGroup,
-1, -1,
lpLoadOrderGroupW, lpLoadOrderGroupW,
(wcslen(lpLoadOrderGroupW) + 1) * sizeof(WCHAR)); wcslen(lpLoadOrderGroupW) + 1);
dwError = RegSetValueExW(hServiceKey, dwError = RegSetValueExW(hServiceKey,
L"Group", L"Group",
@ -3092,7 +3092,7 @@ DWORD RChangeServiceConfigA(
lpDependencies, lpDependencies,
dwDependSize, dwDependSize,
lpDependenciesW, lpDependenciesW,
(wcslen(lpDependenciesW)+1) * sizeof(WCHAR)); wcslen(lpDependenciesW)+1);
dwError = ScmWriteDependencies(hServiceKey, dwError = ScmWriteDependencies(hServiceKey,
(LPWSTR)lpDependenciesW, (LPWSTR)lpDependenciesW,