http://bugs.winehq.org/show_bug.cgi?id=24522
Summary: CreateCompatibleDC( NULL ) crash Product: Wine Version: 1.2 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdi32 AssignedTo: wine-bugs@winehq.org ReportedBy: milasudril@gmail.com
Created an attachment (id=30955) --> (http://bugs.winehq.org/attachment.cgi?id=30955) Backtrace
When creating a DC compatible with the current screen wine crashes. To reproduce try this:
#include <windows.h>
int main() { HDC dc=CreateCompatibleDC(NULL);
DeleteDC(dc); }
It is supposed to create a DC compatible with the current screen. See
http://msdn.microsoft.com/en-us/library/dd183489%28VS.85%29.aspx
http://bugs.winehq.org/show_bug.cgi?id=24522
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, testcase
--- Comment #1 from Jeff Zaroyko jeffz@jeffz.name 2010-09-26 04:02:27 CDT --- Which application depends on this?
http://bugs.winehq.org/show_bug.cgi?id=24522
--- Comment #2 from milasudril@gmail.com 2010-09-26 05:09:38 CDT --- (In reply to comment #1)
Which application depends on this?
The posted one :-)
Well, this technique can be used when you want to draw to a bitmap with GDI functions in an application that does not have a window for example rendering graphics to a high resolution bitmap.
http://bugs.winehq.org/show_bug.cgi?id=24522
--- Comment #3 from Jeff Zaroyko jeffz@jeffz.name 2010-09-26 05:41:24 CDT --- Yes, but is there a real world application which depends on this behavior which you have encountered? If so, it's nicer to mention the name in the bug title to show which application will be fixed.
http://bugs.winehq.org/show_bug.cgi?id=24522
--- Comment #4 from milasudril@gmail.com 2010-09-26 06:18:33 CDT --- (In reply to comment #3)
Yes, but is there a real world application which depends on this behavior which you have encountered? If so, it's nicer to mention the name in the bug title to show which application will be fixed.
It appeared when I tried to use a self-made plotter that uses GDI to draw text on a bitmap. It is a class that can draw the graph of a function in a coordinate system. A Windows API guru would know if CreateCompatibleDC(NULL) is unconventional or not. That is the question.
http://bugs.winehq.org/show_bug.cgi?id=24522
--- Comment #5 from Alexandre Julliard julliard@winehq.org 2010-09-26 16:37:22 CDT --- CreateCompatibleDC(NULL) is OK, and works fine. It's used in many places in the Wine code.
The problem is that a tiny sample app like your example doesn't import user32, which is thus not initialized properly. It's arguably a bug, but not something that's going to happen with any real app.
http://bugs.winehq.org/show_bug.cgi?id=24522
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |DUPLICATE
--- Comment #6 from Alexandre Julliard julliard@winehq.org 2010-09-26 16:40:38 CDT --- Duplicate.
*** This bug has been marked as a duplicate of bug 17929 ***
http://bugs.winehq.org/show_bug.cgi?id=24522
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Dmitry Timoshkov dmitry@codeweavers.com 2010-09-27 04:01:17 CDT --- Closing duplicate.