http://bugs.winehq.org/show_bug.cgi?id=18772
Summary: Missing User32.PrintWindow implementation Product: Wine Version: unspecified Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: namjos@gmail.com
There's a missing function in user32.dll : PrintWindow. It cause crash for an application: wine: Call from 0x7bc486d0 to unimplemented function USER32.dll.PrintWindow, aborting
The specification of the function could be found here: http://msdn.microsoft.com/en-us/library/dd162869.aspx
BOOL PrintWindow( HWND hwnd, HDC hdcBlt, UINT nFlags );
It appears that a simple redirection to WM_PRINT SendMessage could work, i.e. (not tested):
BOOL WINAPI PrintWindow( HWND sourceHandle, HDC destinationHandle, UINT nFlags) { return (SendMessageA(sourceHandle, WM_PRINT, (WPARAM)destinationHandle, PRF_CHILDREN | PRF_CLIENT | PRF_ERASEBKGND | PRF_NONCLIENT | PRF_OWNED)); }
I've tried to test this function by adding it to painting.c, but the program keeps complain about missing function, don't understand why
Regards
http://bugs.winehq.org/show_bug.cgi?id=18772
Louis Lenders xerox_xerox2000@yahoo.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |xerox_xerox2000@yahoo.co.uk
--- Comment #1 from Louis Lenders xerox_xerox2000@yahoo.co.uk 2009-06-04 04:53:18 ---
It appears that a simple redirection to WM_PRINT SendMessage could work, i.e. (not tested):
BOOL WINAPI PrintWindow( HWND sourceHandle, HDC destinationHandle, UINT nFlags) { return (SendMessageA(sourceHandle, WM_PRINT, (WPARAM)destinationHandle, PRF_CHILDREN | PRF_CLIENT | PRF_ERASEBKGND | PRF_NONCLIENT | PRF_OWNED)); }
I've tried to test this function by adding it to painting.c, but the program keeps complain about missing function, don't understand why
Have you also added stdcall to user32.spec? then it should ne "visiible"
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #2 from Jos namjos@gmail.com 2009-06-04 05:11:21 --- (In reply to comment #1)
Have you also added stdcall to user32.spec? then it should ne "visiible"
Thanks, it's was the missing thing I needed :) I can confirm my patch is working
So i've added this to user32.spec: @ stdcall PrintWindow(long long long)
And this to painting.c: BOOL WINAPI PrintWindowW( HWND sourceHandle, HDC destinationHandle, UINT nFlags) { return (SendMessageA(sourceHandle, WM_PRINT, (WPARAM)destinationHandle, PRF_CHILDREN | PRF_CLIENT | PRF_ERASEBKGND | PRF_NONCLIENT | PRF_OWNED)); }
---------------------------------------
Would it be possible to integrate it on wine? Would you need that i made a little patch file?
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #3 from Dmitry Timoshkov dmitry@codeweavers.com 2009-06-04 10:46:52 --- (In reply to comment #2)
Would it be possible to integrate it on wine? Would you need that i made a little patch file?
Yes, please send to wine-patches. See http://wiki.winehq.org/SubmittingPatches for details.
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #4 from Jos namjos@gmail.com 2009-06-04 12:16:40 --- Created an attachment (id=21555) --> (http://bugs.winehq.org/attachment.cgi?id=21555) Patch to fix this bug
Ok I sent the patch to the patch mail address. I attach it here for information
Regards
http://bugs.winehq.org/show_bug.cgi?id=18772
Adys adys.wh+winehqdotorg@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh+winehqdotorg@gmail. | |com
--- Comment #5 from Adys adys.wh+winehqdotorg@gmail.com 2009-06-04 12:29:52 --- (In reply to comment #4)
Created an attachment (id=21555)
--> (http://bugs.winehq.org/attachment.cgi?id=21555) [details]
Patch to fix this bug
Ok I sent the patch to the patch mail address. I attach it here for information
Regards
I don't see your mail yet, but you are mixing tab indentation in a 4-space indented file; if you haven't sent it yet, fix that first otherwise it will just get ignored.
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #6 from Josselin Bardet namjos@gmail.com 2009-06-04 12:34:08 --- (In reply to comment #5)
I don't see your mail yet, but you are mixing tab indentation in a 4-space indented file; if you haven't sent it yet, fix that first otherwise it will just get ignored.
Hi
I've already sent the patch but with another mail address. Would you like I resend it without any tabs and with the same mail address than here?
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #7 from Austin English austinenglish@gmail.com 2009-06-04 12:43:52 --- (In reply to comment #6)
(In reply to comment #5)
I don't see your mail yet, but you are mixing tab indentation in a 4-space indented file; if you haven't sent it yet, fix that first otherwise it will just get ignored.
Hi
I've already sent the patch but with another mail address. Would you like I resend it without any tabs and with the same mail address than here?
The e-mail address isn't as important. Since you don't appear to be subscribed to wine-patches, it's held in moderation anyway.
Resend with the indentation fixed to match the rest of the file, put 'try 2' in the subject and add a note in the e-mail saying to disregard the first one.
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #8 from Josselin Bardet namjos@gmail.com 2009-06-04 13:04:37 --- Created an attachment (id=21556) --> (http://bugs.winehq.org/attachment.cgi?id=21556) Patch without tab indentation
Is the indentation of the patch correct now? If yes I resend it to the wine patch mail address
Regards
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #9 from Nikolay Sivov bunglehead@gmail.com 2009-06-04 13:14:24 --- (In reply to comment #8)
Created an attachment (id=21556)
--> (http://bugs.winehq.org/attachment.cgi?id=21556) [details]
Patch without tab indentation
Is the indentation of the patch correct now? If yes I resend it to the wine patch mail address
Regards
Indentation maybe, but patch is wrong. Everything starting comment 1 in this bug should take place at wine-devel@winehq.org.
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #10 from Josselin Bardet namjos@gmail.com 2009-06-04 13:29:00 --- (In reply to comment #9)
Indentation maybe, but patch is wrong. Everything starting comment 1 in this bug should take place at wine-devel@winehq.org.
I sent the patch to wine-devel@winehq.org too, with a link to this discussion. I've also resent the patch to wine-patches with the modifications
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #11 from Austin English austinenglish@gmail.com 2009-06-04 14:33:13 --- (In reply to comment #9)
(In reply to comment #8)
Created an attachment (id=21556)
--> (http://bugs.winehq.org/attachment.cgi?id=21556) [details] [details]
Patch without tab indentation
Is the indentation of the patch correct now? If yes I resend it to the wine patch mail address
Regards
Indentation maybe, but patch is wrong. Everything starting comment 1 in this bug should take place at wine-devel@winehq.org.
There may not be as many responses, but bugzilla is meant to be used for bug discussion, e.g., patches (user support, etc. is not meant to be here, of course).
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #12 from Nikolay Sivov bunglehead@gmail.com 2009-06-04 16:12:28 --- (In reply to comment #11)
There may not be as many responses, but bugzilla is meant to be used for bug discussion, e.g., patches (user support, etc. is not meant to be here, of course).
Ok, I don't even see it in list, maybe sender should subscribe first.
Obvious problems are:
- 'return ();' should lose brackets here; - SendMessageW should be used; - flags are ignored but I think PW_CLIENTONLY could be mapped to PRF_CLIENT here, if you still want to ignore flags for some reason you should place FIXME; - ideal way is to add test for this if it really uses WM_PRINT. If it does it easy to test for WM_PRINT flags then.
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #13 from Josselin Bardet namjos@gmail.com 2009-06-04 17:15:20 --- (In reply to comment #12)
Ok, I don't even see it in list, maybe sender should subscribe first.
I just resent it, after subscribing
Obvious problems are:
- 'return ();' should lose brackets here;
- SendMessageW should be used;
- flags are ignored but I think PW_CLIENTONLY could be mapped to PRF_CLIENT
here, if you still want to ignore flags for some reason you should place FIXME;
- ideal way is to add test for this if it really uses WM_PRINT. If it does it easy to test for WM_PRINT flags then.
Feal free to ameliorate this patch, it is really not perfect. Put FIXME is not a good idea, as this kind of function may be called a lot of times.
For WM_PRINT related, this is the MSDN website that assert that this is equivalent to PrintWindow, but he doesn't give which arguments. I used arguments found on web, I'm not an expert of this function
I did only this to make my application worked, and it can help other people too if they are confronted to unimplemented PrintWindow
Regards
http://bugs.winehq.org/show_bug.cgi?id=18772
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com
--- Comment #14 from Dan Kegel dank@kegel.com 2009-06-04 20:03:40 --- Just curious - what app used this?
http://bugs.winehq.org/show_bug.cgi?id=18772
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #15 from Dmitry Timoshkov dmitry@codeweavers.com 2009-06-04 23:16:08 --- Confirming.
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #16 from Josselin Bardet namjos@gmail.com 2009-06-05 03:06:25 --- (In reply to comment #14)
Just curious - what app used this?
A little private client for Rose Online (not official one) http://www.akramonline.com/
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #17 from Josselin Bardet namjos@gmail.com 2009-06-05 09:30:13 --- Created an attachment (id=21566) --> (http://bugs.winehq.org/attachment.cgi?id=21566) Implementation of User32.PrintWindow
After discussion on wine devel list, I've remade a patch and sent it on wine patch and wine devel lists
http://bugs.winehq.org/show_bug.cgi?id=18772
Ken Sharp kennybobs@o2.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch, source Version|unspecified |1.1.22
http://bugs.winehq.org/show_bug.cgi?id=18772
Michael Croes mycroes@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mycroes@gmail.com
--- Comment #18 from Michael Croes mycroes@gmail.com 2009-10-13 08:12:58 --- The missing function also causes Lego Digital Designer 3.0 to crash on startup, gonna try if the attached patch fixes it.
http://bugs.winehq.org/show_bug.cgi?id=18772
ccb cedric.benharous@free.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |cedric.benharous@free.fr
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #19 from Cedric Benharous cedric.benharous@free.fr 2009-10-19 13:42:33 --- I have patch wine-1.1.31 with the User32.PrintWindow, and Lego Digital Designer 3.0.9 does not crash anymore during startup.
The use of LDD 3.0.9 is painful as it is very slow, but the I think that the problem is not coming from this patch ...
Please note that LDD 2.X is working perfectly in the same environment.
http://bugs.winehq.org/show_bug.cgi?id=18772
Esqui Hancock esquiskwerl@googlemail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |esquiskwerl@googlemail.com
--- Comment #20 from Esqui Hancock esquiskwerl@googlemail.com 2009-10-21 15:33:55 --- (In reply to comment #19)
I have patch wine-1.1.31 with the User32.PrintWindow, and Lego Digital Designer 3.0.9 does not crash anymore during startup.
The use of LDD 3.0.9 is painful as it is very slow, but the I think that the problem is not coming from this patch ...
Please note that LDD 2.X is working perfectly in the same environment.
It sounds like you have managed to actually use LDD 3.0.9, albeit slowly. I've patched the painting.c, user32.spec and winuser.h files as set out above, but am still getting the unimplemented PrintWindow error causing shutdown.
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #21 from Cedric Benharous cedric.benharous@free.fr 2009-10-25 07:10:39 --- (In reply to comment #20)
(In reply to comment #19)
I have patch wine-1.1.31 with the User32.PrintWindow, and Lego Digital Designer 3.0.9 does not crash anymore during startup.
The use of LDD 3.0.9 is painful as it is very slow, but the I think that the problem is not coming from this patch ...
Please note that LDD 2.X is working perfectly in the same environment.
It sounds like you have managed to actually use LDD 3.0.9, albeit slowly. I've patched the painting.c, user32.spec and winuser.h files as set out above, but am still getting the unimplemented PrintWindow error causing shutdown.
Hi,
Are you sure you applied the correct patch ? The one provided is patching those files: dlls/user32/painting.c dlls/user32/user32.spec and no winuser.h file.
Did you use the patch command for it ? You can check if the PrintWindow method is include into the library by doing this: strings /usr/lib/wine/user32.dll.so | grep PrintWindow
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #22 from Josselin Bardet namjos@gmail.com 2009-10-25 08:45:03 --- (In reply to comment #21)
The one provided is patching those files: dlls/user32/painting.c dlls/user32/user32.spec and no winuser.h file.
Hi,
The last patch I've sent include a light modification of winuser.h, for this: #define PW_CLIENTONLY 0x00000001
You can find it on the comment #17 : http://bugs.winehq.org/show_bug.cgi?id=18772#c17 (Patch can be found here : http://bugs2.winehq.org/attachment.cgi?id=21566 )
Otherwise I also agree with you, I think Esqui Hancock have not correctly applied the patch if Wine still complains about missing PrintWindow
By the way, nothing have happens since I've sent the patch on the dev mailing list. I don't know why the patch is not applied on the official wine releases
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #23 from Nikolay Sivov bunglehead@gmail.com 2009-10-25 08:59:52 --- (In reply to comment #22)
By the way, nothing have happens since I've sent the patch on the dev mailing list. I don't know why the patch is not applied on the official wine releases
Produce a minimal test for that. Check does source window get WM_PRINT, and what happens if window doesn't implement WM_PRINTCLIENT. This should be enough.
http://bugs.winehq.org/show_bug.cgi?id=18772
--- Comment #24 from Esqui Hancock esquiskwerl@googlemail.com 2009-10-26 07:45:05 --- Thank you, I had indeed patched it incorrectly.
Like Cedric Benharous, I now have Lego Digital Designer running, but freezing constantly
http://bugs.winehq.org/show_bug.cgi?id=18772
Luke Benstead kazade@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |kazade@gmail.com Resolution| |FIXED
--- Comment #25 from Luke Benstead kazade@gmail.com 2009-12-02 10:28:13 --- This is now fixed in GIT (see http://www.winehq.org/pipermail/wine-cvs/2009-December/062148.html)
http://bugs.winehq.org/show_bug.cgi?id=18772
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #26 from Alexandre Julliard julliard@winehq.org 2009-12-04 12:16:08 --- Closing bugs fixed in 1.1.34.
http://bugs.winehq.org/show_bug.cgi?id=18772
Josselin Bardet namjos@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #21555|0 |1 is obsolete| |
http://bugs.winehq.org/show_bug.cgi?id=18772
Josselin Bardet namjos@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #21556|0 |1 is obsolete| |