Re: What is the driver API call to register a device

From: Dale Ziebarth (dziebarth_at_hotmail.com)
Date: 04/29/04

  • Next message: HASH: "System hangs up on Hard Disk read/writes"
    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
    >
    >


  • Next message: HASH: "System hangs up on Hard Disk read/writes"

    Relevant Pages

    • RE: Setting breakpoints in a driver using eVC++
      ... I think you can get what you want by using the ActivateDeviceEx() function. ... This tells Device.exe to load your driver on demand. ... Undo the registry settings you made to get it to load at boot time. ... I haven't used eVC for some time, but I think this should all work. ...
      (microsoft.public.windowsce.embedded.vc)
    • Re: Can a driver be dynamically activated
      ... ActivateDeviceEx and ActivateDevice use the device manager to load the ... Use ActiveDeviceEx for a device driver. ... > Only ActivateDeviceEx should be used even LoadDriver can help us... ...
      (microsoft.public.windowsce.embedded)
    • Re: how can I register a device in my driver?how can i use ActivateDev
      ... You use ActivateDeviceEx to tell the Device.exe to load your driver. ... the PB Help for details on the API. ...
      (microsoft.public.windowsce.platbuilder)
    • Re: White progress bar during startup
      ... Loaded driver \WINDOWS\system32\ntoskrnl.exe ... Did not load driver ACPI Uniprocessor PC ... Did not load driver Audio Codecs ...
      (microsoft.public.windowsxp.help_and_support)
    • XP Pro crashes
      ... The bootlog shows an awful lot of 'Failed to load' entries so I'm taking the liberty of posting the whole bootlog here in the hope that someone can give me some pointers as to what is going on. ... Did not load driver WAN Miniport ...
      (microsoft.public.windowsxp.setup_deployment)