Driver property pages

I’ve created a new hardware class for a group of drivers I’m developing. Each of the drivers share this same hardware class in their inf [Version] sections. My problem is that the property page I created for one of the drivers appears in the property tab for all the drivers. Is there a way they can share teh same hardware class, but have different property pages, or better yet have the property page show up for ONLY one of the drivers?

Are you using EnumPropPages32 to add the page? If so, you should stop :). You can control this in your class installer, or rather device installer if you like. Either way you respond to DIF_ADDPROPERTYPAGE_ADVANCED (http://msdn.microsoft.com/en-us/library/ms793120.aspx). In a class installer, you would have evaluate whatever properties/metadata is associated with the device before returning the proppage. In a device coinstaller, you just return the page b/c you would only be installed for a particular device instance, not the entire class.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Friday, September 12, 2008 3:23 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Driver property pages

I’ve created a new hardware class for a group of drivers I’m developing. Each of the drivers share this same hardware class in their inf [Version] sections. My problem is that the property page I created for one of the drivers appears in the property tab for all the drivers. Is there a way they can share teh same hardware class, but have different property pages, or better yet have the property page show up for ONLY one of the drivers?


NTDEV is sponsored by OSR

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

As a matter of fact I am using EnumPropPages32; haha.

I’m specifying this in my ClassInstall32 section. If I don’t use EnumPropPages32 how do I specify the entry point to my coinstaller?

Secondly, where do in my coinstaller how can I determine which device triggered entry into the coinstaller? If I could determine this, could determine whether or not to return the proppage.

The toaster sample demonstrates a coinstaller. The online docs also tell you how to write one.

Remember for any class , the ClassInstall32 is only evaluated the first time a device is installed with that class, so if you want to install a class coinstaller you will need to blow away the class first in the registry

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Friday, September 12, 2008 4:18 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Driver property pages

As a matter of fact I am using EnumPropPages32; haha.

I’m specifying this in my ClassInstall32 section. If I don’t use EnumPropPages32 how do I specify the entry point to my coinstaller?

Secondly, where do in my coinstaller how can I determine which device triggered entry into the coinstaller? If I could determine this, could determine whether or not to return the proppage.


NTDEV is sponsored by OSR

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

So, I’ve gone down the route of changing my previous class co-installer to a device coinstaller. Previously I was following the example for a class coinstaller here:
http://www.osronline.com/custom.cfm?name=articlePrint.cfm&id=27

I’ve now changed my entry point to be a callback with the following signature:
DWORD CALLBACK
MyPropPageProvider(
__in DI_FUNCTION InstallFunction,
__in HDEVINFO DeviceInfoSet,
__in PSP_DEVINFO_DATA DeviceInfoData OPTIONAL,
__inout PCOINSTALLER_CONTEXT_DATA Context
)

I’ve followed the toaster example and my question is now this:
I’ve created the property sheet, but how do I ‘add’ it? Previously in my class coinstaller my entry point was:
BOOL APIENTRY MyPropPageProvider(PSP_PROPSHEETPAGE_REQUEST pPropPageRequest,
LPFNADDPROPSHEETPAGE fAddFunc,
LPARAM lParam)
and I could ‘add’ my newly created property page by doing something like the following:
if( !(*fAddFunc)(hPropSheetPage, lParam)) {
DestroyPropertySheetPage (hPropSheetPage);
OutputDebugString(“Failed to add the property page\n”);
return FALSE;
}

I’ve followed the instructions below for handling DIF_ADDPROPERTYPAGE_ADVANCED requests:
http://msdn.microsoft.com/en-us/library/ms791121(printer).aspx

I was assuming that the call to SetupDiSetClassInstallParams() would update the property page, but it looks like I’m missing a critical step.

I’m lost folks! Any help would be greatly appreciated.

Can you post your code? Did you follow the code recommendations on that page?

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Monday, September 15, 2008 5:05 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Driver property pages

So, I’ve gone down the route of changing my previous class co-installer to a device coinstaller. Previously I was following the example for a class coinstaller here:
http://www.osronline.com/custom.cfm?name=articlePrint.cfm&id=27

I’ve now changed my entry point to be a callback with the following signature:
DWORD CALLBACK
MyPropPageProvider(
__in DI_FUNCTION InstallFunction,
__in HDEVINFO DeviceInfoSet,
__in PSP_DEVINFO_DATA DeviceInfoData OPTIONAL,
__inout PCOINSTALLER_CONTEXT_DATA Context
)

I’ve followed the toaster example and my question is now this:
I’ve created the property sheet, but how do I ‘add’ it? Previously in my class coinstaller my entry point was:
BOOL APIENTRY MyPropPageProvider(PSP_PROPSHEETPAGE_REQUEST pPropPageRequest,
LPFNADDPROPSHEETPAGE fAddFunc,
LPARAM lParam)
and I could ‘add’ my newly created property page by doing something like the following:
if( !(*fAddFunc)(hPropSheetPage, lParam)) {
DestroyPropertySheetPage (hPropSheetPage);
OutputDebugString(“Failed to add the property page\n”);
return FALSE;
}

I’ve followed the instructions below for handling DIF_ADDPROPERTYPAGE_ADVANCED requests:
http://msdn.microsoft.com/en-us/library/ms791121(printer).aspx

I was assuming that the call to SetupDiSetClassInstallParams() would update the property page, but it looks like I’m missing a critical step.

I’m lost folks! Any help would be greatly appreciated.


NTDEV is sponsored by OSR

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

Here’s what I’m doing… Thanks again!

DWORD CALLBACK
XXXPropPageProvider(
__in DI_FUNCTION InstallFunction,
__in HDEVINFO DeviceInfoSet,
__in PSP_DEVINFO_DATA DeviceInfoData OPTIONAL,
__inout PCOINSTALLER_CONTEXT_DATA Context
)
{
SP_ADDPROPERTYPAGE_DATA AddPropertyPageData;
PXXX_PROP_INTF pXxxSettings;
PROPSHEETPAGE PropSheetPage;
HPROPSHEETPAGE hPropSheetPage;

XxxOutputDebugString(“XXXPropPageProvider Enter\n”);

switch ( InstallFunction )
{
case DIF_ADDPROPERTYPAGE_ADVANCED:
XxxOutputDebugString(“I’ve been waiting for you!!!\n”);

// Allocate the memory for the Xxx settings.
pXxxSettings = (PXXX_PROP_INTF) LocalAlloc (LPTR, sizeof (XXX_PROP_INTF));
if (!pXxxSettings) {
DbgError (“XXXPropPageProvider: LocalAlloc: No Features”);
break;
}

XxxOutputDebugString(“Zeroing memory\n”);
memset(pXxxSettings,0,sizeof(XXX_PROP_INTF));

AddPropertyPageData.ClassInstallHeader.cbSize =
sizeof(SP_CLASSINSTALL_HEADER);

if (SetupDiGetClassInstallParams(
DeviceInfoSet,
DeviceInfoData,
(PSP_CLASSINSTALL_HEADER)&AddPropertyPageData,
sizeof(SP_ADDPROPERTYPAGE_DATA), NULL ))
{

//
// First, make sure there’s room for us to add a page…
//
if(AddPropertyPageData.NumDynamicPages >= MAX_INSTALLWIZARD_DYNAPAGES) {
XxxOutputDebugString(“Too many pages\n”);
break;
}

XxxOutputDebugString(“Getting the Xxx settings through the private property call\n”);
// Get the Xxx settings through the private property call.
if (!GetXxxSettings (pXxxSettings)) {
XxxOutputDebugString(“Failed to get Xxx settings\n”);
break;
}

XxxOutputDebugString(“Initializing the property page\n”);
// initialize the property page
PropSheetPage.dwSize = sizeof(PROPSHEETPAGE);
PropSheetPage.dwFlags = PSP_USECALLBACK | PSP_HASHELP;
PropSheetPage.hInstance = ghInstance;
PropSheetPage.pszTemplate = MAKEINTRESOURCE(DLG_IRIGFEATURES);
PropSheetPage.pfnDlgProc = XxxDlgProc;
PropSheetPage.lParam = (LPARAM) pXxxSettings;
PropSheetPage.pfnCallback = XxxSettingsDlgCallback;

XxxOutputDebugString(“Creating the page\n”);
// create the page and get back a handle
hPropSheetPage = CreatePropertySheetPage( &PropSheetPage );
if( !hPropSheetPage ) {
XxxOutputDebugString(“Property page creation failed\n”);
break;;
}

if(AddPropertyPageData.DynamicPages[AddPropertyPageData.NumDynamicPages] != NULL) {
AddPropertyPageData.NumDynamicPages++;
}

SetupDiSetClassInstallParams(DeviceInfoSet,
DeviceInfoData,
(PSP_CLASSINSTALL_HEADER)&AddPropertyPageData,
sizeof(SP_ADDPROPERTYPAGE_DATA)
);
}
XxxOutputDebugString(“XXXPropPageProvider Exit\n”);
break;

Hey Doron,

I found my brain-lapse. As usual, I was overlooking something and it just took more time to notice it.

Prior to incrementing the DynamicPages, you’d think I’d stuff the handle to the newly created property sheet in wouldn’t you? Yeah, well, I missed that previously. All is well now.

Thanks again for your help. I’m learning more and more about this stuff all the time, and thanks to folks like yourself these brickwalls I occasionally run into don’t feel so impassable. Tip of the cap to you sir!