SiOpenRegistryKey

NTSTATUS __stdcall SiOpenRegistryKey(WCHAR *KeyName, VOID **Handle){
  VOID **v2; 
  VOID **v3; 
  INT64 v4; 
  int v5; 
  _UNICODE_STRING DestinationString; 
  _OBJECT_ATTRIBUTES ObjectAttributes; 
  VOID *KeyHandle; 

  *(&ObjectAttributes.Length + 1) = 0;
  *(&ObjectAttributes.Attributes + 1) = 0;
  KeyHandle = 0i64;
  v3 = v2;
  DestinationString = 0i64;
  RtlInitUnicodeString(&DestinationString, (PCWSTR)Handle);
  ObjectAttributes.ObjectName = &DestinationString;
  ObjectAttributes.Length = 48;
  ObjectAttributes.Attributes = 576;
  *(_OWORD *)&ObjectAttributes.SecurityDescriptor = 0i64;
  v5 = ZwOpenKey(
         &KeyHandle,
         0x20019ui64,
         &ObjectAttributes,
         v4,
         *(INT64 *)&DestinationString.Length,
         (INT64)DestinationString.Buffer,
         *(INT64 *)&ObjectAttributes.Length,
         0i64);
  if( v5 < 0 )
  {
    if( KeyHandle )
      ZwClose((_HANDLE)KeyHandle);
  }
  else
  {
    *v3 = KeyHandle;
  }
  return v5;
}

Referenced by:

SiGetRegistryValue