none
Custom backlight driver module not loading RRS feed

  • Question

  • Hi,

     I have created and included driver named "Backlight_GI.dll" under 'Drivers\BuiltIn\BACKLIGHT_GI' for our custom BSP derived from SDP4430. This driver is not loading and getting an error message as shown below.

        41366 PID:400003 TID:c50006 RELFSD: Opening file Backlight_GI.dll from desktop
        41369 PID:400003 TID:c50006 OSAXST1: >>> Loading Module 'backlight_gi.dll' (0xA341DEF0) at address 0xAFC40000-0xAFC46000 in Process 'NK.EXE' (0x87992AD0)
       PB Debugger Loaded symbols for 'C:\WINCE700\OSDESIGNS\GEN38\GEN38\RELDIR\I38_ARMV7_DEBUG\BACKLIGHT_GI.DLL'
      198458 PID:400003 TID:c50006 ERROR! DEVMGR: Failed to load 'Drivers\BuiltIn\BACKLIGHT_GI'. dwStatus=0x1
      199438 PID:400002 TID:c50006 OSAXST1: <<< Unloading Module 'backlight_gi.dll' (0xA341DEF0) at address 0xAFC40000-0xAFC46000 in Process 'NK.EXE' (0x87992AD0)

    Its able to enter into the driver Dll entry point, DLL_PROCESS_ATTACH, but Init function is not calling. Can anybody know the issue related with this ? 

    Thanks in Advance,

    Hareesh

    Monday, September 10, 2012 6:03 AM

Answers

  • In the device manager code you can read a comment which says:

    // Make sure that the driver has an init and deinit routine.  If it is named,
    // it must have open and close, plus at least one of the I/O routines (read, write
    // ioctl, and/or seek).  If a named driver has a pre-close routine, it must also 
    // have a pre-deinit routine.

    It looks like you're exporting the required entry points but: when you write, for example, 'Init' do you mean that you're exporting literaly 'Init'?

    If your device driver has a "Prefix"="XXX" registry entry -like 'COM' for the serial device driver- you need to export XXX_Init, XXX_Deinit, etc... Otherwise you need to specify in the registry:

    "Flags"=dword:8                      ; DEVFLAGS_NAKEDENTRIES

    This tells the device manager to instantiate the device with the prefix named in the registry (if present) but to look for DLL entry points without the prefix (so Init, Deinit, ...

    By the way: the correct name for the deinit routine is XXX_Deinit (or Deinit), without the capital 'i'


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    • Marked as answer by Hareesh Das Monday, September 10, 2012 6:59 AM
    Monday, September 10, 2012 6:43 AM

All replies

  • dwStatus = 0x1 means ERROR_INVALID_FUNCTION. The device manager set this error if something is wrong in the registry settings for the driver or (and this is more common in my experience) the device driver does not export all the required entry points (XXX_Init, etc)


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Monday, September 10, 2012 6:12 AM
  • Hi Luca Calligaris,

      Thanks for your prompt reply. I have exported the functions (Init, DeInit , IOControl, Open, Close, PowerUp, PowerDown ) in the .def file and able to see these using dumpbin utilty. I think its required only the above mentioned stream interface function for driver loading ? Correct me if i am wrong (I am a new bee to driver development).

    Regards,

    Hareesh

    Monday, September 10, 2012 6:33 AM
  • In the device manager code you can read a comment which says:

    // Make sure that the driver has an init and deinit routine.  If it is named,
    // it must have open and close, plus at least one of the I/O routines (read, write
    // ioctl, and/or seek).  If a named driver has a pre-close routine, it must also 
    // have a pre-deinit routine.

    It looks like you're exporting the required entry points but: when you write, for example, 'Init' do you mean that you're exporting literaly 'Init'?

    If your device driver has a "Prefix"="XXX" registry entry -like 'COM' for the serial device driver- you need to export XXX_Init, XXX_Deinit, etc... Otherwise you need to specify in the registry:

    "Flags"=dword:8                      ; DEVFLAGS_NAKEDENTRIES

    This tells the device manager to instantiate the device with the prefix named in the registry (if present) but to look for DLL entry points without the prefix (so Init, Deinit, ...

    By the way: the correct name for the deinit routine is XXX_Deinit (or Deinit), without the capital 'i'


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    • Marked as answer by Hareesh Das Monday, September 10, 2012 6:59 AM
    Monday, September 10, 2012 6:43 AM
  • Hi Luca Calligaris,

       Thanks...Its solved the issue. It was with "DeInit" instead of Deinit. :)

    Regards,

    Hareesh

    Monday, September 10, 2012 7:02 AM
  • On 9/10/2012 8:03 AM, Hareesh Das wrote:
    > Hi,
    >
    > I have created and included driver named "Backlight_GI.dll" under
    > 'Drivers\BuiltIn\BACKLIGHT_GI' for our custom BSP derived from SDP4430.
    > This driver is not loading and getting an error message as shown below.
    >
    > 41366 PID:400003 TID:c50006 RELFSD: Opening file Backlight_GI.dll from
    > desktop
    > 41369 PID:400003 TID:c50006 OSAXST1: >>> Loading Module
    > 'backlight_gi.dll' (0xA341DEF0) at address 0xAFC40000-0xAFC46000 in
    > Process 'NK.EXE' (0x87992AD0)
    > PB Debugger Loaded symbols for
    > 'C:\WINCE700\OSDESIGNS\GEN38\GEN38\RELDIR\I38_ARMV7_DEBUG\BACKLIGHT_GI.DLL'
    > 198458 PID:400003 TID:c50006 ERROR! DEVMGR: Failed to load
    > 'Drivers\BuiltIn\BACKLIGHT_GI'. dwStatus=0x1
    > 199438 PID:400002 TID:c50006 OSAXST1: <<< Unloading Module
    > 'backlight_gi.dll' (0xA341DEF0) at address 0xAFC40000-0xAFC46000 in
    > Process 'NK.EXE' (0x87992AD0)
    >
    > Its able to enter into the driver Dll entry point, DLL_PROCESS_ATTACH,
    > but Init function is not calling. Can anybody know the issue related
    > with this ?
     
    If the XXX_Init function is not call it means that you misconfigured the
    prefix entry (the prefix in the registry is different than the one in
    the code, or you set the "naked entries" bit in your driver
    configuration flag and still use a prefix in your function names), or
    that the functions are not exported (you should have a .def file in your
    project) or are exported with C++ decorated names (you need to put them
    inside an extern "C" block).
     

    Valter Minute
    Windows Embedded MVP
    http://geekswithblogs.net/WindowsEmbeddedCookbook
    Tuesday, September 11, 2012 8:31 AM