mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:36:11 +00:00
[WIN32K]
- Slightly improve the way the Device Description is retrieved. - Slightly improve registry function. svn path=/trunk/; revision=62029
This commit is contained in:
parent
9bae59a449
commit
4f5c53dfe7
2 changed files with 4 additions and 3 deletions
|
@ -113,7 +113,8 @@ EngpRegisterGraphicsDevice(
|
||||||
pGraphicsDevice->pwszDescription = pwsz + pustrDiplayDrivers->Length / sizeof(WCHAR);
|
pGraphicsDevice->pwszDescription = pwsz + pustrDiplayDrivers->Length / sizeof(WCHAR);
|
||||||
RtlCopyMemory(pGraphicsDevice->pwszDescription,
|
RtlCopyMemory(pGraphicsDevice->pwszDescription,
|
||||||
pustrDescription->Buffer,
|
pustrDescription->Buffer,
|
||||||
pustrDescription->Length + sizeof(WCHAR));
|
pustrDescription->Length);
|
||||||
|
pGraphicsDevice->pwszDescription[pustrDescription->Length/sizeof(WCHAR)] = 0;
|
||||||
|
|
||||||
/* Initialize the pdevmodeInfo list and default index */
|
/* Initialize the pdevmodeInfo list and default index */
|
||||||
pGraphicsDevice->pdevmodeInfo = NULL;
|
pGraphicsDevice->pdevmodeInfo = NULL;
|
||||||
|
|
|
@ -58,7 +58,7 @@ RegQueryValue(
|
||||||
ULONG cbInfoSize, cbDataSize;
|
ULONG cbInfoSize, cbDataSize;
|
||||||
|
|
||||||
/* Check if the local buffer is sufficient */
|
/* 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))
|
if (cbInfoSize <= sizeof(ajBuffer))
|
||||||
{
|
{
|
||||||
pInfo = (PVOID)ajBuffer;
|
pInfo = (PVOID)ajBuffer;
|
||||||
|
@ -82,7 +82,7 @@ RegQueryValue(
|
||||||
cbInfoSize,
|
cbInfoSize,
|
||||||
&cbInfoSize);
|
&cbInfoSize);
|
||||||
|
|
||||||
cbDataSize = cbInfoSize - FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data);
|
cbDataSize = pInfo->DataLength;
|
||||||
|
|
||||||
/* Note: STATUS_BUFFER_OVERFLOW is not a success */
|
/* Note: STATUS_BUFFER_OVERFLOW is not a success */
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue