none
How to write first driver in WinCE that shoulbd be the subproject of BSP? RRS feed

  • Question

  • Hello Friends,

     I am trying to write my first driver in WinCE 7 and that should be the part of my BSP. I have already created a simple dll based subproject as LED. and I have make changes in LED.ref as

    Export

    LED_Init
    LED_Deinit
    LED_Read
    LED_Write
    LED_IOControl
    LED_Open
    LED_Close

    LED.reg as

    ; @XIPREGION IF PLATFORM_FILES_MISC
    ; @XIPREGION ENDIF PLATFORM_FILES_MISC
    [HKEY_LOCAL_MACHINE\Drivers]
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn]
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\LED]
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\LED]


    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\LED]
    "Dll"="led.dll"
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\LED]
    "Prefix"="LED"
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\LED]
    "Order"="100"

    and LED.cpp as 

    // LED.cpp : Defines the entry point for the DLL application.
    //

    #include "stdafx.h"

    BOOL APIENTRY DllMain( HANDLE hModule, 
                           DWORD  ul_reason_for_call, 
                           LPVOID lpReserved
                         )
    {
        return TRUE;
    }

    DWORD LED_Init(LPCTSTR pContext,
    DWORD dwBusContext)
    {
    DWORD init_result = 1;
    RETAILMSG(TRUE, (TEXT("LED Driver: Initialization begin!\n")));
    DEBUGMSG(TRUE, (TEXT("LED Driver: Initialization begin!\n")));

    RETAILMSG(TRUE, (TEXT("LED Driver: Initialization end!\n")));
    DEBUGMSG(TRUE, (TEXT("LED Driver: Initialization end!\n")));

    return init_result;
    }

    BOOL XXX_Deinit(
    DWORD hDeviceContext)
    {
    BOOL deinit_result = TRUE;

    RETAILMSG(TRUE, (TEXT("LED Driver: DeInitialization begin!\n")));
    DEBUGMSG(TRUE, (TEXT("LED Driver: DeInitialization begin!\n")));
    RETAILMSG(TRUE, (TEXT("LED Driver: DeInitialization end!\n")));
    DEBUGMSG(TRUE, (TEXT("LED Driver: DeInitialization end!\n")));


    return deinit_result;

    }


    How to add the build led.dll be the part of my BSP and how to write more and about other functions ????

    Sunday, February 23, 2014 6:10 AM

Answers

All replies