locked
Driver for Windows Mobile 6.1 vs Windows Mobile 6.5 RRS feed

  • Question

  • Hello,

    I developed an USB stream interface driver for Windows Mobile 6.1. I used Microsoft Visual Studio 2008 with Windows Mobile 6 professional SDK to write and compile the USB driver. The USB driver works well. Now, I want use this USB driver with Windows Mobile 6.5 but the USB driver is not recognized. Both Windows Mobile is installed on a Motorola MC55. I can't connect to the USB driver because the CreateFile call fails. With the Windows Mobile 6.1 the CreateFile return a open handle but now the CreateFile function return NULL.

    This is how I used the CreateFile function:

    UsbPort = CreateFile( _T("USB1:"), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL );

    The GetLastError function return 55: ERROR_DEV_NOT_EXIST.

    The USB driver contains those functions: DllMain, USB_Init, USB_Deinit, USB_Open, USB_Close, USB_IOControl, USB_PowerUp, USB_PowerDown, USB_Read, USB_Write and USB_Seek for the stream interface driver. I used those functions USBDeviceAttach, USBInstallDriver and USBUnInstallDriver for the USB enumeration.

    Is it a difference between Windows Mobile 6.1 and Windows Mobile 6.5 interface driver? Do I have to recompile the USB driver with another SDK?

    Thanks,

    Claude C.

     

    Thursday, May 5, 2011 1:54 PM

Answers

  • Hi Claude

    I'm not aware that WM (and Windows Embedded Compact) has the ability to automatically install drivers on first time connect.

    So adding the required registry keys to load the driver is most likely the only option that will work.

    I assume you already have an installer (CAB file) to deploy your driver to the device.
    If this is the case, adding the registry keys is pretty simple.

    Michael


    MVP Windows Embedded
    • Proposed as answer by Jesse Jiang Tuesday, May 17, 2011 7:20 AM
    • Marked as answer by Jesse Jiang Thursday, May 19, 2011 12:44 PM
    Thursday, May 12, 2011 6:21 AM

All replies

  • Hello

    I found where my problem comes from, With Windows Mobile 6.1 when I connected the USB peripheral on the Mobile unit (the unit is set in Host USB Mode) , the unit asks for the name of the peripheral driver (name of the DLL) for installing the USB stream driver in the Windows Registry of the device. After that, the driver is loaded automaticly when the peripheral is connected to the USB host unit.

    But now with the Windows Mobile 6.5, the USB host unit doesn't ask for the name of the peripheral driver thus the driver is not installed. Thus when I connect the USB peripheral, the driver is not loaded and the CreateFile function returns NULL.

    How can I install the USB driver automatically when I connect the USB peripheral the first time?

    Do I need to pre-set the Windows registry for the USB peripheral?

    Thanks,

    Claude C.

     

    Friday, May 6, 2011 2:50 PM
  • Hi Claude,

     

    I think you need to set the name in registry. However, did you try to do something in DLL_PROCESS_ATTACH?

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 9, 2011 9:27 AM
  • Hi Claude

    I'm not aware that WM (and Windows Embedded Compact) has the ability to automatically install drivers on first time connect.

    So adding the required registry keys to load the driver is most likely the only option that will work.

    I assume you already have an installer (CAB file) to deploy your driver to the device.
    If this is the case, adding the registry keys is pretty simple.

    Michael


    MVP Windows Embedded
    • Proposed as answer by Jesse Jiang Tuesday, May 17, 2011 7:20 AM
    • Marked as answer by Jesse Jiang Thursday, May 19, 2011 12:44 PM
    Thursday, May 12, 2011 6:21 AM