none
Adding new custom IoCtrl code for KernelIoControl() RRS feed

  • Question

  • Hi there,

    i need to add a new custom IOCTRL code.

    I defined the value for the code:

    #define IOCTL_CUSTOM_BOOTVER CTL_CODE(FILE_DEVICE_HAL, 3001, METHOD_BUFFERED, FILE_ANY_ACCESS)

    I added it to the ioctl_tab.h list and implemented the related function.

    I added the 'case' line for that code into the switch() inside the IoControl() fn in C:\WINCE700\public\common\oak\oalioctl\dll\oalioctl.cpp file.

    Everythig is compiled without errors but when i call the KernelIoControl() with that code i always receive error 50 = ERROR_NOT_SUPPORTED.

    What i miss?

    Thanks


    SteMMo

    Monday, August 26, 2013 1:59 PM

All replies

  • When I have added IOCTL's in CE 6.0, I clone C:\WINCE600\PLATFORM\MY_BSP\SRC\OAL\OALIoctl and change the oalioctl.cpp file there.   Don't know if this applies to WEC7 but you may want to check and see if the oalioctl.cpp file is in the platform tree.

    Bill

    Monday, August 26, 2013 3:04 PM
  • Yes,

    i modified the file C:\WINCE700\platform\MyPlatform\src\OAL\oallib\ioctl.c.

    the problem is that the loop that looks for the new code, seems that it is not able to find the new code.


    SteMMo

    Monday, August 26, 2013 3:21 PM
  • I don't really understand: the OS project was moved from a PC to another and i don't have the same output :(

    When i call from a dll something like this:

    BOOL bRet = KernelIoControl(IOCTL_CUSTOM_BOOTVER, NULL, 0, &data, sizeof(data), &nByteRet);

    which function should be called?

    My guess was:

    - OEMIoControl(...) in C:\WINCE700\platform\common\src\common\ioctl\ioctl.c   or

    - IoControl(...) in C:\WINCE700\public\common\oak\oalioctl\dll\oalioctl.cpp

    Adding some debug output, none of them are recalled (bootver is my dll) !?!?!?

    PID:00400002 TID:03CF00AA -OEMIoControl-0x1012024--
    PID:00400002 TID:03CF00AA 0 * 1010048
    PID:00400002 TID:03CF00AA 1 * 1010098
    PID:00400002 TID:03CF00AA 2 * 10100d8
    PID:00400002 TID:03CF00AA 3 * 1010090
    PID:00400002 TID:03CF00AA 4 * 10100b0
    PID:00400002 TID:03CF00AA 5 * 1010038
    PID:00400002 TID:03CF00AA 6 * 101003c
    PID:00400002 TID:03CF00AA 7 * 1010014
    PID:00400002 TID:03CF00AA 8 * 10100a4
    PID:00400002 TID:03CF00AA 9 * 10100a0
    PID:00400002 TID:03CF00AA 10 * 10100a8
    PID:00400002 TID:03CF00AA 11 * 1010108
    PID:00400002 TID:03CF00AA 12 * 1010054
    PID:00400002 TID:03CF00AA 13 * 1010004
    PID:00400002 TID:03CF00AA 14 * 1010034
    PID:00400002 TID:03CF00AA 15 * 10100d0
    PID:00400002 TID:03CF00AA 16 * 1010064
    PID:00400002 TID:03CF00AA 17 * 1010134
    PID:00400002 TID:03CF00AA 18 * 1012ee0
    PID:00400002 TID:03CF00AA 19 * 1012ee4
    PID:00400002 TID:03CF00AA 20 * 1010050
    PID:00400002 TID:03CF00AA 21 * 10100b4
    PID:00400002 TID:03CF00AA 22 * 10100f4
    PID:00400002 TID:03CF00AA 23 * 10100fc
    PID:00400002 TID:03CF00AA 24 * 10100f8
    PID:00400002 TID:03CF00AA 25 * 1012000
    PID:00400002 TID:03CF00AA 26 * 1012014
    PID:00400002 TID:03CF00AA 27 * 1012018
    PID:00400002 TID:03CF00AA 28 * 1012024
    PID:00400002 TID:03CF00AA  Found!
    PID:00400002 TID:03CF00AA -OEMIoControl-0x1010094--
    PID:00400002 TID:03CF00AA 0 * 1010048
    PID:00400002 TID:03CF00AA 1 * 1010098
    PID:00400002 TID:03CF00AA 2 * 10100d8
    PID:00400002 TID:03CF00AA 3 * 1010090
    PID:00400002 TID:03CF00AA 4 * 10100b0
    PID:00400002 TID:03CF00AA 5 * 1010038
    PID:00400002 TID:03CF00AA 6 * 101003c
    PID:00400002 TID:03CF00AA 7 * 1010014
    PID:00400002 TID:03CF00AA 8 * 10100a4
    PID:00400002 TID:03CF00AA 9 * 10100a0
    PID:00400002 TID:03CF00AA 10 * 10100a8
    PID:00400002 TID:03CF00AA 11 * 1010108
    PID:00400002 TID:03CF00AA 12 * 1010054
    PID:00400002 TID:03CF00AA 13 * 1010004
    PID:00400002 TID:03CF00AA 14 * 1010034
    PID:00400002 TID:03CF00AA 15 * 10100d0
    PID:00400002 TID:03CF00AA 16 * 1010064
    PID:00400002 TID:03CF00AA 17 * 1010134
    PID:00400002 TID:03CF00AA 18 * 1012ee0
    PID:00400002 TID:03CF00AA 19 * 1012ee4
    PID:00400002 TID:03CF00AA 20 * 1010050
    PID:00400002 TID:03CF00AA 21 * 10100b4
    PID:00400002 TID:03CF00AA 22 * 10100f4
    PID:00400002 TID:03CF00AA 23 * 10100fc
    PID:00400002 TID:03CF00AA 24 * 10100f8
    PID:00400002 TID:03CF00AA 25 * 1012000
    PID:00400002 TID:03CF00AA 26 * 1012014
    PID:00400002 TID:03CF00AA 27 * 1012018
    PID:00400002 TID:03CF00AA 28 * 1012024
    PID:00400002 TID:03CF00AA 29 * 1012028
    PID:00400002 TID:03CF00AA 30 * 1010094
    PID:00400002 TID:03CF00AA  Found!
    PID:03510192 TID:03B90192 (bootver) vgf54g54g54g before
    PID:03510192 TID:03B90192 (bootver) vgf54g54g54g Err KernelIoControl err=50 [0x1012EE4]
    PID:03510192 TID:03B90192 (startup) GetHwInfo() return FALSE
    PID:03510192 TID:03B90192 (bootver) x1w2e3r4t5 before
    PID:03510192 TID:03B90192 (bootver) x1w2e3r4t5 Err KernelIoControl err=50 [0x1012EE4]
    PID:03510192 TID:03B90192 (bootver) e4r5t9y3w2q before
    PID:03510192 TID:03B90192 (bootver) e4r5t9y3w2q Err KernelIoControl err=50 [0x1012EE4]
    PID:03510192 TID:03B90192 (bootver) vgf54g54g54g before
    PID:03510192 TID:03B90192 (bootver) vgf54g54g54g Err KernelIoControl err=50 [0x1012EE4]
    PID:00400002 TID:017E0006 -OEMIoControl-0x1011138--
    PID:00400002 TID:017E0006 0 * 1010048
    PID:00400002 TID:017E0006 1 * 1010098
    PID:00400002 TID:017E0006 2 * 10100d8
    PID:00400002 TID:017E0006 3 * 1010090
    PID:00400002 TID:017E0006 4 * 10100b0
    PID:00400002 TID:017E0006 5 * 1010038
    PID:00400002 TID:017E0006 6 * 101003c
    PID:00400002 TID:017E0006 7 * 1010014
    PID:00400002 TID:017E0006 8 * 10100a4
    PID:00400002 TID:017E0006 9 * 10100a0
    PID:00400002 TID:017E0006 10 * 10100a8
    PID:00400002 TID:017E0006 11 * 1010108
    PID:00400002 TID:017E0006 12 * 1010054
    PID:00400002 TID:017E0006 13 * 1010004
    PID:00400002 TID:017E0006 14 * 1010034
    PID:00400002 TID:017E0006 15 * 10100d0
    PID:00400002 TID:017E0006 16 * 1010064
    PID:00400002 TID:017E0006 17 * 1010134
    PID:00400002 TID:017E0006 18 * 1012ee0
    PID:00400002 TID:017E0006 19 * 1012ee4
    PID:00400002 TID:017E0006 20 * 1010050
    PID:00400002 TID:017E0006 21 * 10100b4
    PID:00400002 TID:017E0006 22 * 10100f4
    PID:00400002 TID:017E0006 23 * 10100fc
    PID:00400002 TID:017E0006 24 * 10100f8
    PID:00400002 TID:017E0006 25 * 1012000
    PID:00400002 TID:017E0006 26 * 1012014
    PID:00400002 TID:017E0006 27 * 1012018
    PID:00400002 TID:017E0006 28 * 1012024
    PID:00400002 TID:017E0006 29 * 1012028
    PID:00400002 TID:017E0006 30 * 1010094
    PID:00400002 TID:017E0006 31 * 1010144
    PID:00400002 TID:017E0006 32 * 1010168


    SteMMo

    Tuesday, August 27, 2013 8:16 AM
  • I'm sorry.

    I found the problem: the system DLL was not rebuilt and i was still usgin an old version :(

    I rebuilt by Clean and then Rebuilt, but it was not enough...

    The calls sequence is:

    • custom application
    • custom dll (KernelIoControl())
    • IoControl()
    • OEMIoControl()
    • CustomFunction()


    SteMMo

    • Edited by SteMMo Tuesday, August 27, 2013 9:01 AM
    Tuesday, August 27, 2013 8:43 AM
  • It appears that you either did not clone oalioctl, or did not modify the Dies file so that it would build.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com

    • Proposed as answer by PeterFnet Sunday, August 17, 2014 9:10 AM
    Tuesday, August 27, 2013 1:38 PM
    Moderator