Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with ActivateDevice (ERROR_OPEN_FAILED)

71 views
Skip to first unread message

Gunnar Frenzel

unread,
Jan 16, 2008, 8:14:08 AM1/16/08
to
Hello,
I have a driver that is automatically loaded using the HKLM\Drivers
\BuiltIn\PCI\Template\DriverName. This works fine and the driver is
present in the HKLM\Drivers\Active list.
Now I'd like to have a command line exe that can deactivate and
activate the driver. Deactivate the driver using DeactivateDevice with
the HANDLE retrieved from the drivers HKLM\Drivers\Active key works
well the driver is unloaded from device.exe and the Active key is
removed. Now I tried to call
ActivateDevice(TEXT("Drivers\\BuiltIn\\PCI\\Template\\DriverName"),
0);
as well as
ActivateDeviceEx(TEXT("Drivers\\BuiltIn\\PCI\\Template\\DriverName"),
NULL, 0, NULL);
to reload the driver, but this always fails. Both functions return 0
and GetLastError is 110 (ERROR_OPEN_FAILED).
The usecase is to deactivate the driver so the dlls can be replace
with a new version of the driver and reactivate the driver without
restarting WinCE.
Regards,
Gunnar

Gunnar Frenzel

unread,
Jan 16, 2008, 11:45:49 AM1/16/08
to
Hello,
a Debug build of the driver gave a hint to the problem. In the
driver's initialization the DDKReg_GetPciInfo WINAPI call fails
returning error code 0x02. The previous calls of DDKReg_GetWindowInfo
and DDKReg_GetIsrInfo succeed and the same initialization code is
working properly when the driver is loaded at boot time.
I would appreciate any hints why DDKReg_GetPciInfo might fail here
only when calling ActivateDevice after shutting down the driver with
DeactivateDevice but not at boot time.
Regards,
Gunanr
0 new messages