locked
Device communication from Metro app directly without driver.

    Question

  • Hello

    My desktop application for printer device uses vender request commands on the control transfer (control port of USB) via USB to get several some data about printing devices. And also printing bulk transfer via USB is used to send specific commands or receive the response for the command from the device.

    I have a plan to migrate current existing desktop application based on Win32 and MFC to Metro App. Current existing desktop application use many IO functions including DeviceIOControl(). To migrate it, I checked the some sessions for metro device app. In here, I think metro app cannot communicated with USB device with DeviceIOControl(). Intead of that, metro device app need to call printer driver and the driver get the device information and then finally the metro device app can get the printer device information.

    So my understanding is right ? is there any methods to communicate between Metro app and actual device directly via USB without printer driver?


    • Edited by Host_Driver Wednesday, January 11, 2012 11:37 AM
    Wednesday, January 11, 2012 5:46 AM

Answers

  • Hi Justin,
    Thank you for your reply.


    My device is general printing device and my app wants to connect the device via network and USB to get several data from devices
    For USB case, I would like to know the how to work with USB devices in Metro App.

    As you know, In desktop environment, my application calls SetupDi API and CreateFile and DeviceIOControl APIs to get handle for USB printer devices and communicate with the device. But for metro app case, how to work with USB device in metro app?
    Can metro app use same SetupDi API and DeviceIOControl APIs like desktop applications to communicate USB devices?
    And are there any limitations to call the APIs (SetupDi and DeviceIOControl) if it's possible?

    Daniel,

    The following information shows how to handle printing on Windows 8:

    http://msdn.microsoft.com/en-us/library/windows/hardware/hh852373.aspx

    Best Wishes - Eric


    Friday, June 08, 2012 6:41 AM
    Moderator
  • Hi all,

    I have a similar question as well.

    What I did in desktop app is to use DeviceIoControl to send an ioctl to my filter driver which is a lower driver of USB / Portable device.

    That filter driver then sends command to attached USB/portable device.

    If I want to move this app to metro app, does the app must be a device app?

    How can I send DeviceIoControl to my filter driver?

     

    Thanks,

    wt

     

    WT,

    Please see:  http://msdn.microsoft.com/en-us/library/windows/hardware/br259126.aspx

    Best Wishes - Eric

    Friday, June 08, 2012 6:43 AM
    Moderator

All replies

  • Hi Daniel,

    Sounds like you have a unique device. What we presented at the //BUILD conference was centered around how to build Metro style device apps for printers that work with a v4 print driver. Since you don't use a print driver, you wouldn't be qualified for any of the printer specific contracts like print preferences or printer notifications, since you wouldn't have a print queue. In that respect, your device is effectively "unclassified" and not a printer as far as Windows knows.

    I hope you will look at aligning with the existing print stack on future iterations of your device since it should reduce development cost considerably and improve your device's ability to operate with any application that runs on Windows.

    In terms of your current device architecture, I believe we have a solution that may be suitable for your device. Please see this talk from George Roussos and Nar Ganapathy at the //BUILD conference: http://channel9.msdn.com/Events/BUILD/BUILD2011/HW-747T.

     

    Thanks

    Justin [MSFT]

    Wednesday, January 11, 2012 6:24 PM
  • Hi Justin,
    Thank you for your reply.


    My device is general printing device and my app wants to connect the device via network and USB to get several data from devices
    For USB case, I would like to know the how to work with USB devices in Metro App.

    As you know, In desktop environment, my application calls SetupDi API and CreateFile and DeviceIOControl APIs to get handle for USB printer devices and communicate with the device. But for metro app case, how to work with USB device in metro app?
    Can metro app use same SetupDi API and DeviceIOControl APIs like desktop applications to communicate USB devices?
    And are there any limitations to call the APIs (SetupDi and DeviceIOControl) if it's possible?

    Thursday, January 12, 2012 7:35 AM
  • Hi all,

    I have a similar question as well.

    What I did in desktop app is to use DeviceIoControl to send an ioctl to my filter driver which is a lower driver of USB / Portable device.

    That filter driver then sends command to attached USB/portable device.

    If I want to move this app to metro app, does the app must be a device app?

    How can I send DeviceIoControl to my filter driver?

     

    Thanks,

    wt

     

    Thursday, January 12, 2012 9:28 AM
  • Hi Justin,
    Thank you for your reply.


    My device is general printing device and my app wants to connect the device via network and USB to get several data from devices
    For USB case, I would like to know the how to work with USB devices in Metro App.

    As you know, In desktop environment, my application calls SetupDi API and CreateFile and DeviceIOControl APIs to get handle for USB printer devices and communicate with the device. But for metro app case, how to work with USB device in metro app?
    Can metro app use same SetupDi API and DeviceIOControl APIs like desktop applications to communicate USB devices?
    And are there any limitations to call the APIs (SetupDi and DeviceIOControl) if it's possible?

    Daniel,

    The following information shows how to handle printing on Windows 8:

    http://msdn.microsoft.com/en-us/library/windows/hardware/hh852373.aspx

    Best Wishes - Eric


    Friday, June 08, 2012 6:41 AM
    Moderator
  • Hi all,

    I have a similar question as well.

    What I did in desktop app is to use DeviceIoControl to send an ioctl to my filter driver which is a lower driver of USB / Portable device.

    That filter driver then sends command to attached USB/portable device.

    If I want to move this app to metro app, does the app must be a device app?

    How can I send DeviceIoControl to my filter driver?

     

    Thanks,

    wt

     

    WT,

    Please see:  http://msdn.microsoft.com/en-us/library/windows/hardware/br259126.aspx

    Best Wishes - Eric

    Friday, June 08, 2012 6:43 AM
    Moderator
  • hi wt_Square,

    did you find answer for your question? i have exactly the same question for my keyboard lower filter driver. can you share how you did it finallly?

    Hi all,

    I have a similar question as well.

    What I did in desktop app is to use DeviceIoControl to send an ioctl to my filter driver which is a lower driver of USB / Portable device.

    That filter driver then sends command to attached USB/portable device.

    If I want to move this app to metro app, does the app must be a device app?

    How can I send DeviceIoControl to my filter driver?

     

    Thanks,

    wt

     


    Wednesday, July 02, 2014 11:21 PM