SetupDiGetDeviceInstanceId returns size in characters not in bytes

svn path=/trunk/; revision=30606
This commit is contained in:
Christoph von Wittich 2007-11-20 20:44:24 +00:00
parent 2b14de3b3c
commit 0fdacaa71e
2 changed files with 2 additions and 2 deletions

View file

@ -150,7 +150,7 @@ UpdateDriverForPlugAndPlayDevicesW(
TRACE("SetupDiGetDeviceInstanceIdW() failed with error 0x%x\n", GetLastError());
goto cleanup;
}
else if ((Buffer = HeapAlloc(GetProcessHeap(), 0, BufferSize)) == NULL)
else if ((Buffer = HeapAlloc(GetProcessHeap(), 0, BufferSize * sizeof(WCHAR))) == NULL)
{
TRACE("HeapAlloc() failed\n", GetLastError());
SetLastError(ERROR_NOT_ENOUGH_MEMORY);

View file

@ -236,7 +236,7 @@ PopulateCustomPathCombo(
{
HKEY hKey = NULL;
DWORD dwRegType;
DWORD dwPathLength;
DWORD dwPathLength = 0;
LPWSTR Buffer = NULL;
LPCWSTR Path;
LONG rc;