Question on GUID Use in the older bulkusb sample code

I just recovered from a recent email loss so If this question is a
repeat please forgive me and possibly forward me any relevant responses.

I am currently in the process of evaluating the performance of a bulk
usb based driver for a number of our currently established devices. In
fact their are 3 different devices which each use a different GUID to
enable the software to identify and communicate with its respective
device. We are adding a fourth device which also needs to uniquely
identify itself. I actually have this working but seek to understand the
purpose of the GUIDs in the source code a bit better.

The bulkusb based driver consists of these source files

bulkdev.c - 1480 lines
bulkdev.h - 96 lines

bulkpnp.c - 2809 lines
bulkpnp.h - 175 lines

bulkpwr.c - 1723 lines
bulkpwr.h - 128 lines

bulkrwr.c - 598 lines
bulkrwr.h - 44 lines

bulkusb.bmf - binary file

bulkusb.c - 449 lines
bulkusb.h - 251 lines

bulkusb.mof - 26 lines

bulkusb.rc - 13 lines

bulkusr.h - 49 lines

bulkwmi.c - 66 lines
bulkwmi.h - 85 lines

sources - 23 lines

makefile - 19 lines
makefile.inc - 5 lines

Out of all these files several contain a GUID reference

bulkusb.mof - contains

[Dynamic, Provider(“WMIProv”),
WMI,
Description(“Bulk Usb driver for Intel 82930”),
guid(“{2C831E0D-E8E9-476A-99F5-6954E3475E6B}”),
locale(“MS\0x409”)]

bulkusr.h - contains

DEFINE_GUID(GUID_CLASS_I82930_BULK,
0x2C831E0D, 0xE8E9, 0x476A, 0x99, 0xF5, 0x69, 0x54, 0xE3, 0x47,
0x5E, 0x6B);

bulkwmi.c - contains

DEFINE_GUID (BULKUSB_WMI_STD_DATA_GUID,
0x2C831E0D, 0xE8E9, 0x476A, 0x99, 0xF5, 0x69, 0x54, 0xE3, 0x47,
0x5E, 0x6B);

An the sources file contains name of driver to produce in my case

TARGETNAME=ATVIQUSB

The installation file also contains a GUID reference but it contains a
generic USB device guid OR I beleieve I can also use
{00000000-0000-0000-0000-000000000000} as an unknown device reference

This is the generic USB Device Class ID used in the installation file

ClassGUID={36FC9E60-C465-11CF-8056-444553540000}


I believe I generate a GUID and replace the GUID in these three files

bulkusb.mof

bulkusr.h

bulkwmi.c

some of the above mentioned files

My question is this do I change the GUIDs to my generated GUID for
example this one

2C831E0D-E8E9-476A-99F5-6954E3475E6B

or just in two of the files


My confusion comes from the belief that in the original example only 2
GUIDs where the same and also from this snippet

fom the end of http://www.osronline.com/DDKx/kmarch/other_3lif.htm

When creating a GUID for a new device setup class or device interface
class, the following rules apply:
Do not use a single GUID to identify both a device setup class and a
device interface class.
When creating a symbolic name to associate with the GUID, use the
following convention:
For device setup classes, use the format GUID_DEVCLASS_xxxx.

For device interface classes, use the format GUID_DEVINTERFACE_xxxx.

Built on Friday, April 11, 2003

Thanks for considering this request for some clarification

PS I also understand that the bulkUSB example may not be appropriate for
multicore systems and the usbsamp code should be used as a better basis
for a driver in that case. I did quickly try that but it didnt plan out.
My plan is to shift to that code and / or winusb after the immediate
device is working. I still need the bulkUSB code to support the existing
devices until a stable tested replacement is developed. And in fact it
appears to work on this new system and has been working for a number of
years on our older systems which we still support.

Thanks Again

Frank Bishop

Frank Bishop wrote:

I just recovered from a recent email loss so If this question is a
repeat please forgive me and possibly forward me any relevant responses.

I am currently in the process of evaluating the performance of a bulk
usb based driver for a number of our currently established devices. In
fact their are 3 different devices which each use a different GUID to
enable the software to identify and communicate with its respective
device. We are adding a fourth device which also needs to uniquely
identify itself. I actually have this working but seek to understand the
purpose of the GUIDs in the source code a bit better.

The bulkusb based driver consists of these source files

This is based on an old and known-buggy sample. If you are redoing
things, you should strongly consider moving to KMDF.

Out of all these files several contain a GUID reference

bulkusb.mof - contains

[Dynamic, Provider(“WMIProv”),
WMI,
Description(“Bulk Usb driver for Intel 82930”),
guid(“{2C831E0D-E8E9-476A-99F5-6954E3475E6B}”),
locale(“MS\0x409”)]

bulkusr.h - contains

DEFINE_GUID(GUID_CLASS_I82930_BULK,
0x2C831E0D, 0xE8E9, 0x476A, 0x99, 0xF5, 0x69, 0x54, 0xE3, 0x47,
0x5E, 0x6B);

bulkwmi.c - contains

DEFINE_GUID (BULKUSB_WMI_STD_DATA_GUID,
0x2C831E0D, 0xE8E9, 0x476A, 0x99, 0xF5, 0x69, 0x54, 0xE3, 0x47,
0x5E, 0x6B);

Well, partly this depends on what you need. The first and last cases
there are the WMI identifier. That’s how a WMI client application would
reach your driver to display performance data. If you don’t provide any
performance data, then this GUID doesn’t matter. Or, if you expect all
of your drivers to respond to the same WMI id, you could leave it alone.

The middle one is the important one. That’s probably the “device
interface” GUID, and your applications probably use the SetupDi APIs to
locate the device using this GUID. The fact that it is the same as the
WMI provider ID is just a coincidence. You need to decide whether this
new device needs to have a completely separate interface GUID, or if all
of your devices should be found by searching for that one GUID.

The installation file also contains a GUID reference but it contains a
generic USB device guid OR I beleieve I can also use
{00000000-0000-0000-0000-000000000000} as an unknown device reference

This is the generic USB Device Class ID used in the installation file

ClassGUID={36FC9E60-C465-11CF-8056-444553540000}

That’s actually NOT the “generic USB device class ID,” although many
people have mistakenly used it for that. That’s the “generic USB host
controller class ID”. It’s supposed to be used by host controllers and
hubs. There is no generic USB device class. If you don’t fit an
existing class, you should create one of your own.

My question is this do I change the GUIDs to my generated GUID for
example this one

2C831E0D-E8E9-476A-99F5-6954E3475E6B

or just in two of the files

It depends on how your driver is being used. If you need to identify
this driver SPECIFICALLY, then you need a new device interface GUID. If
your application can work with any similar driver, then they can all use
the same device interface.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thank You Very Much Tim,

That helps give me some direction .

I believe I can concentrate on changing the middle GUID

DEFINE_GUID(GUID_CLASS_I82930_BULK,

0x2C831E0D, 0xE8E9, 0x476A, 0x99, 0xF5, 0x69, 0x54, 0xE3, 0x47,
0x5E, 0x6B);

and the one in the inf file to my GUID for the device and then move on to looking closer at the usbsamp example and the performance of the driver under load conditions with multicore processors

Frank

I think just change the device GUID

zhonghong200

>> I think just change the device GUID

Thanks zhonghong200

Frank Bishop