Author: hpoussin
Date: Sun Jun 4 17:36:39 2006
New Revision: 22205
URL:
http://svn.reactos.ru/svn/reactos?rev=22205&view=rev
Log:
Convert result struct only if NtUserEnumDisplayDevices returned success
Modified:
trunk/reactos/dll/win32/user32/misc/display.c
Modified: trunk/reactos/dll/win32/user32/misc/display.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/user32/misc/displ…
==============================================================================
--- trunk/reactos/dll/win32/user32/misc/display.c (original)
+++ trunk/reactos/dll/win32/user32/misc/display.c Sun Jun 4 17:36:39 2006
@@ -67,25 +67,27 @@
iDevNum,
&DisplayDeviceW,
dwFlags );
-
- /* Copy result from DisplayDeviceW to lpDisplayDevice */
- lpDisplayDevice->StateFlags = DisplayDeviceW.StateFlags;
- WideCharToMultiByte(CP_ACP,0,
- DisplayDeviceW.DeviceName,wcslen(DisplayDeviceW.DeviceName),
- lpDisplayDevice->DeviceName,sizeof(lpDisplayDevice->DeviceName) /
sizeof(lpDisplayDevice->DeviceName[0]),
- NULL,NULL);
- WideCharToMultiByte(CP_ACP,0,
- DisplayDeviceW.DeviceString,wcslen(DisplayDeviceW.DeviceString),
- lpDisplayDevice->DeviceString,sizeof(lpDisplayDevice->DeviceString) /
sizeof(lpDisplayDevice->DeviceString[0]),
- NULL,NULL);
- WideCharToMultiByte(CP_ACP,0,
- DisplayDeviceW.DeviceID,wcslen(DisplayDeviceW.DeviceID),
- lpDisplayDevice->DeviceID,sizeof(lpDisplayDevice->DeviceID) /
sizeof(lpDisplayDevice->DeviceID[0]),
- NULL,NULL);
- WideCharToMultiByte(CP_ACP,0,
- DisplayDeviceW.DeviceKey,wcslen(DisplayDeviceW.DeviceKey),
- lpDisplayDevice->DeviceKey,sizeof(lpDisplayDevice->DeviceKey) /
sizeof(lpDisplayDevice->DeviceKey[0]),
- NULL,NULL);
+ if (!rc)
+ {
+ /* Copy result from DisplayDeviceW to lpDisplayDevice */
+ lpDisplayDevice->StateFlags = DisplayDeviceW.StateFlags;
+ WideCharToMultiByte(CP_ACP,0,
+ DisplayDeviceW.DeviceName,wcslen(DisplayDeviceW.DeviceName),
+ lpDisplayDevice->DeviceName,sizeof(lpDisplayDevice->DeviceName) /
sizeof(lpDisplayDevice->DeviceName[0]),
+ NULL,NULL);
+ WideCharToMultiByte(CP_ACP,0,
+ DisplayDeviceW.DeviceString,wcslen(DisplayDeviceW.DeviceString),
+ lpDisplayDevice->DeviceString,sizeof(lpDisplayDevice->DeviceString) /
sizeof(lpDisplayDevice->DeviceString[0]),
+ NULL,NULL);
+ WideCharToMultiByte(CP_ACP,0,
+ DisplayDeviceW.DeviceID,wcslen(DisplayDeviceW.DeviceID),
+ lpDisplayDevice->DeviceID,sizeof(lpDisplayDevice->DeviceID) /
sizeof(lpDisplayDevice->DeviceID[0]),
+ NULL,NULL);
+ WideCharToMultiByte(CP_ACP,0,
+ DisplayDeviceW.DeviceKey,wcslen(DisplayDeviceW.DeviceKey),
+ lpDisplayDevice->DeviceKey,sizeof(lpDisplayDevice->DeviceKey) /
sizeof(lpDisplayDevice->DeviceKey[0]),
+ NULL,NULL);
+ }
RtlFreeUnicodeString ( &Device );