Question about HKR,,0,%ClassName% in VS2012 generated KMDF project

Hello!

I’m using VS2012 to generate a KMDF project and I’m trying to understand
(though I probably never will…) the INF file.

In the [Strings] section I found that “ClassName” is defined:

[Strings]
ManufacturerName=“” ; TODO: add ManufacturerName
ClassName=“Samples” ; TODO: edit ClassName
DiskName = “TestKMDF Installation Disk”

which is referenced here:

[ClassInstall32]
Addreg=SampleClassReg

[SampleClassReg]
HKR,0,%ClassName%
HKR,Icon,-5

However I cannot figure out what it means? Where does the Class name go?
Are there any restrictions about the class name? What’s the overall purpose of this
line?

Maybe someone can shed some light on this… or give me some pointer where to
find the information?!

Thanks!

The class name goes into the registry under the class key. It is used in the device manager ui. There are no restrictions really

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@frank-wolf.org
Sent: Thursday, January 24, 2013 4:03 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question about HKR,0,%ClassName% in VS2012 generated KMDF project

Hello!

I’m using VS2012 to generate a KMDF project and I’m trying to understand (though I probably never will…) the INF file.

In the [Strings] section I found that “ClassName” is defined:

[Strings]
ManufacturerName=“” ; TODO: add ManufacturerName ClassName=“Samples” ; TODO: edit ClassName DiskName = “TestKMDF Installation Disk”

which is referenced here:

[ClassInstall32]
Addreg=SampleClassReg

[SampleClassReg]
HKR,0,%ClassName%
HKR,Icon,-5

However I cannot figure out what it means? Where does the Class name go?
Are there any restrictions about the class name? What’s the overall purpose of this line?

Maybe someone can shed some light on this… or give me some pointer where to find the information?!

Thanks!


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi Doron!
That’s weird: I changed the the ‘Class’ and ‘ClassGUID’ to ‘System’ and the matching GUID I
found in the *guid.h header and my driver indeed showed up in the device manager at the specified
place.
However: Changing the %ClassName% string didn’t change anything and I was not able
To find the string I used (ClassName=“Virtual Bus”) in the registry nor in the GUI of
device manager.

Do you have an idea what I might miss?

the inf can only apply the name if it is a new class. Once the class has been installed, even by the same inf, none of class directives in the INF will execute again

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@frank-wolf.org
Sent: Thursday, January 24, 2013 1:20 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Question about HKR,0,%ClassName% in VS2012 generated KMDF project

Hi Doron!
That’s weird: I changed the the ‘Class’ and ‘ClassGUID’ to ‘System’ and the matching GUID I found in the *guid.h header and my driver indeed showed up in the device manager at the specified place.
However: Changing the %ClassName% string didn’t change anything and I was not able To find the string I used (ClassName=“Virtual Bus”) in the registry nor in the GUI of device manager.

Do you have an idea what I might miss?


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Is there a way to delete the old value? Or in other words: can I somehow reset to
make it run again?

Not a supported scenario. The best way to do this is to create a system restore point before you add the class and then restore to that point to test again. In the unsupported realm, I would imagine deleting the class key and rebooting might get you somewhere…

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@frank-wolf.org
Sent: Thursday, January 24, 2013 1:56 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Question about HKR,0,%ClassName% in VS2012 generated KMDF project

Is there a way to delete the old value? Or in other words: can I somehow reset to make it run again?


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

> To find the string I used (ClassName=“Virtual Bus”)

You either use system-predefined classes, or create your own class. For latter, your INF must have some more sections like (IIRC) ClassInstall32 and so on. Also, you will need a class installer DLL for it, with the icon (to be displayed in Device Manager) in it.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

@Maxim:

Thanks for your answer. I’m using a predefined CLASS and ClassGUID if that’s what you mean:

Class=System
ClassGuid={4D36E97D-E325-11CE-BFC1-08002BE10318}

However I still don’t get why I need that ‘ClassName’ and I didn’t find a helpful
documentation for it:

[ClassInstall32]
Addreg=SampleClassReg

[SampleClassReg]
HKR,0,%ClassName%
HKR,Icon,-5

[Strings]
ClassName=“My senseless ClassName string”

@Maxim:

Why does my driver (using the above INF) show up under “System devices” in Device manager
and not under the Name I chose for the ClassName (“My senseless ClassName string”)?

Now I got it… starting all over and using own values (New class, GUID and name)
did the trick! In other words I found out the different meanings.

@ALL: Thanks for your help!

xxxxx@frank-wolf.org wrote:

Why does my driver (using the above INF) show up under “System devices” in Device manager
and not under the Name I chose for the ClassName (“My senseless ClassName string”)?

I see you found your answer, but I’ll offer an explanation anyway.

The [ClassInstall32] section (and friends) create a new install class,
with a name and an icon. However, that doesn’t determine where your
current device is actually installed. That comes from the Class and
ClassGUID lines in the [Version] section.


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