mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[HAL]
- Fix string length calculation svn path=/trunk/; revision=53250
This commit is contained in:
parent
a92715a798
commit
3efa379202
1 changed files with 6 additions and 6 deletions
|
@ -492,16 +492,12 @@ HalpQueryIdPdo(IN PDEVICE_OBJECT DeviceObject,
|
|||
/* Unknown */
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/* Static length */
|
||||
Length = 32;
|
||||
break;
|
||||
|
||||
case BusQueryInstanceID:
|
||||
|
||||
/* And our instance ID */
|
||||
Id = L"0";
|
||||
Length = sizeof(L"0") + sizeof(UNICODE_NULL);
|
||||
break;
|
||||
|
||||
case BusQueryCompatibleIDs:
|
||||
|
@ -511,6 +507,9 @@ HalpQueryIdPdo(IN PDEVICE_OBJECT DeviceObject,
|
|||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/* Calculate the length */
|
||||
Length = (wcslen(Id) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
|
||||
|
||||
/* Allocate the buffer */
|
||||
Buffer = ExAllocatePoolWithTag(PagedPool,
|
||||
Length + sizeof(UNICODE_NULL),
|
||||
|
@ -556,14 +555,12 @@ HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject,
|
|||
|
||||
/* This is our hardware ID */
|
||||
Id = HalHardwareIdString;
|
||||
Length = wcslen(HalHardwareIdString) + sizeof(UNICODE_NULL);
|
||||
break;
|
||||
|
||||
case BusQueryInstanceID:
|
||||
|
||||
/* And our instance ID */
|
||||
Id = L"0";
|
||||
Length = sizeof(L"0") + sizeof(UNICODE_NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -572,6 +569,9 @@ HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject,
|
|||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/* Calculate the length */
|
||||
Length = (wcslen(Id) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
|
||||
|
||||
/* Allocate the buffer */
|
||||
Buffer = ExAllocatePoolWithTag(PagedPool,
|
||||
Length + sizeof(UNICODE_NULL),
|
||||
|
|
Loading…
Reference in a new issue