PnpSaveDeviceCapabilities
__int64 __fastcall PnpSaveDeviceCapabilities(__int64 a1, _DWORD *a2, char a3){
unsigned int v5;
NTSTATUS v6;
HANDLE v7;
bool v8;
unsigned int *v9;
bool v10;
unsigned int *v11;
__int64 v13;
HANDLE Handle;
unsigned int v15;
v15 = 0;
Handle = 0i64;
v5 = a3 != 0 ? 0x20000 : 0;
v6 = PnpDeviceObjectToDeviceInstance(*(DEVICE_OBJECT **)(a1 + 32), &Handle, 0xF003Fui64);
if( v6 >= 0 )
{
if( (*(_DWORD *)(a1 + 396) & 0x40) != 0 )
{
v13 = *(_QWORD *)(a1 + 720);
if( !v13 || (*(_BYTE *)(v13 + 16) & 4) == 0 )
a2[1] &= ~0x200u;
}
v7 = Handle;
*(_DWORD *)(a1 + 560) = a2[1];
v15 = (a2[1] & 0x3FC | (a2[1] >> 13) & 8 | ((a2[1] & 0xC000 | (a2[1] >> 4) & 0x10000u) >> 4)) >> 2;
CmSetDeviceRegProp(PiPnpRtlCtx, *(const WCHAR **)(a1 + 48), (__int64)v7, 0x10u, 4u, (__int64)&v15, 4u, v5);
v8 = a2[3] != -1;
v15 = a2[3];
v9 = &v15;
if( v15 == -1 )
v9 = 0i64;
CmSetDeviceRegProp(PiPnpRtlCtx, *(const WCHAR **)(a1 + 48), (__int64)Handle, 0x11u, 4u, (__int64)v9, v8 ? 4 : 0, v5);
v10 = a2[2] != -1;
v15 = a2[2];
v11 = &v15;
if( v15 == -1 )
v11 = 0i64;
CmSetDeviceRegProp(
PiPnpRtlCtx,
*(const WCHAR **)(a1 + 48),
(__int64)Handle,
0x1Du,
4u,
(__int64)v11,
v10 ? 4 : 0,
v5);
}
if( Handle )
ZwClose(Handle);
return(unsigned int)v6;
}Referenced by:
PiProcessNewDeviceNode
PnpQueryAndSaveDeviceNodeCapabilities