winpos.c & module.c - minor ms-windows compatibility
Boaz Harrosh
boaz at hishome.net
Mon Mar 22 09:59:01 CST 2004
winpos.c:
On ms-windows a window would not Maximize if it didn't have the
WS_MAXIMIZEBOX style, or minimize with out the WS_MINIMIZEBOX style.
Even if an explicitly called to ShowWindow with these parameters
(commands). I have tried a couple of different approachs but only
converting the call command this way gives me the exact ms-windows
behavior. Ignoring the calls will not display the window right. (SW_RESTORE)
module.c
GetProcAdress will not "Fly" on a NULL module. It will Just return
with Error set to ERROR_PROC_NOT_FOUND (127).
Actually, I did a little check, On ms-windows any garbage HMODULE will
Just Return an error. Is there a ValidPointer/magic_number check we can
do before we "fly" here.
Index: dlls/kernel/module.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/module.c,v
retrieving revision 1.4
diff -u -r1.4 module.c
--- dlls/kernel/module.c 27 Feb 2004 21:32:55 -0000 1.4
+++ dlls/kernel/module.c 22 Mar 2004 14:28:40 -0000
@@ -834,6 +834,9 @@
NTSTATUS nts;
FARPROC fp;
+ if( !hModule ){
+ SetLastError(ERROR_PROC_NOT_FOUND) ;
+ return NULL ;
+ }
+
if (HIWORD(function))
{
ANSI_STRING str;
Index: dlls/x11drv/winpos.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/winpos.c,v
retrieving revision 1.76
diff -u -r1.76 winpos.c
--- dlls/x11drv/winpos.c 11 Mar 2004 03:51:46 -0000 1.76
+++ dlls/x11drv/winpos.c 22 Mar 2004 14:28:44 -0000
@@ -1265,6 +1265,19 @@
TRACE("hwnd=%p, cmd=%d\n", hwnd, cmd);
+ switch(cmd)
+ {
+ case SW_SHOWMINIMIZED:
+ case SW_MINIMIZE:
+ if( !(wndPtr->dwStyle & WS_MINIMIZEBOX) )
+ cmd = SW_RESTORE;
+ break ;
+ case SW_SHOWMAXIMIZED: /*case SW_MAXIMIZE:*/
+ if( !(wndPtr->dwStyle & WS_MAXIMIZEBOX) )
+ cmd = SW_RESTORE;
+ break ;
+ }
+
wasVisible = (wndPtr->dwStyle & WS_VISIBLE) != 0;
switch(cmd)
ANSI_STRING str;
More information about the wine-patches
mailing list