[PATCH 2/4] kernel32: Use IOCTL_CONDRV_WRITE_CONSOLE in WriteConsoleW when possible.

Carlos Rivera carlos at superkaos.org
Tue Sep 15 05:01:12 CDT 2020


Hi,
    There is a test in dlls/kernel32/tests/profile.c that contains the following:

    ret=GetPrivateProfileSection("section3", buf, sizeof(buf), testfile4);
    trace("section 3 return: %s\n", buf);
    ok(GetLastError() == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", GetLastError());

The ok macro now fails in my machine (it doesn't here though: https://test.winehq.org/data/01bacebba418bf6f58a644b1aab41be215bd200a/linux_newtb-debiant-wow64/kernel32:profile.html)

I have traced it back to this commit.  It seems that the trace call sets last error to STATUS_INVALID_HANDLE since the
introduction of this patch, If I change trace by a call to printf it does the same thing.

I see that the invalid handle is sent all the way from the server:

WriteConsoleW
  DeviceIoControl
   NtDeviceIoControl
    server_ioctl_file


I understand that checking for last error should be done right after calling the function to be tested
anyway. But I wanted to let you know about this, since it seems a little strange, I do not know anything
about how the console works, maybe something is broken in my setup?  The trace shows up anyway despite 
setting last error.

Cheers,
crc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200915/d912c701/attachment-0001.sig>


More information about the wine-devel mailing list