PnpValidateMultiSz

NTSTATUS __fastcall PnpValidateMultiSz(__int64 a1, __int64 a2){
  unsigned __int64 v2; 
  __int64 v4; 
  NTSTATUS result; 
  UINT64 v6; 
  unsigned __int64 v7; 
  __int64 pcchLength; 

  v2 = 0i64;
  pcchLength = 0i64;
  v4 = a1;
  for( result = -1073741811; a1; result = 0 )
  {
    result = RtlStringCchLengthW((WCHAR *)(v4 + 2 * v2), a2 - v2, (UINT64 *)&pcchLength);
    if( result < 0 )
      break;
    a1 = pcchLength;
    v7 = pcchLength + v6;
    if( pcchLength + v6 >= v6 )
    {
      v2 = v7 + 1;
      if( v7 + 1 >= v7 )
        continue;
    }
    return -1073741675;
  }
  return result;
}

Referenced by:

PiDqQueryValidateQueryData
PiSwValidateCreateData