Uploaded image for project: 'ReactOS Test Suite'
  1. ReactOS Test Suite
  2. ROSTESTS-140

StdInput and StdError not correctly set when starting wine tests

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • ReactOS Tests
    • ReactOS revision 64054

    Description

      Currently when you test by hand kernel32_winetest console on Reactos, all tests succeed. When you manually launch: "rosautotest kernel32 console" everything succeeds too.
      After installing rosautotest and kernel32_winetest on windows, when you launch "rosautotest kernel32 console" everything succeeds but 1 test: http://git.reactos.org/?p=reactos.git;a=blob;f=rostests/winetests/kernel32/console.c;hb=879a87079c5af969a314ea38c757da1168ac837b#l2571
      The line 2573 fails saying that it expected ERROR_NOT_ENOUGH_MEMORY but got error 6 or whatever else.
      I tried to add debug output to this test and I saw that when being launched by "rosautotest kernel32 console" the value of std_input was 0x00000000, but, if it is launched by: "kernel32_winetest console", then it is not null, and in fact it is a valid console pseudohandle.

      Now, on ReactOS currently, everything succeeds, i.e. when launching the test via "rosautotest kernel32 console" the value of that std_input variable is not 0 but a valid console handle. But it should not: I know what the problem is.

      When rosautotest starts the wine tests, it starts them with:

      m_StartupInfo.cb = sizeof(m_StartupInfo);
      m_StartupInfo.dwFlags = STARTF_USESTDHANDLES;
      m_StartupInfo.hStdOutput = m_hWritePipe;

      In ROS we do not handle at 1 place correctly that STARTF_USESTDHANDLES, in the console initialisation. With that, on Windows, you get the hStdInput == NULL. The line 2571 of the kernel32_winetest console, expects a valid console handle for std_input (so that the ReadFile call redirects to a ReadConsoleA call as expected) but if std_input is NULL, then ReadConsoleA is not run, and the test fails.

      Colin suggests this fix:

       m_StartupInfo.cb = sizeof(m_StartupInfo);
       m_StartupInfo.dwFlags = STARTF_USESTDHANDLES;
      +m_StartupInfo.hStdInput  = GetStdHandle(STD_INPUT_HANDLE);
       m_StartupInfo.hStdOutput = m_hWritePipe;

      and also setting the StdError while we are at it:

       +m_StartupInfo.hStdError  = m_hWritePipe;

      Attachments

        Activity

          People

            hbelusca hbelusca
            hbelusca hbelusca
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: