PATCH: almost ready with the conversion of HWND to a void*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

the attached patch is independent of the previous sent HWND4.diff and
should almost finish the conversion of HWND to a void*. There are still
some "warning: assignment makes pointer from integer without a cast" but
they occur between SERVER_START_REQ and SERVER_END_REQ and i didn't
figured out to what to cast the HWND's (that code is a little bit too
obfuscated for me). After fixing that we can change to
DECLARE_HANDLE(HWND).

License: LGPL, X11
Changelog:
	Michael Stefaniuc <mstefani@redhat.com>
	- almost finish the conversion of HWND to a void*

bye
	michael

-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
System Administration           Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani@redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart
? dlls/commdlg/cdlg_Ro.rc
Index: dlls/commdlg/cdlg.h
===================================================================
RCS file: /home/wine/wine/dlls/commdlg/cdlg.h,v
retrieving revision 1.21
diff -u -r1.21 cdlg.h
--- dlls/commdlg/cdlg.h	16 Aug 2002 23:26:22 -0000	1.21
+++ dlls/commdlg/cdlg.h	5 Sep 2002 23:07:51 -0000
@@ -24,6 +24,10 @@
 #include "dlgs.h"
 #include "wine/windef16.h"
 
+/* handle conversions */
+#define HWND_16(h32)		(LOWORD(h32))
+#define HWND_32(h16)		((HWND)(ULONG_PTR)(h16))
+
 /*---------------- 16-bit ----------------*/
 extern HINSTANCE16	COMMDLG_hInstance;
 extern HINSTANCE	COMMDLG_hInstance32;
Index: dlls/commdlg/colordlg.c
===================================================================
RCS file: /home/wine/wine/dlls/commdlg/colordlg.c,v
retrieving revision 1.33
diff -u -r1.33 colordlg.c
--- dlls/commdlg/colordlg.c	31 May 2002 23:25:45 -0000	1.33
+++ dlls/commdlg/colordlg.c	5 Sep 2002 23:07:52 -0000
@@ -845,8 +845,9 @@
            return FALSE;
        }
        ch32->lStructSize = sizeof(CHOOSECOLORW);
-       ch32->hwndOwner = ch16->hwndOwner;
-       ch32->hInstance = ch16->hInstance;
+       ch32->hwndOwner = HWND_32(ch16->hwndOwner);
+       /* Should be an HINSTANCE but MS made a typo */
+       ch32->hInstance = HWND_32(ch16->hInstance);
        ch32->lpCustColors = MapSL(ch16->lpCustColors);
        ch32->lpfnHook = (LPCCHOOKPROC) ch16->lpfnHook; /* only used as flag */
        ch32->Flags = ch16->Flags;
@@ -917,7 +918,8 @@
    if (CC_HookCallChk(lpp->lpcc))
    {
       if (b16)
-          res = CallWindowProc16( (WNDPROC16)lpp->lpcc16->lpfnHook, hDlg, WM_INITDIALOG, wParam, lParam);
+          res = CallWindowProc16( (WNDPROC16)lpp->lpcc16->lpfnHook,
+				  HWND_16(hDlg), WM_INITDIALOG, wParam, lParam);
       else
           res = CallWindowProcA( (WNDPROC)lpp->lpcc->lpfnHook, hDlg, WM_INITDIALOG, wParam, lParam);
    }
@@ -1054,8 +1056,9 @@
                    if (lpp->lpcc->hwndOwner)
 		       SendMessageA(lpp->lpcc->hwndOwner, i, 0, (LPARAM)lpp->lpcc16);
                    if ( CC_HookCallChk(lpp->lpcc))
-		       CallWindowProc16( (WNDPROC16) lpp->lpcc16->lpfnHook, hDlg,
-		          WM_COMMAND, psh15, (LPARAM)lpp->lpcc16);
+		       CallWindowProc16( (WNDPROC16) lpp->lpcc16->lpfnHook,
+					 HWND_16(hDlg), WM_COMMAND, psh15,
+					 (LPARAM)lpp->lpcc16);
                }
                else
                {
@@ -1299,10 +1302,12 @@
 /***********************************************************************
  *           ColorDlgProc   (COMMDLG.8)
  */
-LRESULT WINAPI ColorDlgProc16( HWND16 hDlg, UINT16 message,
+LRESULT WINAPI ColorDlgProc16( HWND16 hDlg16, UINT16 message,
                             WPARAM16 wParam, LONG lParam )
 {
  int res;
+ HWND hDlg = HWND_32(hDlg16);
+
  LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
  if (message != WM_INITDIALOG)
  {
@@ -1310,7 +1315,7 @@
      return FALSE;
   res=0;
   if (CC_HookCallChk(lpp->lpcc))
-     res = CallWindowProc16( (WNDPROC16)lpp->lpcc16->lpfnHook, hDlg, message, wParam, lParam);
+     res = CallWindowProc16( (WNDPROC16)lpp->lpcc16->lpfnHook, hDlg16, message, wParam, lParam);
   if (res)
      return res;
  }
@@ -1332,7 +1337,8 @@
 	                SetWindowLongA(hDlg, DWL_USER, 0L); /* we don't need it anymore */
 	                break;
 	  case WM_COMMAND:
-	                if (CC_WMCommand(hDlg, wParam, lParam, HIWORD(lParam), (HWND)LOWORD(lParam)))
+	                if (CC_WMCommand(hDlg, wParam, lParam,
+					 HIWORD(lParam), HWND_32(LOWORD(lParam))))
 	                   return TRUE;
 	                break;
 	  case WM_PAINT:
@@ -1432,7 +1438,7 @@
     }
 
     ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 8);
-    hInst = GetWindowLongA(lpChCol->hwndOwner, GWL_HINSTANCE);
+    hInst = GetWindowLongA(HWND_32(lpChCol->hwndOwner), GWL_HINSTANCE);
     bRet = DialogBoxIndirectParam16(hInst, hDlgTmpl16, lpChCol->hwndOwner,
                      (DLGPROC16) ptr, (DWORD)lpChCol);
     if (hResource16) FreeResource16(hDlgTmpl16);
Index: dlls/commdlg/filedlg.c
===================================================================
RCS file: /home/wine/wine/dlls/commdlg/filedlg.c,v
retrieving revision 1.51
diff -u -r1.51 filedlg.c
--- dlls/commdlg/filedlg.c	31 May 2002 23:25:45 -0000	1.51
+++ dlls/commdlg/filedlg.c	5 Sep 2002 23:07:52 -0000
@@ -297,7 +297,7 @@
     if (lfs->ofn16)
     {
         return (BOOL16) CallWindowProc16(
-          (WNDPROC16)lfs->ofn16->lpfnHook, lfs->hwnd,
+          (WNDPROC16)lfs->ofn16->lpfnHook, HWND_16(lfs->hwnd),
           (UINT16)wMsg, (WPARAM16)wParam, lParam);
     }
     if (lfs->ofnA)
@@ -1042,7 +1042,7 @@
     lpdis->itemID = lpdis16->itemID;
     lpdis->itemAction = lpdis16->itemAction;
     lpdis->itemState = lpdis16->itemState;
-    lpdis->hwndItem = lpdis16->hwndItem;
+    lpdis->hwndItem = HWND_32(lpdis16->hwndItem);
     lpdis->hDC = lpdis16->hDC;
     lpdis->rcItem.right = lpdis16->rcItem.right;
     lpdis->rcItem.left = lpdis16->rcItem.left;
@@ -1145,7 +1145,7 @@
     /* first convert to linear pointers */
     memset(&ofnA, 0, sizeof(OPENFILENAMEA));
     ofnA.lStructSize = sizeof(OPENFILENAMEA);
-    ofnA.hwndOwner = ofn16->hwndOwner;
+    ofnA.hwndOwner = HWND_32(ofn16->hwndOwner);
     ofnA.hInstance = ofn16->hInstance;
     if (ofn16->lpstrFilter)
         ofnA.lpstrFilter = MapSL(ofn16->lpstrFilter);
@@ -1343,9 +1343,10 @@
 /***********************************************************************
  *           FileOpenDlgProc   (COMMDLG.6)
  */
-LRESULT WINAPI FileOpenDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
+LRESULT WINAPI FileOpenDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam,
                                LPARAM lParam)
 {
+    HWND hWnd = HWND_32(hWnd16);
     LFSPRIVATE lfs = (LFSPRIVATE)GetPropA(hWnd,OFN_PROP);
     DRAWITEMSTRUCT dis;
 
@@ -1362,7 +1363,7 @@
         return FILEDLG_WMInitDialog(hWnd, wParam, lParam);
 
     case WM_MEASUREITEM:
-        return FILEDLG_WMMeasureItem16(hWnd, wParam, lParam);
+        return FILEDLG_WMMeasureItem16(hWnd16, wParam, lParam);
 
     case WM_DRAWITEM:
         FILEDLG_MapDrawItemStruct(MapSL(lParam), &dis);
@@ -1391,9 +1392,10 @@
 /***********************************************************************
  *           FileSaveDlgProc   (COMMDLG.7)
  */
-LRESULT WINAPI FileSaveDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
+LRESULT WINAPI FileSaveDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam,
                                LPARAM lParam)
 {
+ HWND hWnd = HWND_32(hWnd16);
  LFSPRIVATE lfs = (LFSPRIVATE)GetPropA(hWnd,OFN_PROP);
  DRAWITEMSTRUCT dis;
 
@@ -1410,7 +1412,7 @@
       return FILEDLG_WMInitDialog(hWnd, wParam, lParam);
 
    case WM_MEASUREITEM:
-      return FILEDLG_WMMeasureItem16(hWnd, wParam, lParam);
+      return FILEDLG_WMMeasureItem16(hWnd16, wParam, lParam);
 
    case WM_DRAWITEM:
       FILEDLG_MapDrawItemStruct(MapSL(lParam), &dis);
@@ -1515,7 +1517,7 @@
     lfs = FILEDLG_AllocPrivate((LPARAM) ofn, LFS16, OPEN_DIALOG);
     if (lfs)
     {
-        hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
+        hInst = GetWindowLongA( HWND_32(lpofn->hwndOwner), GWL_HINSTANCE );
         ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 6);
         bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner,
              (DLGPROC16) ptr, (DWORD) lfs);
@@ -1553,7 +1555,7 @@
     lfs = FILEDLG_AllocPrivate((LPARAM) ofn, LFS16, SAVE_DIALOG);
     if (lfs)
     {
-        hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
+        hInst = GetWindowLongA( HWND_32(lpofn->hwndOwner), GWL_HINSTANCE );
         ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 7);
         bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner,
              (DLGPROC16) ptr, (DWORD) lfs);
Index: dlls/commdlg/finddlg.c
===================================================================
RCS file: /home/wine/wine/dlls/commdlg/finddlg.c,v
retrieving revision 1.21
diff -u -r1.21 finddlg.c
--- dlls/commdlg/finddlg.c	31 May 2002 23:25:45 -0000	1.21
+++ dlls/commdlg/finddlg.c	5 Sep 2002 23:07:52 -0000
@@ -176,7 +176,7 @@
     lfr->find = TRUE;
     if (FINDDLG_Get16BitsTemplate(lfr))
     {
-        hInst = GetWindowLongA( lfr->fr16->hwndOwner , GWL_HINSTANCE);
+        hInst = GetWindowLongA( HWND_32(lfr->fr16->hwndOwner), GWL_HINSTANCE);
         ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 13);
         ret = CreateDialogIndirectParam16( hInst, lfr->template,
                     lfr->fr16->hwndOwner, (DLGPROC16) ptr, find);
@@ -206,7 +206,7 @@
     lfr->find = FALSE;
     if (FINDDLG_Get16BitsTemplate(lfr))
     {
-        hInst = GetWindowLongA( lfr->fr16->hwndOwner , GWL_HINSTANCE);
+        hInst = GetWindowLongA( HWND_32(lfr->fr16->hwndOwner), GWL_HINSTANCE);
         ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 14);
         ret = CreateDialogIndirectParam16( hInst, lfr->template,
                     lfr->fr16->hwndOwner, (DLGPROC16) ptr, find);
@@ -311,9 +311,10 @@
 /***********************************************************************
  *           FindTextDlgProc   (COMMDLG.13)
  */
-LRESULT WINAPI FindTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
+LRESULT WINAPI FindTextDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam,
                                  LPARAM lParam)
 {
+    HWND hWnd = HWND_32(hWnd16);
     LPFINDREPLACE16 lpfr;
     switch (wMsg) {
 	case WM_INITDIALOG:
@@ -322,7 +323,7 @@
 		MapSL(lpfr->lpstrFindWhat), FALSE);
 	case WM_COMMAND:
 	    lpfr=MapSL(GetWindowLongA(hWnd, DWL_USER));
-	    return FINDDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner,
+	    return FINDDLG_WMCommand(hWnd, wParam, HWND_32(lpfr->hwndOwner),
 		&lpfr->Flags, MapSL(lpfr->lpstrFindWhat),
 		lpfr->wFindWhatLen, FALSE);
     }
@@ -467,9 +468,10 @@
 /***********************************************************************
  *           ReplaceTextDlgProc   (COMMDLG.14)
  */
-LRESULT WINAPI ReplaceTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
+LRESULT WINAPI ReplaceTextDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam,
                                     LPARAM lParam)
 {
+    HWND hWnd = HWND_32(hWnd16);
     LPFINDREPLACE16 lpfr;
     switch (wMsg) {
 	case WM_INITDIALOG:
@@ -479,7 +481,7 @@
 		    MapSL(lpfr->lpstrReplaceWith), FALSE);
 	case WM_COMMAND:
 	    lpfr=MapSL(GetWindowLongA(hWnd, DWL_USER));
-	    return REPLACEDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner,
+	    return REPLACEDLG_WMCommand(hWnd, wParam, HWND_32(lpfr->hwndOwner),
 		    &lpfr->Flags, MapSL(lpfr->lpstrFindWhat),
 		    lpfr->wFindWhatLen, MapSL(lpfr->lpstrReplaceWith),
 		    lpfr->wReplaceWithLen, FALSE);
Index: dlls/commdlg/fontdlg.c
===================================================================
RCS file: /home/wine/wine/dlls/commdlg/fontdlg.c,v
retrieving revision 1.39
diff -u -r1.39 fontdlg.c
--- dlls/commdlg/fontdlg.c	10 Jul 2002 20:31:17 -0000	1.39
+++ dlls/commdlg/fontdlg.c	5 Sep 2002 23:07:53 -0000
@@ -70,7 +70,7 @@
 static void CFn_CHOOSEFONT16to32A(LPCHOOSEFONT16 chf16, LPCHOOSEFONTA chf32a)
 {
   chf32a->lStructSize=sizeof(CHOOSEFONTA);
-  chf32a->hwndOwner=chf16->hwndOwner;
+  chf32a->hwndOwner=HWND_32(chf16->hwndOwner);
   chf32a->hDC=chf16->hDC;
   chf32a->iPointSize=chf16->iPointSize;
   chf32a->Flags=chf16->Flags;
@@ -223,7 +223,7 @@
     lpChFont->lpTemplateName=(SEGPTR)&cf32a;
 
     ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 16);
-    hInst = GetWindowLongA(lpChFont->hwndOwner, GWL_HINSTANCE);
+    hInst = GetWindowLongA(HWND_32(lpChFont->hwndOwner), GWL_HINSTANCE);
     bRet = DialogBoxIndirectParam16(hInst, hDlgTmpl16, lpChFont->hwndOwner,
                      (DLGPROC16) ptr, (DWORD)lpChFont);
     if (hResource16) FreeResource16(hDlgTmpl16);
@@ -536,7 +536,7 @@
 INT16 WINAPI FontFamilyEnumProc16( SEGPTR logfont, SEGPTR metrics,
                                    UINT16 nFontType, LPARAM lParam )
 {
-  HWND16 hwnd=LOWORD(lParam);
+  HWND hwnd=HWND_32(LOWORD(lParam));
   HWND hDlg=GetParent(hwnd);
   LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
   LOGFONT16 *lplf = MapSL( logfont );
@@ -667,8 +667,8 @@
 INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics,
                                   UINT16 nFontType, LPARAM lParam )
 {
-  HWND16 hcmb2=LOWORD(lParam);
-  HWND16 hcmb3=HIWORD(lParam);
+  HWND hcmb2=HWND_32(LOWORD(lParam));
+  HWND hcmb3=HWND_32(HIWORD(lParam));
   HWND hDlg=GetParent(hcmb3);
   LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
   LOGFONT16 *lplf = MapSL(logfont);
@@ -782,7 +782,7 @@
       {
         SendDlgItemMessageA(hDlg, cmb1, CB_SETCURSEL, j, 0);
 	SendMessageA(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
-                       GetDlgItem(hDlg,cmb1));
+                     (LPARAM)GetDlgItem(hDlg,cmb1));
         init=1;
         /* look for fitting font style in combobox2 */
         l=MAKELONG(lpxx->lfWeight > FW_MEDIUM ? FW_BOLD:FW_NORMAL,lpxx->lfItalic !=0);
@@ -805,7 +805,7 @@
     {
       SendDlgItemMessageA(hDlg,cmb1,CB_SETCURSEL,0,0);
       SendMessageA(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
-                       GetDlgItem(hDlg,cmb1));
+                   (LPARAM)GetDlgItem(hDlg,cmb1));
     }
     if (lpcf->Flags & CF_USESTYLE && lpcf->lpszStyle)
     {
@@ -814,7 +814,7 @@
       {
         j=SendDlgItemMessageA(hDlg,cmb2,CB_SETCURSEL,j,0);
         SendMessageA(hDlg,WM_COMMAND,cmb2,
-                       MAKELONG(GetDlgItem(hDlg,cmb2),CBN_SELCHANGE));
+                       MAKELONG(HWND_16(GetDlgItem(hDlg,cmb2)),CBN_SELCHANGE));
       }
     }
   }
@@ -957,7 +957,7 @@
                              LPCHOOSEFONTA lpcf)
 {
   if (lpcf->Flags & CF_EFFECTS)
-   if (GetDlgCtrlID(lParam)==stc6)
+   if (GetDlgCtrlID(HWND_32(LOWORD(lParam)))==stc6)
    {
      SetTextColor((HDC)wParam, lpcf->rgbColors);
      return GetStockObject(WHITE_BRUSH);
@@ -1118,9 +1118,10 @@
                     2. some CF_.. flags are not supported
                     3. some TType extensions
  */
-LRESULT WINAPI FormatCharDlgProc16(HWND16 hDlg, UINT16 message, WPARAM16 wParam,
-                                   LPARAM lParam)
+LRESULT WINAPI FormatCharDlgProc16(HWND16 hDlg16, UINT16 message,
+				   WPARAM16 wParam, LPARAM lParam)
 {
+  HWND hDlg = HWND_32(hDlg16);
   LPCHOOSEFONT16 lpcf;
   LPCHOOSEFONTA lpcf32a;
   LRESULT res=0;
@@ -1130,7 +1131,7 @@
    if (!lpcf)
       return FALSE;
    if (CFn_HookCallChk(lpcf))
-     res=CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg,message,wParam,lParam);
+     res=CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg16,message,wParam,lParam);
    if (res)
     return res;
   }
@@ -1144,7 +1145,7 @@
       return FALSE;
     }
     if (CFn_HookCallChk(lpcf))
-      return CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
+      return CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg16,WM_INITDIALOG,wParam,lParam);
   }
   lpcf32a=(LPCHOOSEFONTA)lpcf->lpTemplateName;
   switch (message)
@@ -1173,7 +1174,7 @@
             dis.itemID     = dis16->itemID;
             dis.itemAction = dis16->itemAction;
             dis.itemState  = dis16->itemState;
-            dis.hwndItem   = dis16->hwndItem;
+            dis.hwndItem   = HWND_32(dis16->hwndItem);
             dis.hDC        = dis16->hDC;
             dis.itemData   = dis16->itemData;
             CONV_RECT16TO32( &dis16->rcItem, &dis.rcItem );
@@ -1182,7 +1183,7 @@
         break;
     case WM_CTLCOLOR:
         if (HIWORD(lParam) == CTLCOLOR_STATIC)
-            res=CFn_WMCtlColorStatic(hDlg, (HDC)wParam, (HWND)LOWORD(lParam), lpcf32a);
+            res=CFn_WMCtlColorStatic(hDlg, (HDC)wParam, LOWORD(lParam), lpcf32a);
         break;
     case WM_COMMAND:
         res=CFn_WMCommand(hDlg, MAKEWPARAM( wParam, HIWORD(lParam) ), LOWORD(lParam), lpcf32a);
Index: dlls/commdlg/printdlg.c
===================================================================
RCS file: /home/wine/wine/dlls/commdlg/printdlg.c,v
retrieving revision 1.53
diff -u -r1.53 printdlg.c
--- dlls/commdlg/printdlg.c	13 Jun 2002 21:41:08 -0000	1.53
+++ dlls/commdlg/printdlg.c	5 Sep 2002 23:07:54 -0000
@@ -1726,7 +1726,7 @@
 
 	    memcpy(&pdlg,PrintStructures->dlg.lpPrintDlg16,sizeof(pdlg));
 	    pdlg.Flags |= PD_PRINTSETUP;
-	    pdlg.hwndOwner = hDlg;
+	    pdlg.hwndOwner = HWND_16(hDlg);
 	    if (!PrintDlg16(&pdlg))
 		break;
 	}
@@ -2660,7 +2660,7 @@
 ) {
     BOOL      bRet = FALSE;
     LPVOID   ptr;
-    HINSTANCE hInst = GetWindowLongA( lppd->hwndOwner, GWL_HINSTANCE );
+    HINSTANCE hInst = GetWindowLongA( HWND_32(lppd->hwndOwner), GWL_HINSTANCE );
 
     if(TRACE_ON(commdlg)) {
         char flagstr[1000] = "";
@@ -2743,7 +2743,9 @@
 	PrintStructures->dlg.lpPrintDlg = (LPPRINTDLGA)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(PRINTDLGA));
 #define CVAL(x)	PrintStructures->dlg.lpPrintDlg->x = lppd->x;
 #define MVAL(x)	PrintStructures->dlg.lpPrintDlg->x = MapSL(lppd->x);
-	CVAL(Flags);CVAL(hwndOwner);CVAL(hDC);
+	CVAL(Flags);
+	PrintStructures->dlg.lpPrintDlg->hwndOwner = HWND_32(lppd->hwndOwner);
+	CVAL(hDC);
 	CVAL(nFromPage);CVAL(nToPage);CVAL(nMinPage);CVAL(nMaxPage);
 	CVAL(nCopies);CVAL(hInstance);CVAL(lCustData);
 	MVAL(lpPrintTemplateName);MVAL(lpSetupTemplateName);
@@ -3459,9 +3461,10 @@
 /***********************************************************************
  *           PrintDlgProc   (COMMDLG.21)
  */
-LRESULT WINAPI PrintDlgProc16(HWND16 hDlg, UINT16 uMsg, WPARAM16 wParam,
+LRESULT WINAPI PrintDlgProc16(HWND16 hDlg16, UINT16 uMsg, WPARAM16 wParam,
                             LPARAM lParam)
 {
+    HWND hDlg = HWND_32(hDlg16);
     PRINT_PTRA* PrintStructures;
     LRESULT res=FALSE;
 
@@ -3477,7 +3480,7 @@
 	if(PrintStructures->dlg.lpPrintDlg16->Flags & PD_ENABLEPRINTHOOK) {
 	    res = CallWindowProc16(
 		(WNDPROC16)PrintStructures->dlg.lpPrintDlg16->lpfnPrintHook,
-		hDlg, uMsg, wParam, (LPARAM)PrintStructures->dlg.lpPrintDlg16
+		hDlg16, uMsg, wParam, (LPARAM)PrintStructures->dlg.lpPrintDlg16
 	    );
 	}
 	return res;
@@ -3486,7 +3489,7 @@
     if(PrintStructures->dlg.lpPrintDlg16->Flags & PD_ENABLEPRINTHOOK) {
         res = CallWindowProc16(
 		(WNDPROC16)PrintStructures->dlg.lpPrintDlg16->lpfnPrintHook,
-		hDlg,uMsg, wParam, lParam
+		hDlg16,uMsg, wParam, lParam
 	);
 	if(LOWORD(res)) return res;
     }
@@ -3517,9 +3520,10 @@
 /***********************************************************************
  *           PrintSetupDlgProc   (COMMDLG.22)
  */
-LRESULT WINAPI PrintSetupDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
+LRESULT WINAPI PrintSetupDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam,
 				   LPARAM lParam)
 {
+  HWND hWnd = HWND_32(hWnd16);
   switch (wMsg)
     {
     case WM_INITDIALOG:
Index: dlls/wineps/driver.c
===================================================================
RCS file: /home/wine/wine/dlls/wineps/driver.c,v
retrieving revision 1.13
diff -u -r1.13 driver.c
--- dlls/wineps/driver.c	24 Jun 2002 23:44:18 -0000	1.13
+++ dlls/wineps/driver.c	5 Sep 2002 23:07:54 -0000
@@ -32,6 +32,8 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
 
+#define HWND_16(h32)		(LOWORD(h32))
+#define HWND_32(h16)		((HWND)(ULONG_PTR)(h16))
 
 /************************************************************************
  *
@@ -325,7 +327,7 @@
     psh.dwSize = sizeof(psh);
     psh.pszCaption = SetupW;
     psh.nPages = 1;
-    psh.hwndParent = hwnd;
+    psh.hwndParent = HWND_32(hwnd);
     psh.u3.phpage = hpsp;
 
     pPropertySheet(&psh);
@@ -351,8 +353,8 @@
 			LPSTR lpszDevice, LPSTR lpszPort, LPDEVMODEA lpdmInput,
 			LPSTR lpszProfile, DWORD dwMode)
 {
-    return PSDRV_ExtDeviceMode16(hwnd, 0, lpdmOutput, lpszDevice, lpszPort,
-				 lpdmInput, lpszProfile, dwMode);
+    return PSDRV_ExtDeviceMode16(HWND_16(hwnd), 0, lpdmOutput, lpszDevice,
+				 lpszPort, lpdmInput, lpszProfile, dwMode);
 }
 
 /***********************************************************************
Index: dlls/winsock/async.c
===================================================================
RCS file: /home/wine/wine/dlls/winsock/async.c,v
retrieving revision 1.25
diff -u -r1.25 async.c
--- dlls/winsock/async.c	17 Aug 2002 00:43:18 -0000	1.25
+++ dlls/winsock/async.c	5 Sep 2002 23:07:54 -0000
@@ -485,7 +485,7 @@
 		}
 		break;
 	}
-	PostMessageA(aq->hWnd,aq->uMsg,aq->async_handle,size|(fail<<16));
+	PostMessageA(HWND_32(aq->hWnd),aq->uMsg,aq->async_handle,size|(fail<<16));
 	HeapFree(GetProcessHeap(),0,arg);
 	return 0;
 }
@@ -540,7 +540,7 @@
 	case AQ_DUPLOWPTR2: pfm = ptr2; ptr2 = pto; do *pto++ = tolower(*pfm); while (*pfm++);	break;
 	}
 
-	aq->hWnd	= hWnd;
+	aq->hWnd	= HWND_16(hWnd);
 	aq->uMsg	= uMsg;
 	aq->int1	= int1;
 	aq->ptr1	= ptr1;
@@ -567,7 +567,8 @@
 {
 	TRACE("hwnd %04x, msg %04x, addr %08x[%i]\n",
 	       hWnd, uMsg, (unsigned)addr , len );
-	return __WSAsyncDBQuery(hWnd,uMsg,len,addr,type,NULL,(void*)sbuf,buflen,
+	return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,len,addr,type,NULL,
+				(void*)sbuf,buflen,
 				AQ_NUMBER|AQ_COPYPTR1|AQ_WIN16|AQ_GETHOST);
 }
 
@@ -591,7 +592,8 @@
 {
 	TRACE("hwnd %04x, msg %04x, host %s, buffer %i\n",
 	      hWnd, uMsg, (name)?name:"<null>", (int)buflen );
-	return __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,(void*)sbuf,buflen,
+	return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,0,name,0,NULL,
+				(void*)sbuf,buflen,
 				AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN16|AQ_GETHOST);
 }
 
@@ -602,7 +604,7 @@
 					LPSTR sbuf, INT buflen)
 {
 	TRACE("hwnd %04x, msg %08x, host %s, buffer %i\n",
-	       (HWND16)hWnd, uMsg, (name)?name:"<null>", (int)buflen );
+	       hWnd, uMsg, (name)?name:"<null>", (int)buflen );
 	return __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,sbuf,buflen,
 				AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN32|AQ_GETHOST);
 }
@@ -614,8 +616,9 @@
                                          SEGPTR sbuf, INT16 buflen)
 {
 	TRACE("hwnd %04x, msg %08x, protocol %s\n",
-	       (HWND16)hWnd, uMsg, (name)?name:"<null>" );
-	return __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,(void*)sbuf,buflen,
+	       hWnd, uMsg, (name)?name:"<null>" );
+	return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,0,name,0,NULL,
+				(void*)sbuf,buflen,
 				AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN16|AQ_GETPROTO);
 }
 
@@ -626,7 +629,7 @@
                                          LPSTR sbuf, INT buflen)
 {
 	TRACE("hwnd %04x, msg %08x, protocol %s\n",
-	       (HWND16)hWnd, uMsg, (name)?name:"<null>" );
+	       hWnd, uMsg, (name)?name:"<null>" );
 	return __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,sbuf,buflen,
 				AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN32|AQ_GETPROTO);
 }
@@ -639,7 +642,8 @@
                                            SEGPTR sbuf, INT16 buflen)
 {
 	TRACE("hwnd %04x, msg %04x, num %i\n", hWnd, uMsg, number );
-	return __WSAsyncDBQuery(hWnd,uMsg,number,NULL,0,NULL,(void*)sbuf,buflen,
+	return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,number,NULL,0,NULL,
+				(void*)sbuf,buflen,
 				AQ_GETPROTO|AQ_NUMBER|AQ_WIN16);
 }
 
@@ -662,7 +666,8 @@
 {
 	TRACE("hwnd %04x, msg %04x, name %s, proto %s\n",
 	       hWnd, uMsg, (name)?name:"<null>", (proto)?proto:"<null>");
-	return __WSAsyncDBQuery(hWnd,uMsg,0,name,0,proto,(void*)sbuf,buflen,
+	return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,0,name,0,proto,
+				(void*)sbuf,buflen,
 				AQ_GETSERV|AQ_NAME|AQ_DUPLOWPTR1|AQ_DUPLOWPTR2|AQ_WIN16);
 }
 
@@ -686,7 +691,8 @@
 {
 	TRACE("hwnd %04x, msg %04x, port %i, proto %s\n",
 	       hWnd, uMsg, port, (proto)?proto:"<null>" );
-	return __WSAsyncDBQuery(hWnd,uMsg,port,NULL,0,proto,(void*)sbuf,buflen,
+	return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,port,NULL,0,proto,
+				(void*)sbuf,buflen,
 				AQ_GETSERV|AQ_NUMBER|AQ_DUPLOWPTR2|AQ_WIN16);
 }
 
Index: dlls/winsock/socket.c
===================================================================
RCS file: /home/wine/wine/dlls/winsock/socket.c,v
retrieving revision 1.102
diff -u -r1.102 socket.c
--- dlls/winsock/socket.c	29 Aug 2002 01:48:55 -0000	1.102
+++ dlls/winsock/socket.c	5 Sep 2002 23:07:56 -0000
@@ -3308,7 +3308,7 @@
  */
 INT16 WINAPI WSAAsyncSelect16(SOCKET16 s, HWND16 hWnd, UINT16 wMsg, LONG lEvent)
 {
-    return (INT16)WSAAsyncSelect( s, hWnd, wMsg, lEvent );
+    return (INT16)WSAAsyncSelect( s, HWND_32(hWnd), wMsg, lEvent );
 }
 
 /***********************************************************************
Index: include/wine/winsock16.h
===================================================================
RCS file: /home/wine/wine/include/wine/winsock16.h,v
retrieving revision 1.5
diff -u -r1.5 winsock16.h
--- include/wine/winsock16.h	10 Mar 2002 00:02:38 -0000	1.5
+++ include/wine/winsock16.h	5 Sep 2002 23:07:56 -0000
@@ -105,4 +105,7 @@
 INT16     WINAPI WSAAsyncSelect16(SOCKET16 s, HWND16 hWnd, UINT16 wMsg, LONG lEvent);
 INT16     WINAPI WSARecvEx16(SOCKET16 s, char *buf, INT16 len, INT16 *flags);
 
+#define HWND_16(h32)		(LOWORD(h32))
+#define HWND_32(h16)		((HWND)(ULONG_PTR)(h16))
+
 #endif /* __WINE_WINE_WINSOCK16_H */

Attachment: pgp00047.pgp
Description: PGP signature


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux