IopAllocateLegacyBootResources
NTSTATUS __stdcall IopAllocateLegacyBootResources(_INTERFACE_TYPE InterfaceType, UINT64 BusNumber){
int v2;
_CM_RESOURCE_LIST *CmResourceList;
PVOID *v5;
PVOID v6;
void *v8;
_CM_RESOURCE_LIST *BootResources;
_DWORD *v10;
void *v11;
v2 = BusNumber;
if( IopInitHalDeviceNode )
{
if( IopInitHalResources )
{
v11 = 0i64;
CmResourceList = IopCreateCmResourceList(
InterfaceType,
(unsigned int)InterfaceType,
(_CM_RESOURCE_LIST **)(unsigned int)BusNumber,
(_CM_RESOURCE_LIST *)&v11);
if( CmResourceList )
{
v8 = v11;
if( v11 )
ExFreePoolWithTag(IopInitHalResources, 0);
IopInitHalResources = v8;
BootResources = IopInitHalDeviceNode->BootResources;
PipSetDevNodeFlags(IopInitHalDeviceNode, 0x40ui64);
IopAllocateBootResources(ArbiterRequestHalReported, IopInitHalDeviceNode->PhysicalDeviceObject, CmResourceList);
IopInitHalDeviceNode->BootResources = IopCombineCmResourceList(BootResources, CmResourceList);
if( BootResources )
ExFreePoolWithTag(BootResources, 0);
}
}
}
v5 = 0i64;
LABEL_5:
v6 = IopInitReservedResourceList;
while( v6 )
{
v10 = (_DWORD *)*((_QWORD *)v6 + 2);
if( v10[1] == InterfaceType && v10[2] == v2 )
{
IopAllocateBootResources(ArbiterRequestPnpEnumerated, *((PDEVICE_OBJECT *)v6 + 1), *((PCM_RESOURCE_LIST *)v6 + 2));
if( !*((_QWORD *)v6 + 1) )
ExFreePoolWithTag(v10, 0);
if( v5 )
*v5 = *(PVOID *)v6;
else
IopInitReservedResourceList = *(PVOID *)v6;
ExFreePoolWithTag(v6, 0);
if( !v5 )
goto LABEL_5;
v6 = *v5;
}
else
{
v5 = (PVOID *)v6;
v6 = *(PVOID *)v6;
}
}
return 0;
}Referenced by:
IopInitializeBootDrivers
PipProcessStartPhase2