Tech Support > Microsoft Windows > Drivers > GetVolumeNameForVolumeMountPoint
GetVolumeNameForVolumeMountPoint
Posted by jholden on September 9th, 2005


I am getting a compile error c2065. I have included the define for
_WIN32_WINNT 0x0501

I have even tried including winbase.h but still get the error. What else
could be the problem?

Posted by Robert Marquardt on September 9th, 2005


jholden wrote:

In a kernel driver?
Why do you think the Win32 API is available in a kernel driver?

Posted by jholden on September 9th, 2005


Basically I am trying to get the serial number from a usb flash drive but
have been able to do so using the api. The serial number value is null
indicating that there is none. I downloaded some sample code that supposedly
works in WinXP systems or higher but have been unable to get it to compile.

I really have no idea if this can actually be done but I have a deadline and
am trying everything I can.

Any help you can give would be greatly appreciated.

"Robert Marquardt" wrote:

Posted by Mark Roddy on September 10th, 2005


jholden wrote:
clarify what you are doing if you expect to get reasonable help.

--

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

Posted by jholden on September 12th, 2005


User mode. I have no experience writing anything in kernel mode, but will I
need to write something in kernel mode to do what I need?

I am just trying to write a dll that will get the hardware serial number
from a usb flash drive. Is this even possible and if so what is the best way
to do it.

When I use the call to DeviceIoControl (with IOCTL_GET_DEVICE_DESCRIPTOR)
the serial number is always null, indicating there is none, but if I use a
utility like USBView I can see that the USB flash Drive does have a serial
number.

"Mark Roddy" wrote:

Posted by Mark Roddy on September 13th, 2005


jholden wrote:
It depends what you mean by the hardware serial number. If you mean the
USB device serial number - then see the usbview sample in the ddk and be
prepared for the fact that many vendors don't bother.

equivalent to SCSI or IDE/Atapi devices, so the inquiry data isn't going
to help.

The OS does its best to uniquely identify a volume such that when you
unplug it and plug it back in again its volume path name remains the same.

The volume path name is the string you get when you enumerate all the
volumes on the system use the SDK findfirst/findnext volume api. It
looks something like "\\?\Volume{fb429fc2-46ed-11d9-88fc-444553544200}\"


--

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com