comctl32 / msvfw32 dependencies

eric pouech eric.pouech at wanadoo.fr
Sat Aug 18 10:34:19 CDT 2001


removed comctl32 dependencies on msvfw32 (needed by the animate
control), and
replaced them by hand made callouts to msvfw32. this is needed as
current
Wine build scheme doesn't handle circular dep:s

the next patch will introduce a depency from msvfw32 to comctl32 (hence 
explaining the need for this one)

A+
-- 
---------------
Eric Pouech (http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", Vice President Dan Quayle
-------------- next part --------------
Name: ctl_msvfw
ChangeLog: because of circular dependencies between comctl32 and msvfw32, replace in comctl32 delay loading of msvfw32 by manual loading
GenDate: 2001/08/18 15:24:00 UTC
ModifiedFiles: dlls/comctl32/animate.c dlls/comctl32/comctl32.spec dlls/Makefile.in
AddedFiles: 
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/dlls/comctl32/animate.c,v
retrieving revision 1.33
diff -u -u -r1.33 animate.c
--- dlls/comctl32/animate.c	2001/04/20 18:36:05	1.33
+++ dlls/comctl32/animate.c	2001/08/13 16:31:13
@@ -23,6 +23,14 @@
 
 DEFAULT_DEBUG_CHANNEL(animate);
 
+static struct {
+    HMODULE	hModule;
+    HIC         WINAPI  (*fnICOpen)(DWORD, DWORD, UINT);
+    LRESULT     WINAPI  (*fnICClose)(HIC);
+    LRESULT     WINAPI  (*fnICSendMessage)(HIC, UINT, DWORD, DWORD);
+    DWORD       WINAPIV (*fnICDecompress)(HIC,DWORD,LPBITMAPINFOHEADER,LPVOID,LPBITMAPINFOHEADER,LPVOID);
+} fnIC;
+
 typedef struct
 {
    /* reference to input stream (file or resource) */
@@ -146,7 +154,7 @@
 	    infoPtr->lpIndex = NULL;
 	}
 	if (infoPtr->hic) {
-	    ICClose(infoPtr->hic);
+	    fnIC.fnICClose(infoPtr->hic);
 	    infoPtr->hic = 0;
 	}
 	if (infoPtr->inbih) {
@@ -320,7 +328,7 @@
     mmioRead(infoPtr->hMMio, infoPtr->indata, infoPtr->ash.dwSuggestedBufferSize);
     
     if (infoPtr->hic &&
-	ICDecompress(infoPtr->hic, 0, infoPtr->inbih, infoPtr->indata, 
+	fnIC.fnICDecompress(infoPtr->hic, 0, infoPtr->inbih, infoPtr->indata, 
 		     infoPtr->outbih, infoPtr->outdata) != ICERR_OK) {
 	LeaveCriticalSection(&infoPtr->cs);
 	WARN("Decompression error\n");
@@ -615,13 +623,13 @@
     }
 
     /* try to get a decompressor for that type */
-    infoPtr->hic = ICOpen(ICTYPE_VIDEO, infoPtr->ash.fccHandler, ICMODE_DECOMPRESS);
+    infoPtr->hic = fnIC.fnICOpen(ICTYPE_VIDEO, infoPtr->ash.fccHandler, ICMODE_DECOMPRESS);
     if (!infoPtr->hic) {
 	WARN("Can't load codec for the file\n");
 	return FALSE;
     }
     
-    outSize = ICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, 
+    outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, 
 			    (DWORD)infoPtr->inbih, 0L);
 
     infoPtr->outbih = HeapAlloc(GetProcessHeap(), 0, outSize);
@@ -630,7 +638,7 @@
 	return FALSE;
     }
 
-    if (ICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, 
+    if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, 
 		      (DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != ICERR_OK) {
 	WARN("Can't get output BIH\n");
 	return FALSE;
@@ -642,7 +650,7 @@
 	return FALSE;
     }
 
-    if (ICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN, 
+    if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN, 
 		      (DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != ICERR_OK) {
 	WARN("Can't begin decompression\n");
 	return FALSE;
@@ -730,6 +738,22 @@
 {
     ANIMATE_INFO*	infoPtr;
 
+    if (!fnIC.hModule) /* FIXME: not thread safe */
+    {
+	/* since there's a circular dep between msvfw32 and comctl32, we could either:
+	 * - fix the build chain to allow this circular dep
+	 * - handle it by hand
+	 * AJ wants the later :-(
+	 */
+	fnIC.hModule = LoadLibraryA("msvfw32.dll");
+	if (!fnIC.hModule) return FALSE;
+
+	fnIC.fnICOpen        = (void*)GetProcAddress(fnIC.hModule, "ICOpen");
+	fnIC.fnICClose       = (void*)GetProcAddress(fnIC.hModule, "ICClose");
+	fnIC.fnICSendMessage = (void*)GetProcAddress(fnIC.hModule, "ICSendMessage");
+	fnIC.fnICDecompress  = (void*)GetProcAddress(fnIC.hModule, "ICDecompress");
+    }
+
     /* allocate memory for info structure */
     infoPtr = (ANIMATE_INFO *)COMCTL32_Alloc(sizeof(ANIMATE_INFO));
     if (!infoPtr) {
@@ -884,7 +908,6 @@
     }
     return 0;
 }
-
 
 void ANIMATE_Register(void)
 {
Index: dlls/comctl32/comctl32.spec
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/dlls/comctl32/comctl32.spec,v
retrieving revision 1.23
diff -u -u -r1.23 comctl32.spec
--- dlls/comctl32/comctl32.spec	2001/04/30 18:16:28	1.23
+++ dlls/comctl32/comctl32.spec	2001/08/13 16:31:29
@@ -3,7 +3,6 @@
 init	COMCTL32_LibMain
 rsrc	rsrc.res
 
-import -delay msvfw32.dll
 import -delay winmm.dll
 import	user32.dll
 import	gdi32.dll
Index: dlls/Makefile.in
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/dlls/Makefile.in,v
retrieving revision 1.100
diff -u -u -r1.100 Makefile.in
--- dlls/Makefile.in	2001/07/27 19:49:49	1.100
+++ dlls/Makefile.in	2001/08/15 07:57:41
@@ -428,7 +438,7 @@
 
 advapi32/libadvapi32. at LIBEXT@: libkernel32. at LIBEXT@ libntdll. at LIBEXT@
 avifil32/libavifil32. at LIBEXT@: libmsvfw32. at LIBEXT@ libole32. at LIBEXT@ libkernel32. at LIBEXT@ libntdll. at LIBEXT@
-comctl32/libcomctl32. at LIBEXT@: libmsvfw32. at LIBEXT@ libwinmm. at LIBEXT@ libuser32. at LIBEXT@ libgdi32. at LIBEXT@ libadvapi32. at LIBEXT@ libkernel32. at LIBEXT@ libntdll. at LIBEXT@
+comctl32/libcomctl32. at LIBEXT@: libwinmm. at LIBEXT@ libuser32. at LIBEXT@ libgdi32. at LIBEXT@ libadvapi32. at LIBEXT@ libkernel32. at LIBEXT@ libntdll. at LIBEXT@
 commdlg/libcomdlg32. at LIBEXT@: libshell32. at LIBEXT@ libshlwapi. at LIBEXT@ libcomctl32. at LIBEXT@ libwinspool.drv. at LIBEXT@ libuser32. at LIBEXT@ libgdi32. at LIBEXT@ libkernel32. at LIBEXT@ libntdll. at LIBEXT@
 crtdll/libcrtdll. at LIBEXT@: libmsvcrt. at LIBEXT@ libkernel32. at LIBEXT@ libntdll. at LIBEXT@
 dciman32/libdciman32. at LIBEXT@: libkernel32. at LIBEXT@ libntdll. at LIBEXT@


More information about the wine-patches mailing list