IoOpenDeviceRegistryKey

NTSTATUS __stdcall IoOpenDeviceRegistryKey(
        PDEVICE_OBJECT DeviceObject,
        ULONG DevInstKeyType,
        _ACCESS_MASK DesiredAccess,
        PHANDLE DeviceRegKey){
  char v6; 
  _DWORD *DeviceNode; 
  int v9; 
  _ETHREAD *CurrentThread; 
  int v11; 
  int v12; 
  UINT64 DesiredAccessa; 

  v6 = DevInstKeyType;
  if( !DeviceObject )
    return -1073741811;
  DeviceNode = DeviceObject->DeviceObjectExtension->DeviceNode;
  if( !DeviceNode || (DeviceNode[99] & 0x20000) != 0 )
    return -1073741811;
  if( (v6 & 1) != 0 )
  {
    v9 = 17;
    goto LABEL_7;
  }
  if( (v6 & 2) == 0 )
    return -1073741811;
  v9 = 18;
LABEL_7:
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  --CurrentThread->Tcb.KernelApcDisable;
  ExAcquireResourceExclusiveLite((UINT64)&PnpReplaceEvent + 6688, 1, *(INT64 *)&DesiredAccess);
  v11 = v9 | 0x200;
  if( (v6 & 4) == 0 )
    v11 = v9;
  LODWORD(DesiredAccessa) = DesiredAccess;
  v12 = CmOpenDeviceRegKey(
          *(&stru_140CF2E80 + 607),
          *((WCHAR **)DeviceObject->DeviceObjectExtension->DeviceNode + 6),
          (_CM_KEY_TYPE)v11,
          0i64,
          DesiredAccessa,
          1u,
          DeviceRegKey,
          0i64);
  if( v12 >= 0 )
  {
    if( DeviceRegKey )
      IopApplyMutableTagToRegistryKey((_HANDLE)*DeviceRegKey);
  }
  ExReleaseResourceLite((PERESOURCE)((char *)&PnpReplaceEvent + 6688));
  KeLeaveCriticalRegionThread(KeGetCurrentThread());
  return v12;
}

Referenced by:

No references.