Obtaining GUID for Existing USB Device on Windows XP

I need to find the GUID for an existing USB device attached to my Windows XP system. How can this be done using WMI or the registry? Or, is there another avenue that I should explore? This is for a specific known device; it is not expected to change. If I need to write a little program, use some tool, or look somewhere in the Windows system to find this information, it's all the same to me. Thanks.
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
char buff[512];

GetVolumeNameForVolumeMountPoint("C:\\",buff,512);

cout <<"GUID path: "<<buff<<endl;

}
GUID path: \\?\Volume{d202518e-ba9b-11df-b50b-806d6172696f}\

Note that this works only if the device is mounted.

GetVolumeNameForVolumeMountPoint: http://msdn.microsoft.com/en-us/library/aa364994(VS.85).aspx
DevViewer from Symantec seems to do the trick.

http://service1.symantec.com/SUPPORT/ent-security.nsf/ppfdocs/2007511906325898?Open&dtype=corp&src=&seg=&om=1&om_out=prod

The GUID can also be found in the registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB
Topic archived. No new replies allowed.