Tuesday, June 7, 2011

How to clone the MOUHID client driver into your platform

1. Create a folder for the MyMouHid under the following directory"
    _PLATFORMROOT\MyPlatform\src\drivers\.
   
2. Copy all files from _PUBLICROOT\Common\Oak\Drivers\USB\class\hid\clients\MOUHID.

3. Rename mouhid.def to MyMouHid.def.

4. Find the following line of code:

    TARGETNAME=MOUHIDBASE
   
   Change the above line of code to the following:
  
    TARGETNAME=MyMouHid
   
5. Find the following line of code:

    TARGETTYPE=LIBRARY

   Change the above line to the following:

    TARGETTYPE=DYNLINK
   
6. Change the build target type from generating a library file to generating a DLL file.

7. Find the following line of code:

    TARGETDEFNAME=MOUHID

   Change the above line of code to

    TARGETDEFNAME=MyMouHid
   
8. Add the following line of code near the beginning of the file:

    RELEASETYPE=PLATFORM

9. Find the following line of code:

    WINCETARGETFILE0=$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\$(TARGETDEFNAME).def

   Change the above line of code to

    WINCETARGETFILE0=$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\$(TARGETDEFNAME).def

11. Add the following TARGETLIBS entries after the SOURCELIBS line:

    TARGETLIBS=\
    $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Coredll.lib \
    $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Ceddk.lib \
    $(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\ddguid.lib \
    $(_WINCEROOT)\public\common\oak\lib\x86\debug\hidparse_lib.lib \
    $(_WINCEROOT)\public\common\oak\lib\x86\debug\MouHidStd.lib \
   
With the above modifications to the Sources file, the cloned MyMouHid driver source code can be
compiled to generate the mymouhid.dll binary in the build release directory.

12. Add the below lines in platform.reg

    ; @CESYSGEN IF CE_MODULES_MOUHID
    [HKEY_LOCAL_MACHINE\Drivers\HID\LoadClients\Default\Default\1_2\Mouse]
       "DLL"="mymouhid.DLL"
       "RemoteWakeup"=dword:1
    ; @CESYSGEN ENDIF CE_MODULES_MOUHID


13. Add the below lines in platform.reg

    mymouhid.DLL        $(_FLATRELEASEDIR)\mymouhid.DLL           NK SHK

No comments:

Post a Comment