Hi, Eliyas,
Could you provide me some source codes to illustrate how you implement to
stop/restart device in Win2k, particularly which APIs and the parameters
have you used to do that?
Because this issue has given me a lot of trouble and also taken me a very
long time, I really need your help!
Thank you very much!
Regards,
Shunnian
-----Original Message-----
From: Eliyas Yakub [mailto:xxxxx@microsoft.com]
Sent: Tuesday, July 03, 2001 2:32 AM
To: Zhai, Shunnian
Subject: RE: [ntdev] RE: How to dynamically install/uninstall filter driver
I don’t know anything about 9x systems. Please call MS tech support and talk
to DDK support engineers.
-----Original Message-----
From: Zhai, Shunnian [mailto:xxxxx@adaptec.com]
Sent: Sunday, July 01, 2001 8:56 PM
To: ‘NT Developers Interest List’
Cc: Eliyas Yakub
Subject: RE: [ntdev] RE: How to dynamically install/uninstall filter driver
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:
SP_PROPCHANGE_PARAMS params;
SP_DEVINSTALL_PARAMS installParams;
memset(¶ms, 0, sizeof(SP_PROPCHANGE_PARAMS));
params.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
params.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE;
params.StateChange = DICS_PROPCHANGE;
params.Scope = DICS_FLAG_CONFIGSPECIFIC;
params.HwProfile = 0; // current profile
// prepare for the call to SetupDiCallClassInstaller
if (!SetupDiSetClassInstallParams( DeviceInfoSet,
DeviceInfoData,
(PSP_CLASSINSTALL_HEADER) ¶ms,
sizeof(SP_PROPCHANGE_PARAMS)
))
{
dwError = GetLastError();
return (FALSE); // Couldn’t set the install parameters!
}
// stop and restart the device
if (!SetupDiCallClassInstaller( DIF_PROPERTYCHANGE,
DeviceInfoSet,
DeviceInfoData
))
{
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,
Shunnian
-----Original Message-----
From: Eliyas Yakub [ mailto:xxxxx@microsoft.com
mailto:xxxxx ]
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.
-Eliyas
-----Original Message-----
From: xxxxx@adaptec.com [mailto:xxxxx@adaptec.com
mailto:xxxxx]
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
code.
Does anybody know how USBVerify implements to dynamically
install/uninstall
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!
Regards,
Shunnian
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</mailto:xxxxx></mailto:xxxxx>