GetStdioPathW and SetStdioPathW always return false RRS feed

  • Question

  • I am developing application for Windows Embeded CE 6.0 and I have problem. When I disable console, output from Console.WriteLine() is printed to output debug stream, which call OEMWriteDebugByte(BYTE ch). I want to use Console.ReadLine()/Read()/cin... and other but system do not want to call OEMReadDebugByte(). Therefore I want to use COM driver as stdout, stdin, stderr. I am trying to call BOOL GetStdioPathW(DWORD id, PWSTR pwszBuf, LPDWORD lpdwLen) and BOOL SetStdioPathW(DWORD id, PWSTR pwszPath), but this functions always return false. I wrote application which is importing coredll.dll and it did not worked. Then I wrote kernel space drivers, which includs pkfuncs.h but it still do not work. Can I know where can be problem?
    Monday, January 14, 2013 12:45 PM

All replies

  • I'm not sure to understand what you're trying to achieve so my comments may not be appropriate:

    • If you want to redirect the console output to a serial port you need some specific registry settings (see
    • When GetStdioPathW/SetStdioPathW fail (i.e. return FALSE) which error code do you get calling GetLastError()? Can you post the code snippet where you call the functions? Is it something like:
    WCHAR szStdPath[MAX_PATH + 1];
    DWORD dwLen = MAX_PATH;
    GetStdioPathW(1, szStdPath, &dwLen);

    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom Check my blog:

    Monday, January 14, 2013 1:41 PM
  • I want redirect stdout, stdin, stderr, Console.WriteLine() and Console.ReadLine(). I am doing it because Console.ReadLine() and "cin" is not working, when it writing output to debug output stream (console disabled). I am going to add GetLastError() to my source and rebuild. I will post code, when it will be done.
    Monday, January 14, 2013 2:03 PM
  • It return code 50.

    I found only desktop error codes:

    50 (0x32)

    The request is not supported.

    I have found in winerror.h:

    // MessageText:
    //  The request is not supported.
    #define ERROR_NOT_SUPPORTED  50L

    I still do not know why it is not supported. According to documentation it should be supported.

    • Edited by IvanSistik Monday, January 14, 2013 2:38 PM
    Monday, January 14, 2013 2:13 PM
  • When you say 'console disabled' you mean that the console is not included among the OS components? This may explain why you get ERROR_NOT_SUPPORTED

    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom Check my blog:

    Monday, January 14, 2013 3:52 PM
  • I tried to run that with console incuded in os design, but it did not work, too.

    Monday, January 14, 2013 3:58 PM