RE: How to dynamically install/uninstall filter drive- r

Hi, Eliyas,

Thanks first for your reply.

Currently, I am writing a application to dynamically install/uninstall my
lower filter driver to USB device. The methods I am using to install and
load filter driver is as follows:
(1) Add the LowerFilters registry value to the devnode registry;
(2) Stop and restart device with the following statements:

memset(&params, 0, sizeof(SP_PROPCHANGE_PARAMS));
params.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
params.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE;
params.StateChange = DICS_PROPCHANGE;
params.HwProfile = 0; // current profile

// prepare for the call to SetupDiCallClassInstaller
if (!SetupDiSetClassInstallParams( DeviceInfoSet,
dwError = GetLastError();
return (FALSE); // Couldn’t set the install parameters!

// stop and restart the device
if (!SetupDiCallClassInstaller( DIF_PROPERTYCHANGE,

dwError = GetLastError();
return (FALSE); // Call to class installer (DICS_PROPCHANGE) failed!

My current problem is that the above method works fine in Win2k, but in
Win98/Me, after successfully return from calling to
SetupDiCallClassInstaller(), it will need to wait a long time (over 20
seconds) before the device takes effective. BTW, if at this point I call a
MessageBox to pop up a message box, then the device will take effective
immediately. I cannot imagine what is the reason. Could you help me explain
what is the reason and what is wrong in my method.

I have also tried to call SetupDiCallClassInstaller two times first with
parameter DICS_STOP and second with DICS_RESTART. It works fine in Win2k,
but failed in Win98/Me.

I have tested the USBVerify, it can work in both Win2k and Win98/Me and the
time to install filter driver in Win98/Me is much shorter than that what I
see in my application.

Could you give me in detail how USBVerify works to install filter driver? I
don’t know if it is possible to provide me some source codes to illustrate
the detailed procedures.

I will appreciate your help!

Best Regards,

-----Original Message-----
From: Eliyas Yakub []
Sent: Saturday, June 30, 2001 1:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: How to dynamically install/uninstall filter driver

There is no magic. It stops the device, adds the UpperFilters registry
value to the devnode registry (using SetupDiSetDeviceRegistryProperty)
and restarts the device.


-----Original Message-----
From: []
Sent: Thursday, June 28, 2001 10:24 PM
To: NT Developers Interest List
Subject: [ntdev] How to dynamically install/uninstall filter driver

Hello All:

There is a utility in NTDDK: USBVerify, but it doesn’t provide source

Does anybody know how USBVerify implements to dynamically
its filter driver for each device. Or, does anyone know where to get the

source code of USBVerify from other resources except NTDDK.

Thanks in advance for your help!


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)