Re: What is the driver API call to register a device
From: Dale Ziebarth (dziebarth_at_hotmail.com)
Date: 04/29/04
- Previous message: Jeff S: "Re: Question on Bandon / Lubbock Config.bib file:"
- In reply to: Steve Maillet \(eMVP\): "Re: What is the driver API call to register a device"
- Next in thread: Steve Maillet \(eMVP\): "Re: What is the driver API call to register a device"
- Reply: Steve Maillet \(eMVP\): "Re: What is the driver API call to register a device"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Apr 2004 15:17:25 -0500
What I thought was that ActivateDeviceEx creates the Active key then calls
ActivateDevice. ActivateDevice loads the driver into the Device Manager
process space then turns around and calls the XXX_Init function of the
loaded driver.
Yep, I did add the keys manually from RegEdit and then attempted to use
ActiveDevice instead of ActivateDeviceEx when I could not get
ActivateDeviceEx to work as expected (i.e. to load the driver and add the
registry values to the Active key in the registry, as per the MSDN
reference). How do I add them with regular APIs (yep, a newbie question!) ?
I had manually added them to the [HKLM]\Drivers\BuiltIn\SPI_ME key. That
didn't work either. I did try the LoadDriver() function and got it to load
into the application workspace but that probably is not the best way to do
it.
My understanding is that the parameter passed to ActivateDeviceEx (as the
fourth parameter, and you have to be carefull about doing the proper
maping!) is passed along to the drivers XXX_Init function as the second
parameter (according to the MSDN documentation regarding XXX_Init). The
first parameter to the XXX_Init function is a pointer to a string containing
the registry path to the active key of the driver. I think that's what you
where talking about in the PCMCIA example.
The question still remains as to how to get the ActiveDeviceEx function to
load the driver and add the registry values to the Active key. I was able
to find an example of an ActivateDevice call in the Keyboard Human Interface
Device driver (kbd/hid/kbhid files) but no examples of ActivateDeviceEx.
Ultimately it probably will have to be added as a load at boot time but that
requires detailed knowledge of how the project.reg and the rest of the PB
files work together.
I've seen a fair number of questions about this so maybe it would be a good
topic for a "Get Embedded" column (if I can be so bold as to lobby!). Mike
Halls article was pretty good except the loading of the driver left out the
details of ActivateDeviceEx.
"Steve Maillet (eMVP)" <nospam1@EntelechyConsulting.com> wrote in message
news:eAplnwhLEHA.3596@tk2msftngp13.phx.gbl...
> Umm, well yes that makes sense. You can't create the drivers load registry
> entries at the same time you activate it. The registry entries provided to
> ActivateDevice are for the devices "Active" key. The "Active" key is
> essentially per instance device information the loading process provides
to
> the driver. A typical use of this would be for the PCMCIA bus driver to
> place socket and function info in the active key so the driver can have
that
> information available to initialize the PCMCIA bus access for the device.
> Another example is an IRQ and or SYSINTR value allocated for the driver by
a
> bus enumerator like the PCI bus.
>
> So you need to add the devices key manually with the normal registry APIs
> instead of with the ActivateDeviceEx() call.
>
> --
> Steve Maillet (eMVP)
> EmbeddedFusion
> smaillet_AT_EmbeddedFusion_DOT_com
>
>
- Previous message: Jeff S: "Re: Question on Bandon / Lubbock Config.bib file:"
- In reply to: Steve Maillet \(eMVP\): "Re: What is the driver API call to register a device"
- Next in thread: Steve Maillet \(eMVP\): "Re: What is the driver API call to register a device"
- Reply: Steve Maillet \(eMVP\): "Re: What is the driver API call to register a device"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|