PipMigrateResetDeviceCallback
NTSTATUS __fastcall PipMigrateResetDeviceCallback(
HPNPCTX *hPnpCtx,
const WCHAR *DeviceInstanceId,
_CM_OBJECT_TYPE CmObjectType,
VOID *Context){
NTSTATUS result;
int v7;
UINT64 *CmRegPropType;
UINT64 *PropertySize;
UINT64 v10;
UINT64 v11;
UINT8 PropertyBuffer[4];
UINT64 v13;
*(_DWORD *)PropertyBuffer = 0;
LODWORD(v13) = 0;
result = wcsicmp(DeviceInstanceId, L"HTREE\\ROOT\\0");
if( result )
{
LODWORD(v10) = 0;
HIDWORD(v13) = 4;
if( CmGetDeviceRegProp(
hPnpCtx,
DeviceInstanceId,
0i64,
11i64,
&v13,
PropertyBuffer,
(UINT64 *)((char *)&v13 + 4),
v10) >= 0
&& v13 == 0x400000004i64 )
{
v7 = *(_DWORD *)PropertyBuffer;
}
else
{
v7 = 0;
*(_DWORD *)PropertyBuffer = 0;
}
if( (v7 & 0x20) != 0
|| (LODWORD(v11) = 0,
*(_DWORD *)PropertyBuffer = v7 | 0x20,
LODWORD(PropertySize) = 4,
LODWORD(CmRegPropType) = 4,
result = CmSetDeviceRegProp(
hPnpCtx,
(WCHAR *)DeviceInstanceId,
0i64,
CM_REG_PROP_CONFIGFLAGS,
(UINT64)CmRegPropType,
PropertyBuffer,
(UINT64)PropertySize,
v11),
result >= 0) )
{
result = PnpSetObjectProperty(
(INT64)hPnpCtx,
(INT64)DeviceInstanceId,
1u,
0i64,
0i64,
(__int64)&DEVPKEY_Device_MigrationRank,
0,
0i64,
0,
0);
}
}
LOBYTE(result) = 1;
return result;
}Referenced by:
No references.