Author: rharabien
Date: Fri Mar 25 22:36:37 2011
New Revision: 51140
URL:
http://svn.reactos.org/svn/reactos?rev=51140&view=rev
Log:
[WIN32K]
Change wcsncpy to safe functions (part 2/x)
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/display.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/display.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Fri Mar 25
22:36:37 2011
@@ -309,11 +309,11 @@
ZwClose(hkey);
/* Copy device name, device string and StateFlags */
- wcsncpy(pdispdev->DeviceName, pGraphicsDevice->szWinDeviceName, 32);
- wcsncpy(pdispdev->DeviceString, pGraphicsDevice->pwszDescription, 128);
+ RtlStringCbCopyW(pdispdev->DeviceName, sizeof(pdispdev->DeviceName),
pGraphicsDevice->szWinDeviceName);
+ RtlStringCbCopyW(pdispdev->DeviceString, sizeof(pdispdev->DeviceString),
pGraphicsDevice->pwszDescription);
pdispdev->StateFlags = pGraphicsDevice->StateFlags;
-
// FIXME: fill in DEVICE ID
+ pdispdev->DeviceID[0] = UNICODE_NULL;
return STATUS_SUCCESS;
}
@@ -339,7 +339,7 @@
if (pustrDevice && iDevNum != 0)
return FALSE;
- dispdev.cb = sizeof(DISPLAY_DEVICEW);
+ dispdev.cb = sizeof(dispdev);
if (pustrDevice)
{