IopInitializeSystemVariableService

VOID __fastcall IopInitializeSystemVariableService(_BYTE *a1, INT64 a2){
  WCHAR v2; 
  WCHAR v3; 
  ULONG ResultLength; 
  void *KeyHandle; 
  struct _UNICODE_STRING DestinationString; 
  struct _OBJECT_ATTRIBUTES ObjectAttributes; 
  char KeyValueInformation[4]; 
  int v9; 
  int v10; 
  int v11; 
  *(&ObjectAttributes.Length + 1) = 0;
  *(&ObjectAttributes.Attributes + 1) = 0;
  ResultLength = 0;
  DestinationString = 0i64;
  TraceLoggingRegisterEx_EtwRegister_EtwSetInformation(&dword_140C044D0);
  KeyHandle = 0i64;
  RtlInitUnicodeString(
    &DestinationString,
    L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\WindowsTrustedRT\\Parameters",
    v2);
  ObjectAttributes.RootDirectory = 0i64;
  ObjectAttributes.ObjectName = &DestinationString;
  ObjectAttributes.Length = 48;
  ObjectAttributes.Attributes = 576;
  *(_OWORD *)&ObjectAttributes.SecurityDescriptor = 0i64;
  if( ZwOpenKey(&KeyHandle, 0x20019u, &ObjectAttributes) >= 0 )
  {
    RtlInitUnicodeString(&DestinationString, L"Flags", v3);
    if( ZwQueryValueKey(
           KeyHandle,
           &DestinationString,
           KeyValuePartialInformation,
           KeyValueInformation,
           0x10u,
           &ResultLength) >= 0
      && v9 == 4
      && v10 == 4 )
    {
      IopSysEnvOverrideFlags = v11;
    }
  }
  if( KeyHandle )
    ZwClose(KeyHandle);
}

Referenced by:

IoInitSystemPreDrivers