CmpGetVirtualizationIDFromFullVirtualPath

NTSTATUS __stdcall CmpGetVirtualizationIDFromFullVirtualPath(_UNICODE_STRING *FullVirtPath, _UNICODE_STRING *SidString){
  unsigned __int16 v2; 
  wchar_t *Buffer; 
  wchar_t *v4; 
  int v5; 
  unsigned __int64 Length; 
  unsigned __int16 v7; 
  wchar_t *v8; 
  unsigned __int16 v9; 
  int v10; 
  NTSTATUS result; 
  unsigned __int64 v12; 

  v2 = 0;
  *SidString = *FullVirtPath;
  Buffer = SidString->Buffer;
  v4 = Buffer;
  v5 = 3;
  while( *Buffer != 92 || --v5 )
  {
    Length = SidString->Length;
    ++Buffer;
    ++v2;
    SidString->Buffer = Buffer;
    v4 = Buffer;
    if( 2 * (unsigned __int64)v2 >= Length )
      return -1073741811;
  }
  v7 = SidString->Length;
  *(_DWORD *)&SidString->Length = 0;
  v8 = v4 + 1;
  v9 = v7 - 2 * v2 - 2;
  SidString->Buffer = v8;
  v10 = 0;
  result = -1073741811;
  if( v9 )
  {
    v12 = 0i64;
    while( v8[v12 / 2] != 92 )
    {
      SidString->Length += 2;
      v12 = 2i64 * (unsigned int)++v10;
      if( v12 >= v9 )
        return result;
    }
    return 0;
  }
  return result;
}

Referenced by:

CmpGetCmHiveFromVirtualPath