Author: cwittich
Date: Tue Nov 20 23:44:24 2007
New Revision: 30606
URL:
http://svn.reactos.org/svn/reactos?rev=30606&view=rev
Log:
SetupDiGetDeviceInstanceId returns size in characters not in bytes
Modified:
trunk/reactos/dll/win32/newdev/newdev.c
trunk/reactos/dll/win32/newdev/wizard.c
Modified: trunk/reactos/dll/win32/newdev/newdev.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.c?…
==============================================================================
--- trunk/reactos/dll/win32/newdev/newdev.c (original)
+++ trunk/reactos/dll/win32/newdev/newdev.c Tue Nov 20 23:44:24 2007
@@ -150,7 +150,7 @@
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);
Modified: trunk/reactos/dll/win32/newdev/wizard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/wizard.c?…
==============================================================================
--- trunk/reactos/dll/win32/newdev/wizard.c (original)
+++ trunk/reactos/dll/win32/newdev/wizard.c Tue Nov 20 23:44:24 2007
@@ -236,7 +236,7 @@
{
HKEY hKey = NULL;
DWORD dwRegType;
- DWORD dwPathLength;
+ DWORD dwPathLength = 0;
LPWSTR Buffer = NULL;
LPCWSTR Path;
LONG rc;