Re: PATCH: Convert HDRVR to a void*

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

 



On Tue, Aug 06, 2002 at 06:42:01PM -0700, Alexandre Julliard wrote:
> 5) duplicate the HDRVR_16 macro into msvideo.
> 
> This should be a rare problem since in general 16-bit functions are
> not exported across dlls, so duplicating the macro shouldn't really be
> a problem. And we can always change it later if it turns out that we
> have a lot of duplicated stuff.
Done, see attached patch.

License: LGPL, X11
Changelog:
    Michael Stefaniuc <mstefani@redhat.com>
    - Convert HDRVR to a void*
    - Fix declaration of DriverCallback()

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
Index: dlls/msacm/driver.c
===================================================================
RCS file: /home/wine/wine/dlls/msacm/driver.c,v
retrieving revision 1.19
diff -u -r1.19 driver.c
--- dlls/msacm/driver.c	24 Jul 2002 19:02:50 -0000	1.19
+++ dlls/msacm/driver.c	7 Aug 2002 21:34:07 -0000
@@ -271,7 +271,7 @@
     pad->obj.dwType = WINE_ACMOBJ_DRIVER;
     pad->obj.pACMDriverID = padid;
 
-    if (!(pad->hDrvr = padid->hInstModule))
+    if (!(pad->hDrvr = (HDRVR)padid->hInstModule))
     {
         ACMDRVOPENDESCW	adod;
         int		len;
Index: dlls/msvideo/msvideo_main.c
===================================================================
RCS file: /home/wine/wine/dlls/msvideo/msvideo_main.c,v
retrieving revision 1.34
diff -u -r1.34 msvideo_main.c
--- dlls/msvideo/msvideo_main.c	31 May 2002 23:25:49 -0000	1.34
+++ dlls/msvideo/msvideo_main.c	7 Aug 2002 21:34:07 -0000
@@ -46,6 +46,9 @@
 void MSVIDEO_UnmapMsg16To32(UINT msg, LPVOID lpv, LPDWORD lParam1, LPDWORD lParam2);
 LRESULT MSVIDEO_SendMessage(HIC hic, UINT msg, DWORD lParam1, DWORD lParam2, BOOL bFrom32);
 
+#define HDRVR_16(h32)		(LOWORD(h32))
+
+
 /***********************************************************************
  *		VideoForWindowsVersion		[MSVFW32.2]
  *		VideoForWindowsVersion		[MSVIDEO.2]
@@ -268,7 +271,7 @@
 	MSVIDEO_SendMessage(hic,DRV_ENABLE,0L,0L,bFrom32);
 
         seg_icopen = MapLS( &icopen );
-        whic->hdrv = MSVIDEO_SendMessage(hic,DRV_OPEN,0,seg_icopen,FALSE);
+        whic->hdrv = (HDRVR)MSVIDEO_SendMessage(hic,DRV_OPEN,0,seg_icopen,FALSE);
         UnMapLS( seg_icopen );
 	if (whic->hdrv == 0) {
 		WARN("DRV_OPEN failed for hic 0x%08lx\n",(DWORD)hic);
@@ -976,7 +979,7 @@
 		if (bDrv32) {
 			ret = whic->driverproc(whic->hdrv,hic,msg,lParam1,lParam2);
 		} else {
-			ret = MSVIDEO_CallTo16_long_lwwll((FARPROC16)whic->driverproc,whic->hdrv,hic,msg,lParam1,lParam2);
+			ret = MSVIDEO_CallTo16_long_lwwll((FARPROC16)whic->driverproc,HDRVR_16(whic->hdrv),hic,msg,lParam1,lParam2);
 		}
 	} else {
 		ret = SendDriverMessage(whic->hdrv,msg,lParam1,lParam2);
Index: dlls/winmm/driver.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/driver.c,v
retrieving revision 1.16
diff -u -r1.16 driver.c
--- dlls/winmm/driver.c	31 May 2002 23:40:56 -0000	1.16
+++ dlls/winmm/driver.c	7 Aug 2002 21:34:08 -0000
@@ -458,7 +458,7 @@
 	TRACE("Failed to open driver %s from system.ini file, section %s\n", debugstr_a(lpDriverName), debugstr_a(lpSectionName));
  the_end:
     if (lpDrv)	TRACE("=> %08lx\n", (DWORD)lpDrv);
-    return (DWORD)lpDrv;
+    return (HDRVR)lpDrv;
 }
 
 /**************************************************************************
Index: dlls/winmm/joystick.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/joystick.c,v
retrieving revision 1.18
diff -u -r1.18 joystick.c
--- dlls/winmm/joystick.c	31 May 2002 23:40:56 -0000	1.18
+++ dlls/winmm/joystick.c	7 Aug 2002 21:34:08 -0000
@@ -70,7 +70,8 @@
     if (JOY_Sticks[dwJoyID].hDriver)
 	return TRUE;
 
-    return JOY_Sticks[dwJoyID].hDriver = OpenDriverA("joystick.drv", 0, dwJoyID);
+    JOY_Sticks[dwJoyID].hDriver = OpenDriverA("joystick.drv", 0, dwJoyID);
+    return (BOOL) JOY_Sticks[dwJoyID].hDriver;
 }
 
 /**************************************************************************
Index: dlls/winmm/lolvldrv.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/lolvldrv.c,v
retrieving revision 1.31
diff -u -r1.31 lolvldrv.c
--- dlls/winmm/lolvldrv.c	2 Aug 2002 19:02:49 -0000	1.31
+++ dlls/winmm/lolvldrv.c	7 Aug 2002 21:34:09 -0000
@@ -198,7 +198,7 @@
     if (!mld->bFrom32 && (mld->dwFlags & DCB_TYPEMASK) == DCB_FUNCTION) {
 	/* 16 bit func, call it */
 	TRACE("Function (16 bit) !\n");
-	MMDRV_CallTo16_word_wwlll((FARPROC16)mld->dwCallback, hDev, uMsg,
+	MMDRV_CallTo16_word_wwlll((FARPROC16)mld->dwCallback, HDRVR_16(hDev), uMsg,
 				  mld->dwClientInstance, dwParam1, dwParam2);
     } else {
 	DriverCallback(mld->dwCallback, mld->dwFlags, hDev, uMsg,
Index: dlls/winmm/mmsystem.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/mmsystem.c,v
retrieving revision 1.66
diff -u -r1.66 mmsystem.c
--- dlls/winmm/mmsystem.c	3 Aug 2002 00:14:43 -0000	1.66
+++ dlls/winmm/mmsystem.c	7 Aug 2002 21:34:11 -0000
@@ -755,11 +755,11 @@
 	break;
     case DCB_WINDOW:
 	TRACE("Window(%04lX) handle=%04X!\n", dwCallBack, hDev);
-	PostMessageA((HWND)dwCallBack, wMsg, hDev, dwParam1);
+	PostMessageA((HWND)dwCallBack, wMsg, (WPARAM)hDev, dwParam1);
 	break;
     case DCB_TASK: /* aka DCB_THREAD */
 	TRACE("Task(%04lx) !\n", dwCallBack);
-	PostThreadMessageA(dwCallBack, wMsg, hDev, dwParam1);
+	PostThreadMessageA(dwCallBack, wMsg, (WPARAM)hDev, dwParam1);
 	break;
     case DCB_FUNCTION:
 	TRACE("Function (32 bit) !\n");
@@ -804,7 +804,7 @@
 			       WORD wMsg, DWORD dwUser, DWORD dwParam1,
 			       DWORD dwParam2)
 {
-    return DriverCallback(dwCallBack, uFlags, hDev, wMsg, dwUser, dwParam1, dwParam2);
+    return DriverCallback(dwCallBack, uFlags, HDRVR_32(hDev), wMsg, dwUser, dwParam1, dwParam2);
 }
 
 /**************************************************************************
@@ -3158,8 +3158,9 @@
 	    lpMidiHdr->dwFlags |= MHDR_DONE;
 	    lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
 
-	    DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice,
-			   MM_MOM_DONE, lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
+	    DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
+			   (HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
+			   lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
 	}
 	lpMidiStrm->lpMidiHdr = 0;
 	SetEvent(lpMidiStrm->hEvent);
@@ -3231,8 +3232,9 @@
 	    lpMidiHdr->dwFlags |= MHDR_DONE;
 	    lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
 
-	    DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice,
-			   MM_MOM_DONE, lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
+	    DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
+			   (HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
+			   lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
 	    break;
 	}
 
@@ -3352,8 +3354,9 @@
 	    break;
 	}
 	if (me->dwEvent & MEVT_F_CALLBACK) {
-	    DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice,
-			   MM_MOM_POSITIONCB, lpwm->mod.dwInstance, (LPARAM)lpMidiHdr, 0L);
+	    DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
+			   (HDRVR)lpMidiStrm->hDevice, MM_MOM_POSITIONCB,
+			   lpwm->mod.dwInstance, (LPARAM)lpMidiHdr, 0L);
 	}
 	lpMidiHdr->dwOffset += sizeof(MIDIEVENT) - sizeof(me->dwParms);
 	if (me->dwEvent & MEVT_F_LONG)
@@ -3364,8 +3367,9 @@
 	    lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
 
 	    lpMidiStrm->lpMidiHdr = (LPMIDIHDR)lpMidiHdr->lpNext;
-	    DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice,
-			   MM_MOM_DONE, lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
+	    DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
+			   (HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
+			   lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
 	    lpData = 0;
 	}
     }
Index: dlls/winmm/winemm.h
===================================================================
RCS file: /home/wine/wine/dlls/winmm/winemm.h,v
retrieving revision 1.18
diff -u -r1.18 winemm.h
--- dlls/winmm/winemm.h	3 Aug 2002 00:14:44 -0000	1.18
+++ dlls/winmm/winemm.h	7 Aug 2002 21:34:11 -0000
@@ -228,6 +228,7 @@
 void				TIME_MMTimeStop(void);
 
 /* HANDLE16 -> HANDLE conversions */
+#define HDRVR_32(h16)		((HDRVR)(ULONG_PTR)(h16))
 #define HMIDI_32(h16)		((HMIDI)(ULONG_PTR)(h16))
 #define HMIDIIN_32(h16)		((HMIDIIN)(ULONG_PTR)(h16))
 #define HMIDIOUT_32(h16)	((HMIDIOUT)(ULONG_PTR)(h16))
@@ -239,6 +240,7 @@
 #define HWAVEOUT_32(h16)	((HWAVEOUT)(ULONG_PTR)(h16))
 
 /* HANDLE -> HANDLE16 conversions */
+#define HDRVR_16(h32)		(LOWORD(h32))
 #define HMIDI_16(h32)		(LOWORD(h32))
 #define HMIDIIN_16(h32)		(LOWORD(h32))
 #define HMIDIOUT_16(h32)	(LOWORD(h32))
Index: dlls/winmm/wavemap/wavemap.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/wavemap/wavemap.c,v
retrieving revision 1.20
diff -u -r1.20 wavemap.c
--- dlls/winmm/wavemap/wavemap.c	19 Jul 2002 00:30:16 -0000	1.20
+++ dlls/winmm/wavemap/wavemap.c	7 Aug 2002 21:34:11 -0000
@@ -94,8 +94,8 @@
 	ERR("Unknown msg %u\n", uMsg);
     }
 
-    DriverCallback(wom->dwCallback, HIWORD(wom->dwFlags), wom->hOuterWave, uMsg,
-		   wom->dwClientInstance, dwParam1, dwParam2);
+    DriverCallback(wom->dwCallback, HIWORD(wom->dwFlags), (HDRVR)wom->hOuterWave,
+		   uMsg, wom->dwClientInstance, dwParam1, dwParam2);
 }
 
 static	DWORD	wodOpenHelper(WAVEMAPDATA* wom, UINT idx,
@@ -502,8 +502,8 @@
 	ERR("Unknown msg %u\n", uMsg);
     }
 
-    DriverCallback(wim->dwCallback, HIWORD(wim->dwFlags), wim->hOuterWave, uMsg,
-		   wim->dwClientInstance, dwParam1, dwParam2);
+    DriverCallback(wim->dwCallback, HIWORD(wim->dwFlags), (HDRVR)wim->hOuterWave,
+		   uMsg, wim->dwClientInstance, dwParam1, dwParam2);
 }
 
 static	DWORD	widOpenHelper(WAVEMAPDATA* wim, UINT idx,
Index: dlls/winmm/wineoss/audio.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/wineoss/audio.c,v
retrieving revision 1.58
diff -u -r1.58 audio.c
--- dlls/winmm/wineoss/audio.c	28 Jun 2002 17:31:31 -0000	1.58
+++ dlls/winmm/wineoss/audio.c	7 Aug 2002 21:34:13 -0000
@@ -702,8 +702,9 @@
     case WOM_CLOSE:
     case WOM_DONE:
 	if (wwo->wFlags != DCB_NULL &&
-	    !DriverCallback(wwo->waveDesc.dwCallback, wwo->wFlags, wwo->waveDesc.hWave,
-			    wMsg, wwo->waveDesc.dwInstance, dwParam1, dwParam2)) {
+	    !DriverCallback(wwo->waveDesc.dwCallback, wwo->wFlags,
+			    (HDRVR)wwo->waveDesc.hWave, wMsg,
+			    wwo->waveDesc.dwInstance, dwParam1, dwParam2)) {
 	    WARN("can't notify client !\n");
 	    return MMSYSERR_ERROR;
 	}
@@ -2079,8 +2080,9 @@
     case WIM_CLOSE:
     case WIM_DATA:
 	if (wwi->wFlags != DCB_NULL &&
-	    !DriverCallback(wwi->waveDesc.dwCallback, wwi->wFlags, wwi->waveDesc.hWave,
-			    wMsg, wwi->waveDesc.dwInstance, dwParam1, dwParam2)) {
+	    !DriverCallback(wwi->waveDesc.dwCallback, wwi->wFlags,
+			    (HDRVR)wwi->waveDesc.hWave, wMsg,
+			    wwi->waveDesc.dwInstance, dwParam1, dwParam2)) {
 	    WARN("can't notify client !\n");
 	    return MMSYSERR_ERROR;
 	}
Index: include/mmddk.h
===================================================================
RCS file: /home/wine/wine/include/mmddk.h,v
retrieving revision 1.10
diff -u -r1.10 mmddk.h
--- include/mmddk.h	31 May 2002 23:06:48 -0000	1.10
+++ include/mmddk.h	7 Aug 2002 21:34:13 -0000
@@ -515,7 +515,7 @@
 
 BOOL16			WINAPI	DriverCallback16(DWORD dwCallBack, UINT16 uFlags, HANDLE16 hDev,
 						 WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
-BOOL		 	WINAPI	DriverCallback(DWORD dwCallBack, UINT uFlags, HANDLE hDev,
+BOOL		 	WINAPI	DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev,
 					       UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
 
 #include "poppack.h"
Index: include/mmsystem.h
===================================================================
RCS file: /home/wine/wine/include/mmsystem.h,v
retrieving revision 1.54
diff -u -r1.54 mmsystem.h
--- include/mmsystem.h	3 Aug 2002 00:14:44 -0000	1.54
+++ include/mmsystem.h	7 Aug 2002 21:34:14 -0000
@@ -30,7 +30,7 @@
 typedef LPSTR		HPSTR;          /* a huge version of LPSTR */
 typedef LPCSTR		HPCSTR;         /* a huge version of LPCSTR */
 
-DECLARE_OLD_HANDLE(HDRVR);
+DECLARE_HANDLE(HDRVR);
 DECLARE_HANDLE(HWAVE);
 DECLARE_HANDLE(HWAVEIN);
 DECLARE_HANDLE(HWAVEOUT);

Attachment: pgp00030.pgp
Description: PGP signature


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

  Powered by Linux