ntdll: fix get_server_context_flags

Michael Karcher wine at mkarcher.dialup.fu-berlin.de
Sat Jul 25 07:23:31 CDT 2009

The "mask CPU id flags" line did the opposite of what it said: It
left only the CPU id bits in, as ~0x3f is everything except the
register selection. This made all output bits set, as the CPU id
bit is set in the symbolic constants like CONTEXT_CONTROL and in
the flags passed in, so the bitwise and is never zero.

The result is a memory overwrite in the clients as
CONTEXT_EXTENDED_REGISTERS gets passed to client not expecting it.

This fixes for example the crash reported in Bug 15259, comment 10. As
that bug is a sort of catch-all basket for the rather generic
"setup_exception_record stack overflow" error message caused usually by
memory corruption, the other issues reported there probably won't be
fixed by this patch.
 dlls/ntdll/thread.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-get_server_context_flags.patch
Type: text/x-patch
Size: 496 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20090725/272106cc/attachment.bin>

More information about the wine-patches mailing list