WNetAddConnection2A works very well (in most circumstances). But an additional dll is needed (mpr.dll).
Till now I tried to avoid additional dependencies as much as possible.
But maybe I should reconsider my methods if I really try to increase usability of zDInfo.
As suggested elsewhere by Wonko, outsourcing the mount/unmount/label functions as a separate tool should be kept in mind.
Anyway, I'm still much interested on feedback about the output values for the current version of zDInfo.
Erwan, I compared the drive SerialNr of CloneDisk with zDInfo.
The code I use additionally gets the DeviceInstanceID/DeviceInstancePath of USB Devices
(as seen in Properties-->Details-->DropDownBox: DeviceInstancePath;
I discovered that CloneDisk (v2.3.3) misses the last character/digit of the SerialNr for any kind of USB/Removable devices.
Any kind of a byte offset and/or length issue? But maybe this values go wrong for zDInfo instead for CloneDisk (or for both?).
Here're some examples:
USB3.0 harddisk connected:
Four slot "combo" SD card reader: One micro SD-Card inserted
Just for notification - you may want to have a look at this.?
I found new issues regarding the flags used by DefineDosDevice. My latest post has been updated.