PiDrvDbGetNodeSystemRoot
__int64 __fastcall PiDrvDbGetNodeSystemRoot(__int64 a1, _QWORD *a2){
NTSTATUS ObjectProperty;
VOID *StringRoutine;
__int64 v6;
unsigned __int16 v7;
unsigned __int64 v8;
INT64 v10;
unsigned int v11;
ObjectProperty = 0;
LODWORD(v10) = 0;
v11 = 0;
*a2 = 0i64;
if( !*(_QWORD *)(a1 + 512) )
{
*(_WORD *)(a1 + 504) = 0;
*(_WORD *)(a1 + 506) = 520;
StringRoutine = ExpAllocateStringRoutine(0x208ui64);
*(_QWORD *)(a1 + 512) = StringRoutine;
if( !StringRoutine )
return(unsigned int)-1073741670;
ObjectProperty = PnpGetObjectProperty(
*(&stru_140CF2E80 + 1214),
*(_QWORD *)(a1 + 24),
7i64,
*(_QWORD *)(a1 + 72),
0i64,
(INT64)&DEVPKEY_DriverDatabase_SystemRoot,
(INT64)&v10,
(INT64)StringRoutine);
if( ObjectProperty < 0
|| (_DWORD)v10 != 18
|| v11 <= 2
|| (v6 = *(_QWORD *)(a1 + 512), *(_WORD *)(v6 + 2 * ((unsigned __int64)v11 >> 1) - 2)) )
{
ObjectProperty = 0;
**(_WORD **)(a1 + 512) = 0;
}
else
{
v7 = v11 - 2;
*(_WORD *)(a1 + 504) = v11 - 2;
if( v7 > 2u )
{
v8 = (unsigned __int64)v7 >> 1;
if( *(_WORD *)(v6 + 2 * v8 - 2) == 92 )
{
*(_WORD *)(v6 + 2 * v8 - 2) = 0;
*(_WORD *)(a1 + 504) -= 2;
}
}
}
}
if( **(_WORD **)(a1 + 512) )
*a2 = a1 + 504;
else
return(unsigned int)-1073741275;
return(unsigned int)ObjectProperty;
}Referenced by:
PiDrvDbQuerySystemPathWin32
PiDrvDbResolveKeyFilePaths
PiDrvDbResolveNodeFilePaths