Author: jgardou
Date: Fri Feb 7 23:35:06 2014
New Revision: 62029
URL:
http://svn.reactos.org/svn/reactos?rev=62029&view=rev
Log:
[WIN32K]
- Slightly improve the way the Device Description is retrieved.
- Slightly improve registry function.
Modified:
trunk/reactos/win32ss/gdi/eng/device.c
trunk/reactos/win32ss/user/ntuser/misc/registry.c
Modified: trunk/reactos/win32ss/gdi/eng/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/device.c?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/device.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/device.c [iso-8859-1] Fri Feb 7 23:35:06 2014
@@ -113,7 +113,8 @@
pGraphicsDevice->pwszDescription = pwsz + pustrDiplayDrivers->Length /
sizeof(WCHAR);
RtlCopyMemory(pGraphicsDevice->pwszDescription,
pustrDescription->Buffer,
- pustrDescription->Length + sizeof(WCHAR));
+ pustrDescription->Length);
+ pGraphicsDevice->pwszDescription[pustrDescription->Length/sizeof(WCHAR)] = 0;
/* Initialize the pdevmodeInfo list and default index */
pGraphicsDevice->pdevmodeInfo = NULL;
Modified: trunk/reactos/win32ss/user/ntuser/misc/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/misc/r…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/misc/registry.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/misc/registry.c [iso-8859-1] Fri Feb 7 23:35:06
2014
@@ -58,7 +58,7 @@
ULONG cbInfoSize, cbDataSize;
/* Check if the local buffer is sufficient */
- cbInfoSize = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data) + *pcbValue;
+ cbInfoSize = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[*pcbValue]);
if (cbInfoSize <= sizeof(ajBuffer))
{
pInfo = (PVOID)ajBuffer;
@@ -82,7 +82,7 @@
cbInfoSize,
&cbInfoSize);
- cbDataSize = cbInfoSize - FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data);
+ cbDataSize = pInfo->DataLength;
/* Note: STATUS_BUFFER_OVERFLOW is not a success */
if (NT_SUCCESS(Status))