The key status returned from GetKeyState function changes as a specified thread reads key messages from its message queue. The status does not reflect the interrupt-level state associated with the hardware. Use the GetAsyncKeyState function to retrieve that information.
I have a problem. I have some USB flash media and i want to use it to store some key data for my software. The data are encrypted. In order to protect the media from direct copying i want to include Vendor ID, Product ID and serial number into the encryption key.
How to obtain VID, PID and serial?
I've tried two approaches:
1. Issue IOCTL_STORAGE_QUERY_PROPERTY on the drive in order to obtain STORAGE_DEVICE_DESCRIPTOR. It looked like these parameters are present in this structure. However looks like this works correctly only for SCSI. For IDE devices VendorID field is empty (NULL), ProductID field contains drive model string obtained via Identify command, SerialNo field is also empty. For USB drive the things are even worse: Vendor = "USB", Product = "Flash disk" and no serial number.
I've tried IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER, but on my flash drives it simply doesn't work. The documentation says it works only WinXP SP1 and only if the media is SCM-1 (Security content management)-compilant. That's all, approach no. 1 stopped here.
2. Traverse through a USB devices tree exactly in the same way as USBView does. Everything is okay, i see IDs and serials, but now i need to find out a drive letter under which the flash device is mounted from the hub name and port number? IOCTL_USB_GET_NODE_CONNECTION_NAME gives empty string on non-hubs. IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME works and gives me some ID, but what to do with it then?
Please help me.
I am using .NET framework 1.1 (Visual studio 2003.NET) and I have written some codes in VC and VC++. I want to add some XML tags to make documentation out of it. But it only supports XML tags for C#. As far as know Visual Studio 2005 (.NET framework 2) supports XML tags for VC, but I can not switch to it. I want to know if there are some tools that help me to make some documents with .chm extension out of the XML tags I have written or not?(in C#.NET I have written these tags and then I made the XML file out of them and by using NDOC, I have created files in .chm extension. Is there any way to make such documentation out of VC and VC++.NET?)
Thanks in advance
Last Visit: 31-Dec-99 18:00 Last Update: 24-Sep-23 13:57