KsepRegistryQueryDWORD

NTSTATUS __fastcall KsepRegistryQueryDWORD(VOID *KeyHandle, WCHAR *SourceString, _DWORD *a3){
  NTSTATUS result; 
  __int64 v7; 
  __int64 v8; 
  UINT64 Length; 
  UINT64 ResultLength; 
  _UNICODE_STRING DestinationString; 
  char KeyValueInformation[4]; 
  int v13; 
  int v14; 
  int v15; 

  DestinationString = 0i64;
  if( !KeyHandle )
  {
    v7 = ((unsigned __int8)_InterlockedExchangeAdd(&KsepHistoryErrorsIndex, 1u) + 1) & 0x3F;
    KsepHistoryErrors[2 * v7 + 1] = -1073740768;
    KsepHistoryErrors[2 * v7] = 262790;
    if( (KsepDebugFlag & 4) != 0 )
      RtlAssert("KeyHandle != NULL", "minkernel\\ntos\\kshim\\kseregistry.c", 646i64, 0i64);
  }
  if( !a3 )
  {
    v8 = ((unsigned __int8)_InterlockedExchangeAdd(&KsepHistoryErrorsIndex, 1u) + 1) & 0x3F;
    KsepHistoryErrors[2 * v8 + 1] = -1073740768;
    KsepHistoryErrors[2 * v8] = 262791;
    if( (KsepDebugFlag & 4) != 0 )
      RtlAssert("Value != NULL", "minkernel\\ntos\\kshim\\kseregistry.c", 647i64, 0i64);
  }
  *a3 = 0;
  LODWORD(ResultLength) = 20;
  RtlInitUnicodeString(&DestinationString, SourceString);
  LODWORD(Length) = 20;
  result = ZwQueryValueKey(
             KeyHandle,
             &DestinationString,
             KeyValuePartialInformation,
             KeyValueInformation,
             Length,
             &ResultLength);
  if( !result )
  {
    if( v14 == 4 && v13 == 4 )
      *a3 = v15;
    else
      return -1073741788;
  }
  return result;
}

Referenced by:

KsepEngineReadFlags