PiProcessResourceRequirementsChanged
NTSTATUS __stdcall PiProcessResourceRequirementsChanged(_PNP_DEVICE_ACTION_ENTRY *Request){
_DEVICE_OBJECT *DeviceObject;
void *DeviceNode;
_KEVENT *CompletionEvent;
int v5;
UINT64 ReallocateResources;
UINT64 Synchronous;
UINT64 ProcessOnlyIntermediateStates;
_ADD_CONTEXT AddContext;
AddContext = 0i64;
DeviceObject = Request->DeviceObject;
if( DeviceObject )
DeviceNode = DeviceObject->DeviceObjectExtension->DeviceNode;
else
DeviceNode = 0i64;
ObfReferenceObjectWithTag(DeviceObject, 0x65706E50ui64);
if( (unsigned int)(*((_DWORD *)DeviceNode + 75) - 787) <= 1 )
{
v5 = -1073741738;
}
else
{
PoFxActivateDevice(Request->DeviceObject);
*((_DWORD *)DeviceNode + 176) |= 0x40u;
PipClearDevNodeFlags((_DEVICE_NODE *)DeviceNode, 0x100ui64);
PipSetDevNodeFlags((_DEVICE_NODE *)DeviceNode, 0x400ui64);
PipClearDevNodeProblem((_DEVICE_NODE *)DeviceNode);
if( *((_DWORD *)DeviceNode + 75) == 776 )
{
if( Request->RequestArgument )
PipClearDevNodeFlags((_DEVICE_NODE *)DeviceNode, 0x800ui64);
else
PipSetDevNodeFlags((_DEVICE_NODE *)DeviceNode, 0x800ui64);
PnpReallocateResources((_DEVICE_NODE *)DeviceNode);
CompletionEvent = Request->CompletionEvent;
AddContext.DriverStartType = 3;
AddContext.LoadDriver = *(&PnpReplaceEvent + 6682);
ObfReferenceObject(*(PVOID *)(*(&PnpReplaceEvent + 831) + 32i64));
LOBYTE(ProcessOnlyIntermediateStates) = 0;
LOBYTE(Synchronous) = CompletionEvent != 0i64;
LOBYTE(ReallocateResources) = 0;
v5 = PipProcessDevNodeTree(
*(&PnpReplaceEvent + 831),
Request,
&AddContext,
EnumTypeNone,
ReallocateResources,
Synchronous,
ProcessOnlyIntermediateStates);
if( v5 < 0 )
v5 = 0;
}
else
{
v5 = -1073741823;
}
}
if( (*((_DWORD *)DeviceNode + 176) & 0x40) != 0 )
{
PoFxIdleDevice(*((_DEVICE_OBJECT **)DeviceNode + 4));
*((_DWORD *)DeviceNode + 176) &= ~0x40u;
}
ObfDereferenceObjectWithTag(Request->DeviceObject, 0x65706E50ui64);
return v5;
}Referenced by:
PnpDeviceActionWorker