Hi, I'm looking for a function/class in wxWidgets which can give me a volume serial number (like win32 GetVolumeInformation function does).
I assume that the volume serial number must be pretty much cross-platform.
Thanks in advance.
Hi, I'm looking for a function/class in wxWidgets which can give me a volume serial number (like win32 GetVolumeInformation function does).
I assume that the volume serial number must be pretty much cross-platform.
Thanks in advance.
There is no such wxWidgets API, AFAIK.
You might look at this thread in the QT forum:
http://lists.trolltech.com/qt-interest/2004-04/thread00756-0.html
The lpVolumeSerialNumber member of GetVolumeInformation() is a OS-assigned serial number (when a drive is formatted). It's not specific to Windows per se, but file systems Microsoft uses (e.g. FATs, NTFS, etc.).
What are you trying to achieve? If you need a consistent number across platforms (assuming the same physical hard drive(s)) look into retrieving the physical HDD serial number. You can do this in Windows via WMI and/or DeviceIoControl(). I'm sure similar IOCTL's exist in Linux or you can utilize 'iostat -En' or perhaps 'cfgadm -alv' (See http://prefetch.net/blog/index.php/2010/07/13/locating-physical-disk-drives-in-solaris/ -- I believe most Un*x and Linux systems have about the same utilities for this)