PopFxQueryBiosDeviceName
NTSTATUS __stdcall PopFxQueryBiosDeviceName(_DEVICE_NODE *DevNode, _UNICODE_STRING *BiosDeviceName){
_DEVICE_OBJECT *PhysicalDeviceObject;
VOID **Data;
unsigned __int16 v6;
NTSTATUS result;
UINT64 Size;
UINT64 Sizea;
UINT64 NumberOfBytes;
UINT64 Type;
LODWORD(NumberOfBytes) = 0;
PhysicalDeviceObject = DevNode->PhysicalDeviceObject;
LODWORD(Size) = 0;
LODWORD(Type) = 0;
Data = 0i64;
v6 = 0;
result = IoGetDevicePropertyData(
PhysicalDeviceObject,
(_DEVPROPKEY *)&DEVPKEY_Device_BiosDeviceName,
0i64,
0i64,
Size,
0i64,
&NumberOfBytes,
&Type);
if( result == -1073741789 )
{
if( (unsigned int)NumberOfBytes >= 0xFFFE )
return result;
Data = ExAllocatePoolWithTag(0x200ui64, (unsigned int)NumberOfBytes, 1297630800i64);
if( !Data )
return -1073741670;
v6 = NumberOfBytes;
result = 0;
}
if( result >= 0 )
{
LODWORD(Sizea) = v6;
result = IoGetDevicePropertyData(
DevNode->PhysicalDeviceObject,
(_DEVPROPKEY *)&DEVPKEY_Device_BiosDeviceName,
0i64,
0i64,
Sizea,
Data,
&NumberOfBytes,
&Type);
if( result >= 0 )
{
BiosDeviceName->MaximumLength = v6;
BiosDeviceName->Length = v6 - 2;
BiosDeviceName->Buffer = (wchar_t *)Data;
}
}
return result;
}Referenced by:
PopFxFindDeviceAndAllocateUniqueId