VhdiQueryVolumeVhdFilePath

WCHAR *__fastcall VhdiQueryVolumeVhdFilePath(VOID *VolumeHandle){
  ULONG OutputBufferLength; 
  void *OutputBuffer; 
  void *v5; 
  NTSTATUS v6; 
  struct _IO_STATUS_BLOCK IoStatusBlock; 
  IoStatusBlock = 0i64;
  if( !VolumeHandle )
    return 0i64;
  for( OutputBufferLength = 520; ; OutputBufferLength *= 2 )
  {
    OutputBuffer = ExAllocatePoolWithTag(NonPagedPoolNx, OutputBufferLength, 0x42646856ui64);
    v5 = OutputBuffer;
    if( !OutputBuffer )
      break;
    v6 = ZwDeviceIoControlFile(
           VolumeHandle,
           0i64,
           0i64,
           0i64,
           &IoStatusBlock,
           0x2D5928u,
           0i64,
           0,
           OutputBuffer,
           OutputBufferLength);
    if( v6 != -1073741789 )
      goto LABEL_8;
    ExFreeHeapPool(v5);
  }
  v6 = -1073741801;
LABEL_8:
  if( v6 < 0 )
  {
    if( v5 )
    {
      ExFreeHeapPool(v5);
      return 0i64;
    }
  }
  return(WCHAR *)v5;
}

Referenced by:

VhdiInitializeBootDisk