CmGetParentDeviceContainerId

NTSTATUS __stdcall CmGetParentDeviceContainerId(HPNPCTX *hPnpCtx, WCHAR *DeviceInstanceId, UINT8 *PropertyBuffer){
  VOID **PoolWithTag; 
  VOID **v7; 
  int DeviceParent; 
  UINT64 ParentDeviceInstanceIdLength; 
  INT64 v11; 

  LODWORD(v11) = 0;
  LODWORD(ParentDeviceInstanceIdLength) = 200;
  PoolWithTag = ExAllocatePoolWithTag(1ui64, 0x190ui64, 1380994640i64);
  v7 = PoolWithTag;
  if( !PoolWithTag )
    return -1073741801;
  DeviceParent = CmGetDeviceParent(hPnpCtx, DeviceInstanceId, (WCHAR *)PoolWithTag, &ParentDeviceInstanceIdLength);
  if( DeviceParent >= 0 )
  {
    DeviceParent = PnpGetObjectProperty(
                     (ULONG)hPnpCtx,
                     (INT64)v7,
                     1i64,
                     0i64,
                     0i64,
                     (INT64)&DEVPKEY_Device_ContainerId,
                     (INT64)&v11,
                     (INT64)PropertyBuffer);
    if( DeviceParent >= 0 )
      DeviceParent = -1073741823;
  }
  ExFreePoolWithTag(v7, 0);
  return DeviceParent;
}

Referenced by:

CmUpdateDevicePanel