Thanks Jan for your quick answer,
I understand now why appeared that "USBDevice" in Microsoft information. Unfortunately my skills programming are not good enough and following your instructions (even with this new system working) is really helpful. I think the old way you proposed in your book is still working and I'm going to use it. Furthermore, I would like to be able to install my device in all versions of Windows XP and knowing that maybe computers don't have internet connection or have windows update blocked (I think new system is only working with SP3 installed and you need to have internet connection and windows update activated).
So my questions are still in the air (a bit modified now with Jan's answer because question about the existence of Class=USBDevice has no sense) and I will be grateful to receive any help knowing that I want to follow "the old way". My questions again:
***************
I'm following Jan Axelson book trying to understand USB interface to develop my own program. Here are some doubts. First of all, in the example of INF files we can find these lines (p.233):
Class = USB
ClassGUID={36FC9E60-C465-11CF-8056-444553540000}
First question is: can I write what I want into parameter Class and then generate a valid ClassGUID and that's all? Or I should use exactly the same data proposed by Jan in his book?
Second question is about function SetupDiGetClassDevs which we have to use at the begining of the process of getting a device path. One of its parameter is ClassGuid (p.254):
ByRef ClassGuid As System.Guid
Maybe question will seem you stupid but following the instructions in the book is not clear for me which GUID we have to pass to this function through this parameter: Class Guid or Device Interface Guid? In the book, when we use this function we are passing myGuid:
deviceInfoSet = SetupDiGetClassDevs _
(myGuid, _
IntPtr.Zero, _
IntPtr.Zero, _
DIGCF_PRESENT Or DIGCF_DEVICEINTERFACE)
And previously, Jan defined this variable as Device Interface GUID:
Public Const WINUSB_DEMO_GUID_STRING As String = _
"{42CA71EC-CE1C-44c2-82DE-87D8D8FF6C1E}"
Dim myGuid As New System.Guid(WINUSB_DEMO_GUID_STRING)
This GUID inside the INF file is the Device Interface GUID:
HKR,,DeviceInterfaceGUIDs,0x10000,"{42CA71EC-CE1C-44c2-82DE-87D8D8FF6C1E}"
So, my second question: which GUID has to be passed to the function? The one which appear as ClassGUID into the INF file or the one called Device Interface GUID? Which of these?:
{42CA71EC-CE1C-44c2-82DE-87D8D8FF6C1E}
{36FC9E60-C465-11CF-8056-444553540000}
***************
Thanks again.
Xavi