AslPathToSystemPathBuf
__int64 __fastcall AslPathToSystemPathBuf(NTSTRSAFE_PWSTR pszDest, size_t cchDest, NTSTRSAFE_PCWSTR pszSrc){
signed int v6;
size_t v7;
NTSTRSAFE_PWSTR i;
wchar_t v9;
NTSTRSAFE_PWSTR v10;
NTSTATUS v11;
signed int v13;
NTSTATUS v14;
memset((INT64)pszDest, 0i64);
v6 = 0;
if( cchDest - 1 > 0x7FFFFFFE )
v6 = -1073741811;
if( v6 < 0 )
{
if( cchDest )
*pszDest = 0;
}
else
{
v7 = cchDest;
for( i = pszDest; v7; --v7 )
{
if( !(2147483646 - cchDest + v7) )
break;
v9 = *(NTSTRSAFE_PWSTR)((char *)i + (char *)L"\\SystemRoot" - (char *)pszDest);
if( !v9 )
break;
*i++ = v9;
}
v10 = i - 1;
if( v7 )
v10 = i;
v6 = v7 == 0 ? 0x80000005 : 0;
*v10 = 0;
}
if( v6 >= 0 )
{
v11 = RtlStringCchCatW(pszDest, cchDest, (PWCHAR)pszSrc);
v6 = v11;
if( v11 < 0 )
{
v14 = v11;
AslLogCallPrintf(1ui64, "AslPathToSystemPathBuf", 0x5B0ui64, "Failed to cat string [%x]", v14);
return(unsigned int)-1073741811;
}
}
else
{
v13 = v6;
AslLogCallPrintf(1ui64, "AslPathToSystemPathBuf", 0x59Fui64, "Failed to copy string [%x]", v13);
}
return(unsigned int)v6;
}Referenced by:
AslEnvGetSystem32DirPathBuf
SdbpGetPathAppPatch