[Bug 16911] New: WriteProcessMemory() not working for memory protected by X11DRV_DIB_DoProtectDIBSection()
http://bugs.winehq.org/show_bug.cgi?id=16911 Summary: WriteProcessMemory() not working for memory protected by X11DRV_DIB_DoProtectDIBSection() Product: Wine Version: 1.1.12 Platform: PC OS/Version: Linux Status: UNCONFIRMED Keywords: patch, source Severity: minor Priority: P2 Component: winex11.drv AssignedTo: wine-bugs(a)winehq.org ReportedBy: thestig(a)google.com Created an attachment (id=18660) --> (http://bugs.winehq.org/attachment.cgi?id=18660) test program Hi, I have a test case here that works on WinXP but not Wine. I deliberately wrote a standalone test case because I'm not sure which unit test to put it in. It's in fact based off of dlls/kernel32/tests/virtual.c where the other WriteProcessMemory() test is. In this test case, we call CreateDIBSection() which returns a HBITMAP (hbitmap) and some memory (mem). Next, we call SetDIBits() with hbitmap. We get into X11DRV_SetDIBits(), where it calls X11DRV_DIB_Lock( physBitmap, DIB_Status_GdiMod );. This marks the memory (mem) as PAGE_NOACCESS, and leaves it in that state as SetDIBts() returns. Normally if the process tries to access it, we get a page fault that's handled by X11DRV_DIB_FaultHandler(), and everything works. However, when the test code calls WriteProcessMemory(), we talk to wineserver in NtWriteVirtualMemory(). In wine_server_call(), we do send_request(), where writev() tries to read 'mem' and fails with EFAULT. This doesn't trigger X11DRV_DIB_FaultHandler(), and WriteProcessMemory() fails. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16911 --- Comment #1 from Lei Zhang <thestig(a)google.com> 2009-01-12 18:52:37 --- Created an attachment (id=18661) --> (http://bugs.winehq.org/attachment.cgi?id=18661) proposed patch Now, I don't completely understand all code involved here, but it seems the simplest way to fix this is to not leave 'mem' with permissions set to PAGE_NOACCESS at the end of X11DRV_SetDIBits(). The attached patch sets the permissions to PAGE_READONLY, which fixes the problem for me. This patch doesn't break any other unit tests in Wine, which tells me it's not obviously wrong, but I'm not sure if it's correct, so comments are welcome. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16911 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED --- Comment #2 from Alexandre Julliard <julliard(a)winehq.org> 2009-01-15 08:52:22 --- Should be fixed by 858a7efdd40e21895bd6b0e6f2954563fc729039. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16911 Lei Zhang <thestig(a)google.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|winex11.drv |ntdll --- Comment #3 from Lei Zhang <thestig(a)google.com> 2009-01-15 12:28:05 --- Works for me. Thanks. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16911 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #4 from Alexandre Julliard <julliard(a)winehq.org> 2009-01-16 10:39:54 --- Closing bugs fixed in 1.1.13. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=16911 admin(a)sewer56.dev changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |admin(a)sewer56.dev -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (2)
-
wine-bugs@winehq.org -
WineHQ Bugzilla