PiGetDriverMutableStateDirectory

NTSTATUS __stdcall PiGetDriverMutableStateDirectory(
        INT64 a1,
        INT64 a2,
        INT64 a3,
        INT64 a4,
        INT64 a5,
        INT64 a6,
        INT64 a7,
        INT64 a8,
        INT64 a9,
        INT64 a10,
        _HHIVE *Hive,
        INT64 a12,
        INT64 a13,
        INT64 a14,
        INT64 a15){
  int StateRootPath; 
  __int64 v18; 
  _UNICODE_STRING DestinationString; 
  _UNICODE_STRING String; 

  DestinationString = 0i64;
  String = 0i64;
  RtlInitUnicodeString(&DestinationString, 0i64);
  RtlInitUnicodeString(&String, 0i64);
  StateRootPath = PiGetStateRootPath(L"Win32ServiceStateRoot");
  if( StateRootPath >= 0 )
  {
    v18 = -1i64;
    do
      ++v18;
    while( *(_WORD *)&aData[2 * v18] );
    if( DestinationString.Length
       + (unsigned int)*(unsigned __int16 *)(*(_QWORD *)(a1 + 48) + 24i64)
       + 4
       + 2 * (_DWORD)v18 <= 0xFFFE )
    {
      StateRootPath = IopAllocateUnicodeString(
                        &String,
                        DestinationString.Length + *(_WORD *)(*(_QWORD *)(a1 + 48) + 24i64) + 4 + 2 * v18);
      if( StateRootPath >= 0 )
      {
        StateRootPath = RtlUnicodeStringPrintfEx(&String, 0i64, 0x800ui64, (WCHAR *)L"%wZ\\%wZ\\%ws");
        if( StateRootPath >= 0 )
        {
          StateRootPath = PiOpenDirectoryWithRoot(&DestinationString, &String);
          if( StateRootPath >= 0 )
            *(_QWORD *)a3 = 0i64;
        }
      }
    }
    else
    {
      StateRootPath = -2147483643;
    }
  }
  RtlFreeAnsiString(&DestinationString);
  RtlFreeAnsiString(&String);
  return StateRootPath;
}

Referenced by:

No references.