none
New IOCTL Definition Rules for SDHC driver RRS feed

  • Question

  • Hi all,

    I want the user-mode applications can access the IOCTL codes that I've created newly on the SDHC driver (kernel-mode driver) of BSP through DeviceIoControl function. So I've added a new CTL_Code in header file under PLATFORM\BSP\SRC\Drivers\SDHC\SDHCBase. But in that case, that header file must be included by the application. Instead of, should I define these custom IOCTL codes into oalioctl.cpp under PLATFORM\BSP\SRC\CustomOALIOCTL\OALIOCTL?

    Thanks a lot to you for your helps

    Best regards

    Monday, November 22, 2010 3:58 PM

Answers

  • Define the IOCTLs in a header file and include the same header in the driver and the app.
    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    • Marked as answer by yaseminyilmaz Tuesday, November 23, 2010 10:09 AM
    Monday, November 22, 2010 4:27 PM
    Moderator

All replies

  • Define the IOCTLs in a header file and include the same header in the driver and the app.
    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    • Marked as answer by yaseminyilmaz Tuesday, November 23, 2010 10:09 AM
    Monday, November 22, 2010 4:27 PM
    Moderator
  • And/Or copy the header file to the SDK folder so it is included in the SDK:
     
    Add the following line to your driver sources file:
     
    WINCETARGETFILES=CopySDK
     
    and add the following makefile.inc file:
     
    CopySDK:
    if not EXIST $(_PROJECTSDKROOT)\Inc mkdir $(_PROJECTSDKROOT)\Inc
    xcopy /I /D /Q myioctldefs.h $(_PROJECTSDKROOT)\Inc
     
     
    These instructions can also be found on Bruce's blog here:
    http://geekswithblogs.net/BruceEitman/archive/2008/05/08/windows-ce-platform-builder--automatically-putting-files-in-the.aspx
     

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.
    Tuesday, November 23, 2010 10:23 AM
    Moderator
  • I thought that I recognized that.
    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Tuesday, November 23, 2010 1:50 PM
    Moderator
  • On 11/22/2010 4:58 PM, yaseminyilmaz wrote:
    > Hi all,
    >
    > I want the user-mode applications can access the IOCTL codes that I've
    > created newly on the SDHC driver (kernel-mode driver) of BSP through
    > DeviceIoControl function. So I've added a new CTL_Code in header file
    > under PLATFORM\BSP\SRC\Drivers\SDHC\SDHCBase. But in that case, that
    > header file must be included by the application. Instead of, should I
    > define these custom IOCTL codes into oalioctl.cpp under
    > PLATFORM\BSP\SRC\CustomOALIOCTL\OALIOCTL?
     
    Michel and Bruce already provided the correct answer.
    Just to add my two (euro)cents... OAL IOCTLs are not related to a
    specific device driver and can be invoked using KernelIoControl. Some of
    those IOCTLs are accessible also from user mode apps (check Bruce's blog
    for a great sample of how to change this "filter" layer).
     
     

    Valter Minute
    Windows Embedded MVP
    http://geekswithblogs.net/WindowsEmbeddedCookbook
    Wednesday, November 24, 2010 10:40 AM