IoSetEnvironmentVariableEx

INT64 __stdcall IoSetEnvironmentVariableEx(
        WCHAR *VariableName,
        GUID *VendorGuid,
        PVOID Value,
        UINT64 ValueLength,
        UINT64 Attributes){
  int v8; 
  int v9; 
  struct _DMA_ADAPTER *v10; 
  PVOID v12; 
  PADAPTER_OBJECT DmaAdapter; 
  PDEVICE_OBJECT DeviceObject; 
  void **v15[2]; 
  struct _EVENT_DATA_DESCRIPTOR v16; 
  char v17[16]; 
  GUID *v18; 
  int v19; 
  int v20; 
  PADAPTER_OBJECT *p_DmaAdapter; 
  int v22; 
  int v23; 
  PDEVICE_OBJECT *p_DeviceObject; 
  int v25; 
  int v26; 
  void ***v27; 
  int v28; 
  int v29; 
  DeviceObject = 0i64;
  DmaAdapter = 0i64;
  v15[0] = 0i64;
  v8 = ValueLength;
  v9 = IopOpenSystemVariableDevice((PFILE_OBJECT *)&DmaAdapter, &DeviceObject, v15);
  if( v9 >= 0 )
  {
    v12 = Value;
    v10 = DmaAdapter;
    v9 = (*((__int64(__fastcall **)(PADAPTER_OBJECT, PDEVICE_OBJECT, WCHAR *, GUID *, PVOID, int, _DWORD))v15[0] + 1))(
           DmaAdapter,
           DeviceObject,
           VariableName,
           VendorGuid,
           v12,
           v8,
           Attributes);
    if( v10 )
      HalPutDmaAdapter(v10);
  }
  if( (unsigned int)dword_140C044D0 > 5 && tlgKeywordOn((__int64)&dword_140C044D0, 0x200000000000i64) )
  {
    tlgCreate1Sz_wchar_t((__int64)v17, VariableName);
    v20 = 0;
    v23 = 0;
    v26 = 0;
    v29 = 0;
    p_DmaAdapter = &DmaAdapter;
    v22 = 4;
    p_DeviceObject = &DeviceObject;
    v27 = v15;
    v25 = 4;
    v28 = 4;
    v18 = VendorGuid;
    v19 = 16;
    LODWORD(DmaAdapter) = v8;
    LODWORD(DeviceObject) = Attributes;
    LODWORD(v15[0]) = v9;
    tlgWriteTransfer_EtwWriteTransfer(
      (__int64)&dword_140C044D0,
      (unsigned __int8 *)byte_140024033,
      0i64,
      0i64,
      7u,
      &v16);
  }
  return(unsigned int)v9;
}

Referenced by:

ExpSetBootEntry
ExpSetDriverEntry
ExpSetFirmwareEnvironmentVariable
IopInitializeInMemoryDumpData
IopInitializeOfflineCrashDump
NtDeleteBootEntry
NtDeleteDriverEntry
NtSetBootEntryOrder
NtSetBootOptions
NtSetDriverEntryOrder