mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:02:58 +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 */
|
/* Unknown */
|
||||||
return STATUS_NOT_SUPPORTED;
|
return STATUS_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Static length */
|
|
||||||
Length = 32;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BusQueryInstanceID:
|
case BusQueryInstanceID:
|
||||||
|
|
||||||
/* And our instance ID */
|
/* And our instance ID */
|
||||||
Id = L"0";
|
Id = L"0";
|
||||||
Length = sizeof(L"0") + sizeof(UNICODE_NULL);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BusQueryCompatibleIDs:
|
case BusQueryCompatibleIDs:
|
||||||
|
@ -511,6 +507,9 @@ HalpQueryIdPdo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
return STATUS_NOT_SUPPORTED;
|
return STATUS_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Calculate the length */
|
||||||
|
Length = (wcslen(Id) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
|
||||||
|
|
||||||
/* Allocate the buffer */
|
/* Allocate the buffer */
|
||||||
Buffer = ExAllocatePoolWithTag(PagedPool,
|
Buffer = ExAllocatePoolWithTag(PagedPool,
|
||||||
Length + sizeof(UNICODE_NULL),
|
Length + sizeof(UNICODE_NULL),
|
||||||
|
@ -556,14 +555,12 @@ HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
/* This is our hardware ID */
|
/* This is our hardware ID */
|
||||||
Id = HalHardwareIdString;
|
Id = HalHardwareIdString;
|
||||||
Length = wcslen(HalHardwareIdString) + sizeof(UNICODE_NULL);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BusQueryInstanceID:
|
case BusQueryInstanceID:
|
||||||
|
|
||||||
/* And our instance ID */
|
/* And our instance ID */
|
||||||
Id = L"0";
|
Id = L"0";
|
||||||
Length = sizeof(L"0") + sizeof(UNICODE_NULL);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -572,6 +569,9 @@ HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
return STATUS_NOT_SUPPORTED;
|
return STATUS_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Calculate the length */
|
||||||
|
Length = (wcslen(Id) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
|
||||||
|
|
||||||
/* Allocate the buffer */
|
/* Allocate the buffer */
|
||||||
Buffer = ExAllocatePoolWithTag(PagedPool,
|
Buffer = ExAllocatePoolWithTag(PagedPool,
|
||||||
Length + sizeof(UNICODE_NULL),
|
Length + sizeof(UNICODE_NULL),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue