SepRegQueryValue

NTSTATUS __stdcall SepRegQueryValue(
        PVOID hKey,
        PWCHAR ValueName,
        UINT64 ValueType,
        UINT64 ValueLength,
        PVOID ValueBuffer){
  UINT64 v6; 
  int v7; 
  int v8; 
  int v10; 
  ULONG ResultLength; 
  struct _UNICODE_STRING DestinationString; 
  char KeyValueInformation[4]; 
  int v14; 
  int v15; 
  int Src[17]; 
  ResultLength = 0;
  v6 = (unsigned int)ValueLength;
  DestinationString = 0i64;
  v7 = ValueType;
  RtlInitUnicodeString(&DestinationString, ValueName, ValueType);
  v8 = ZwQueryValueKey(hKey, &DestinationString, KeyValuePartialInformation, KeyValueInformation, 0x50u, &ResultLength);
  if( v8 >= 0 )
  {
    if( v14 == v7 && v15 == (_DWORD)v6 )
    {
      v10 = v7 - 3;
      if( v10 )
      {
        if( v10 == 1 && (unsigned int)v6 >= 4 )
          *(_DWORD *)ValueBuffer = Src[0];
        else
          return -1073741811;
      }
      else
      {
        memmove((UINT8 *)ValueBuffer, (UINT8 *)Src, v6);
      }
    }
    else
    {
      return -1073741788;
    }
  }
  return v8;
}

Referenced by:

SepAdtInitializeBounds
SepAdtInitializeCrashOnFail
SepAdtInitializePrivilegeAuditing
SepRegQueryDwordValue