Jump to content











Photo
- - - - -

Retrieving device/drive information


  • Please log in to reply
100 replies to this topic

#51 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 16 May 2015 - 07:58 PM

// The PARTITION_INFORMATION_EX structure is used with the
// IOCTL_DISK_GET_DRIVE_LAYOUT_EX, IOCTL_DISK_SET_DRIVE_LAYOUT_EX,
// IOCTL_DISK_GET_PARTITION_INFO_EX and IOCTL_DISK_GET_PARTITION_INFO_EX calls.

  
  _PARTITION_INFORMATION_EX = record
    PartitionStyle: PARTITION_STYLE;
    StartingOffset: LARGE_INTEGER;
    PartitionLength: LARGE_INTEGER;
    PartitionNumber: DWORD;
    RewritePartition: BOOLEAN;
    case Integer of
      0: (Mbr: PARTITION_INFORMATION_MBR);
      1: (Gpt: PARTITION_INFORMATION_GPT);
  end;
  

//
// GPT specific drive layout information.
  _DRIVE_LAYOUT_INFORMATION_GPT = record
    DiskId: GUID;
    StartingUsableOffset: LARGE_INTEGER;
    UsableLength: LARGE_INTEGER;
    MaxPartitionCount: DWORD;
  end;



// MBR specific drive layout information.
  _DRIVE_LAYOUT_INFORMATION_MBR = record
    Signature: DWORD;
  end;
  

Careful with the PARTITION_STYLE.

Make sure this is 4 bytes long.

Actually, I sometimes had to force it to dword rather than a custom type.

 

Also careful with dword (4 bytes) and large_integer (8 bytes).

Make sure this is translated right in your vb code (i use to code in VB but it was a long time ago and I remember vaguely issues there).



#52 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 16 May 2015 - 08:05 PM

Thank you much, will keep you suggestions in mind.



#53 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 17 October 2015 - 09:45 PM

Wonko, cdob erwan.l,

I've completely rewritten this tool.
No elevation is required for the listing capability.
I am afraid it has become a kind of a developer tool now (maybe contains uninteresting features for many people).
While using  IOCTL-functions, distinction between drives and partitions is neccessary.
Failure or success depends on the correct input for a device handle (GUID, DriveLetter, DevicePath for a volume or PhysicalDriveN for a drive).
It is quite hard (to my understanding) to implement distinction between drives and partitions if you don't use a GUI (as seen in CloneDisk for example), so I addressed this "problem" to the  best of my knowledge.

Okay, let me try to explain (I hope my english is good enough):

Background: For VB6, I was able to completely de-obfusecate DiskGetDriveLayoutEx and DiskGetPartitionInfoEx (and some other IOCTL functions) without declaring structures, members and most important data types.
In my experience they didn't represent the correct byte offsets and therefore didn't retrieve correct values.
Instead, I managed to read out the corresponding byte arrays byte by byte.
Much thanks here to erwan.l's CloneDisk.
Without it as reference I would have never be able to compare the correct byte offsets for the corresponding structure members.

This version should find ANY local drive and its partitions now.
It is no more dependent on enumerations of DriveLetters or GUIDs alone.
My usage of DiskGetDriveLayoutEx as main function retrieves all PhysicalDrives+CD/DVDRoms and returns an array of all detected partitions (see CloneDisk --> Disk --> Partition Editor).
Drawback of DiskGetDriveLayoutEx: for each partition found no drive letters is returned.

Therefore a routine inside the array is added to retrieve the corresponding driveletters (slows down this tool).
The most important steps:
--> enumerating all GUIDS and DriveLetters
--> retrieving Drive/PartitionInfo for each (Drive and ParitionNr. in main)
--> compare Drive/PartitionNr with Drive/PartitionNr for each partition found by DiskGetDriveLayoutEx
--> on match the corresponding drive letter (and some more info) for each DiskGetDriveLayoutEx partition entry is added

To retrieve drive/partition info for volumes not detected by the IOCTL-functions (in case of failure) an adapted routine of the steps mentioned before is used (true for ImDisk and TrueCrypt volumes or locally mapped network shares).
- API-Functions does not retrieve a GUID but a PartitionNr(>0) for ImDisk volumes, whereas TrueCrypt volumes are detected with a GUID but with PartitionNr 0.
- A device path retrieved by QueryDosDevices for these volumes seems to be an invalid input for all IOCTL-EX functions.
- In main, all drive related IOCTL-Ex functions (e.g. DiskGetDriveLayoutEx, DiskGetMediaTypesEx, DiskGetDriveGeometryEx) fail for these devices (any device handle input).
- An exception is the partition related DiskGetPartitionInfoEx-function.
- It seems to be interesting that DiskGetDriveGeometry (not Ex - also drive related) is still able to get info for these mapped volumes.

For empty SD-Card slots and optical drives with a DriveLetter assigned, most IOCTL functions will fail if input is the corresponding DriveLetter (Err: Drive not ready). But they won't fail if a valid GUID or DevicePath (QueryDosDevices) is used as input.

For erwan.l: The correct drive size can also be retrieved by DiskGetPartitionInfoEx.
- Calling DiskGetPartitionInfoEx with PhysicalDriveN as input for a device handle retrieves the correct disk size. No other function is neccessary.

 

For Wonko: as long as you don't use the PartitionFilter options this tool should fit to your need to save the unique entries by the "set" command.

 

These are the new switches:
/DL:[{1|2}] = DiskGetDriveLayoutEx Filter:"
    if omitted show all detected Drvs and Parts."
    1  show DiskGetDriveLayoutEx entries only (including CD/DVDRoms)"
    2  show unknown Devs/Parts only (retrieve drive/partition entries"
       of GUIDs or mapped DrvLetters not detected by DiskGetDriveLayoutEx)"
       A "ud"-prefix followed by a count number is assigned for unknown devices"

/DF:[{1|2}] = DriveOrPartition Filter:"
    if omitted show Drvs and PartEntries."
    1  show Drvs only"
    2  show Parts only"

/PF:[{1|2}] = Partition Filter:"
    if omitted show only PartEntries with PartNr > 0."
    1  show all PartEntries with non-empty sizes (this option shows extended"
       partition info or partition entries invisible to mountmgr)"
    2  show all PartEntries (full DiskGetDriveLayoutEx)"

/MF:[{1|2}] = Mount Filter:"
    if omitted show mounted and unmounted PartEntries."
    1  show mounted PartEntries only"
    2  show unmounted PartEntries only"

/TF:[{2|3|4|5|6}] = DriveType Filter:"
    if omitted show all DrvTypes."
    2  show Removable Drvs only"
    3  show Fixed Drvs only"
    4  show Remote (network) Drvs only"
    5  show CD/DVD-Rom Drvs only"
    6  show Ramdisk Drvs only"

/SF:[{B|K|M|G|T}] = SizeUnit Filter:"
    if omitted attempt to detect size units automatically."
    B  sizes as Bytes"
    K  sizes as Kilobytes"
    M  sizes as Megabytes"
    G  sizes as Gigabytes"
    T  sizes as Terabytes"

/FF:[{1|2|3}] = VolumeFilesystemFlags Filter:"
    if omitted don't show FilesystemFlags."
    1  show all FilesystemFlags"
    2  show Flags tagged as True for each partition"
    3  show Flags tagged as False for each partition"

 

At least, many listing entries are somehow experimental.

In this version a full set of info will be displayed by default.

As always, download the file and replace extension "zip" with "exe".

 

In hope any of you (and certainly others) have some time to test and to provide some input on how to improve this tool...
 



#54 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 18 October 2015 - 09:45 AM

Very nice! :thumbsup:

I must find the time/media to test the thingy with actual media in the 4 slot "combo" SD card reader I have on this machine (with all empty slot the thingy seems like OK).

In an extremely short test (just ran it once, without using any switch) there is still something "flaky" about the virtual DVD device ("empty", i.e. with no media mounted to it) :

 

[cd1]DrvModelName =[KernSafe DVD-RAM MOUNTER SCSI Device]
[cd1]DrvDevPath =\Device\CdRom1
[cd1]DrvType =CD/DVD-Rom
[cd1]DrvDevType =CDRom
[cd1]DrvDevTypeSCSI =CD/DVD-Rom
[cd1]DrvDevTypeMedia =CDRom
[cd1]DrvBusType =SCSI
[cd1]DrvRemovable =True
[cd1]DrvVendorID =KernSafe
[cd1]DrvProductID =DVD-RAM MOUNTER
[cd1]DrvProductRev =1.65
[cd1]DrvSN =Unknown
[cd1]DrvMediaChars =ReadOnly
[cd1]DrvMediaType =CD-Rom
[cd1]DrvMediaSides =One-Sided
[cd1]DrvCylinders =Unknown
[cd1]DrvTracks/Cyl =64
[cd1]DrvSects/Track =32
[cd1]DrvBytes/Sect =2048
[cd1]DrvTotalSects =0
[cd1]DrvSize =0
[cd1]DrvLayoutStyle =MBR
[cd1]DrvPartCount =1
[cd1]DrvMBRSignature =00000001

[cd1]DrvModelName =[KernSafe DVD-RAM MOUNTER SCSI Device]
[cd1]PartDevPath =\Device\CdRom1
[cd1]PartGUID =\\?\Volume{c930f56b-520e-11e4-b08b-001fc6bb76ce}\
[cd1]PartDrvType =CD/DVD-Rom
[cd1]PartMediaType =CD-Rom
[cd1]PartLayoutStyle =MBR
[cd1]PartType =FAT32/Win95/OSR2
[cd1]PartNr =0
[cd1]PartStartOffset =0 Bytes
[cd1]PartSize =0
[cd1]PartRewrite =False
[cd1]PartHiddenSectors =Unknown
[cd1]PartIsBootable =False
[cd1]PartIsRecognised =True
[cd1]VolSectors/Cluster =Unknown
[cd1]VolBytes/Sector =Unknown
[cd1]VolClusterSize =Unknown
[cd1]VolTotalClusters =Unknown
[cd1]VolUsedClusters =Unknown
[cd1]VolFreeClusters =Unknown
[cd1]VolLBL =Unknown
[cd1]VolFS =Unknown
[cd1]VolSN =Unknown
[cd1]VolMountpoint =F:\

 

The "MBR" style and the "FAT32/Win95/OSR2" seem like some kind of "fallback" values, maybe some "added logic" is needed to make "unknown" these values when other "higher priority" characteristics are unknown or 0

 

But very, very good work anyway :).

 

For use in batches, it would be nice if you could use not in the output the parenthesis or brackets, as they usually result in a nightmare when they are inside a FOR loop or in some other structures, as an example:

Fixed(Harddisk) could be Fixed [Harddisk] <- one space after "Fixed" and square brackets

Removable(other than Floppy) would be Removable [other than Floppy]

And/or maybe you could add a field *like* DrvMediaTypeNUM with values like 1,2,3,4,5 etc. or (maybe as an option using a switch "/numonly" ) use the "standard" numeric values, only seemingly OT, and JFYI:

http://reboot.pro/to...loppy-geometry/

https://msdn.microso...p/aa365231.aspx

 

Same goes for the DrvMediaSides, instead of "One-sided" the value could simply be "1".

 

:duff:

Wonko



#55 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 18 October 2015 - 06:46 PM

Thanks much Wonko for your time and willingness to test:

 

 

The "MBR" style and the "FAT32/Win95/OSR2" seem like some kind of "fallback" values, maybe some "added logic" is needed to make "unknown" these values when other "higher priority" characteristics are unknown or 0

 

Indeed, this behavour did not exist in (one) of my previous versions. Will correct this.

 

In the meantime I addressed the other issues you raised:

--> replaced all pipes with space+slash

--> replaced all brackets with space+squared brackets

 

MediaSides contains three values possible:  (Unknown, One-Sided and Two-/Double-Sided).

--> One-Sided replaced by 1

--> Two-/Double-Sided replaced by 2

 

I like the string conversion of hex- or long values.

Till nothing will go wrong (depends on yours input), I won't change it.



#56 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 20 October 2015 - 08:56 AM

Wonko,

 

A little bit mysterious.

Called with "\\.\CDRomN"  DiskGetDriveLayoutEx indeed throws out the PartType MBR and MBRPartType 11 even for empty CDRom slots. I tested this several times the last two days.

Someone outside here who can confirm this?

 

I discovered that I used DiskFreeSpace/DiskFreeSpaceEx in my previous versions to prevent these values cause it throws out an API Error 21 (Device Not Ready). But obviously I did this without proving if DiskGetDriveLayoutEx will return valid/non-empty values anyway.

 

What do you suggest?

My current experience show at least, that these seem to be valid values for DiskGetDriveLayoutEx.

In light of "logic" there couldn't be such info for an empty device/drive (no partition present).

Any ideas?



#57 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 October 2015 - 03:33 PM

What I would use is some "added logic" (evidently the good MS guys didn't think of this or failed to completely test the API calls).

 

Something along the lines of:

Is it a CD-ROM?

If No, goto :NEXT.

Is it empty?

If No, goto :NEXT.

If Yes SET PartLayoutStyle=N/A & SET MBRPartType=N/A

:NEXT

 

:duff:

Wonko



#58 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 21 October 2015 - 10:19 AM

Wonko,

 

evidently the good MS guys didn't think of this or failed to completely test the API calls

 

Not evidently. There are many variables (possible values and maybe exceptions) I cannot test (e.g. tape drives, striped volumes). I am not even sure if the current code covers the "well known" variables.
Expecially by taken into account that I used some of these API's in a deviated way as they were originally declared on their websites.

To doubt in MS is the last thing I do at the moment.
My code is a very sensitive interaction of several API's - impossible for me to realise its full capabilities at the moment. However, it is some fun in my rare sparetime.

New version:
I added some higher logic to prevent showing partition values for empty CDRom's or removable devices.
--> Two new entries named "DrvStatus/PartStatus" are added. Possible Values are "Ready/Not Ready".
--> Long or Hex values are displayed as leading values now, followed by string conversions in squared brackets (if available).
--> replaced "<|>" operators with "less than|greater than"


I really hope that you and others find some more time to test this "thingy".



#59 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 25 October 2015 - 10:23 AM

Update:

The lastest version is now fully functionable (Mounting and Unmounting was disabled before).

 

I updated the first post and added some more explainations.

Any further version may be downloaded from there (as zip archive).

Other download links has been removed.



#60 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 25 October 2015 - 10:46 AM

hi Zharif,

 

I get the below error (in french) : 

Cette version de c:\temp\zDInfo1.3.exe n'est pas compatible avec la version de W
indows actuellement exécutée. Vérifiez dans les informations système de votre or
dinateur, puis contactez l'éditeur de logiciel.
 
 google translate to
This version of c: \ temp \ zDInfo1.3.exe is not compatible with the version of W
indows currently running . Check in the information system of your gold
puter , and then contact the software publisher .
 
I use windows 8.1 x64.
 
Regards,
Erwan


#61 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 25 October 2015 - 10:52 AM

Erwan,

very nice to see you back.

zDinfo_1.3.0.zip is a real zip archive now.The exe file is not named zDInfo1.3.exe.

Download the zip archive. Extract zDInfo.exe and open a command prompt at the same location you downloaded it.

Although written about this issure in my last last post, sorry for confusion.



#62 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 25 October 2015 - 10:54 AM

Erwan,

very nice to see you back.

zDinfo_1.3.0.zip is a real zip archive now.The exe file is not named zDInfo1.3.exe.

Download the zip archive. Extract zDInfo.exe and open a command prompt at the same location you downloaded it.

Although written in the last post, sorry for confusion.

 

 

feel like stupid now :)

works... testing !



#63 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 25 October 2015 - 11:01 AM

On the free/used clusters, i have slghtly different values.

 

oykhkbw.png?1

 

edit : ignore that.

as i have a busy system, the time to launch one program, then the other, and my system was already a few clusters less/more...



#64 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 25 October 2015 - 11:09 AM

Divide the MB by 1024. You will get the correct GB :cheers:

 

Peter

 

EDIT: Sorry, I was stupid and have overseen the real difference :ermm:



#65 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 25 October 2015 - 11:12 AM

Yes Erwan, these values (cluster sizes) are sensitive to any file operation on your system and may change several times.

Same goes for CD/DVD Roms just inserted and executing zDInfo before media is fully detected. This results in wrong sizes.

To all: remember zDInfo behaves as a snapshot viewer here.



#66 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 25 October 2015 - 11:13 AM

I really appreciate your feedback.

Again, without your tool I would have never been able to write my DiskGetDriveLayout code which is core of my proggy - thanks.

 

About your request,

I never did but I could try.

Do you have an example for a possible output design?

BTW: to export std out to a txt file (piping is supported) you may use this syntax:

zdinfo >test.txt

 

EDIT : nice bug from the forum :)

this post was actually written by Zharif, not me !



#67 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 25 October 2015 - 11:22 AM

You are using setvolumepoint API to mount a drive into a directory. (/vm).

Have you compared this API to DefineDosDevice API to achieve (more or less) the same?

 

Note that one has the ability to mount a windows VSS snapshot as a drive which can be handy when you want to clone a disk.

 

And I shall add, if you are to play with these 2 api's, you could also look at CreateSymbolicLink.



#68 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 25 October 2015 - 11:30 AM

I really appreciate your input Erwan.

Again, without your tool I would never be able to write my DiskGetDriveLayoutEx code which is core of my proggy - thanks much for CloneDisk.

 

About your requests:

I never thought about it but I could.

BTW: to import std out (also piping is supported) to a text file you could use:

zdinfo > test.txt

 

Regarding the DefineDosDevice API: Mounting a VSS seems to be interesting. I will have a look.

 

Edit: No Bug, somehow I've overwritten Erwans post :frusty:



#69 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 25 October 2015 - 11:39 AM

Erwan,

what do you suggest? HTML, CSV or both?

This will increase file size significantly.

Do you think it's really neccessary?



#70 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 25 October 2015 - 11:47 AM

Erwan,

what do you suggest? HTML, CSV or both?

This will increase file size significantly.

Do you think it's really neccessary?

 

HTML reporting is a nice to have but definitely not mandatory.

Forget that if too mich code/work.



#71 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 25 October 2015 - 11:51 AM

I really appreciate your input Erwan.

Again, without your tool I would never be able to write my DiskGetDriveLayoutEx code which is core of my proggy - thanks much for CloneDisk.

 

About your requests:

I never thought about it but I could.

BTW: to import std out (also piping is supported) to a text file you could use:

zdinfo > test.txt

 

Regarding the DefineDosDevice API: Mounting a VSS seems to be interesting. I will have a look.

 

Edit: No Bug, somehow I've overwritten Erwans post :frusty:

 

Piping is good and I am sure with some help from Wonko, we would come with other outputs (html, etc).

 

About definedosdevice, i kind of remember you can also use network shares (without having to use net use trick then ?).



#72 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 25 October 2015 - 11:57 AM

...seems much more interesting now.

Will definitively have a look.

 

Piping is one possibility.

With help of sed output into a html should be possible.

Will provide some more details later.



#73 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 25 October 2015 - 01:11 PM

EDIT:

Okay, create a html file:

sed.exe  (I love v.407 from UnxUtils) is needed.

Get latest package here (UnxUpdates):  http://www.weihenste.../~syring/win32/

 

Possible code inside commandline or batch:

zdinfo|sed "s/$/<br>/;1s/.*/<blockquote>/;$s/.*/\n<\/blockquote>/" > Test.html

 

For help to achive this without a third party tool Wonko should be needed.



#74 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 25 October 2015 - 01:34 PM

Next attempt:
Create a html file without third party tools:
 
Code (for use inside a batch):
TYPE NUL > Test.html
ECHO ^<blockquote^> >> Test.html
FOR /F "tokens=1,2* delims==" %%a in ('zdinfo') do (ECHO %%a%%b ^<br^> >> Test.html)
ECHO ^</blockquote^> >> Test.html
 
Possible drawback: empty lines will be deleted.

Edit: blockquoting might not be neccessary here.



#75 Zharif

Zharif

    Frequent Member

  • .script developer
  • 172 posts
  • Location:Germany
  •  
    Germany

Posted 28 October 2015 - 09:43 AM

Erwan,

I played around with DefineDosDevice and CreateSymbolicLink.

 

First let me state that mounting and unmounting capabilities of my tool are somehow meant as an addition - nothing more. Till now the only advantage to mountvol is that my app also creates non-existing path structures while mounting a volume or a NTFS folder. Otherwise (without re-inventing a wheel) any user could use already build-in command line utilities. However, mounting a vhd or a network share would be a great addition.

 

Some background info if I may:

My test system is win8.1x64, UAC off, logged in with an admin account.

Network shares added via elevated cmd prompt (e.g. net use) are not visible in a normal explorer window or cmd prompt (not elevated). You're in need to define (or delete) them in elevated and/or non elevated mode.

 

I once added the following dword key in HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System (for Win8/Win8.1):

EnableLinkedConnections. Value=1

In this way explorer shows connections created via elevated AND non elevated privileges.

But anyway, I use a commander that can be either started in elevated or non elevated mode to compare if a new drive has been added/removed.

 

Results:

For me, mapping a network path or a vhd is of main interest (SetVolumeMountPoint can't), although it lasts for the current session only. For testing purposes I quickly created a vhd of my system via volume shadow copy (using Disk2VHD by SysInternals).

 

Local folders:

Works as expected.

Edit:

In dependence of the used flag, deleting the drive link inside this session is only possible with DefineDosDevice or subst.exe.

 

VHD:

Whatever I try, usage after mounting this vhd (e.g. as Z:) via DefineDosDevice fails (used Flag = 0).

Although this API succeeds, the harddisk icon shown in explorer or my commander contains a blue question mark. Trying to open this drive results in following error (translated):

"Z: cannot be accessed. Wrong syntax for filename, directory name or volume name."

Device path is like this "\\??\FilePath" (invalid for further use).

Deleting the drive link inside this session is only possible with DefineDosDevice or subst.exe.

 

Network share:

API succeeds but icon shown in explorer or commander is marked with a red cross (Not connected network share). However, it can be opened - content of this link is accessable.

DevicePath is like this "\\??\Server\Share" (invalid for further use).

Edit:

In dependence of the used flag, disconnecting is only possible with DefineDosDevice or subst.exe.

Means, DefineDosDevice seems to be able to temporary mount a network share (which is good).

 

CreateSymbolicLink works very well for local files and volumes as well as for network shares.

Created SymLinks do not work with virtual drives (it succeeds but content is also not accessable).

SymLinks can be removed by deleting the file.

 

Erwan, did I miss something here?

The advantage of mapping a network share (e.g. using DefineDosDevices) is negated through the fact that it can be removed by recalling DefineDosDevice or subst.exe (or restarting the system) only. I think this could confuse a normal user who might not be familar with command line usage.

 

Anyway, suggestions?

 

BTW, I suppose you're using the MS-virtual disk functions to handle virtual devices in clonedisk.exe?

https://msdn.microso...9(v=vs.85).aspx

Most of them at least need Vista or 7 which is a no-go for my command line tool.

May I ask what API is used by pressing the "Information" button? I've seen virtual disk info also works under XP.

 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users