Aric Stewart : strmbase: Define STRMBASE_DllMain.

Alexandre Julliard julliard at winehq.org
Wed Oct 20 13:24:44 CDT 2010


Module: wine
Branch: master
Commit: 58468ef15285d932dd403a5ea67c47bb3d66d2e4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=58468ef15285d932dd403a5ea67c47bb3d66d2e4

Author: Aric Stewart <aric at codeweavers.com>
Date:   Tue Oct 19 13:24:03 2010 -0500

strmbase: Define STRMBASE_DllMain.

---

 dlls/qcap/dllsetup.c    |   22 ----------------------
 dlls/qcap/dllsetup.h    |   13 -------------
 dlls/qcap/qcap_main.c   |   12 +-----------
 dlls/strmbase/dllfunc.c |   37 +++++++++++++++++++++++++++++++++++++
 include/wine/strmbase.h |    3 +++
 5 files changed, 41 insertions(+), 46 deletions(-)

diff --git a/dlls/qcap/dllsetup.c b/dlls/qcap/dllsetup.c
index 8d27d91..0791749 100644
--- a/dlls/qcap/dllsetup.c
+++ b/dlls/qcap/dllsetup.c
@@ -159,25 +159,3 @@ HRESULT SetupRegisterServers(const FactoryTemplate * pList, int num,
         hr = SetupRegisterAllClasses(pList, num, szFileName, FALSE);
     return hr;
 }
-
-/****************************************************************************
- * SetupInitializeServers
- *
- * This function is table driven using the static members of the
- * CFactoryTemplate class defined in the Dll.
- *
- * It calls the initialize function for any class in CFactoryTemplate with
- * one defined.
- *
- ****************************************************************************/
-void SetupInitializeServers(const FactoryTemplate * pList, int num,
-                            BOOL bLoading)
-{
-    int i;
-
-    for (i = 0; i < num; i++, pList++)
-    {
-        if (pList->m_lpfnInit)
-            pList->m_lpfnInit(bLoading, pList->m_ClsID);
-    }
-}
diff --git a/dlls/qcap/dllsetup.h b/dlls/qcap/dllsetup.h
index 8edb144..43950d8 100644
--- a/dlls/qcap/dllsetup.h
+++ b/dlls/qcap/dllsetup.h
@@ -35,17 +35,4 @@
  ****************************************************************************/
 extern HRESULT SetupRegisterServers(const FactoryTemplate * pList, int num, BOOL bRegister);
 
-/****************************************************************************
- * SetupInitializeServers
- *
- * This function is table driven using the static members of the
- * CFactoryTemplate class defined in the Dll.
- *
- * It calls the initialize function for any class in CFactoryTemplate with
- * one defined.
- *
- ****************************************************************************/
-extern void SetupInitializeServers(const FactoryTemplate * pList, int num,
-                                   BOOL bLoading);
-
 #endif /* _QCAP_DLLSETUP_H_DEFINED */
diff --git a/dlls/qcap/qcap_main.c b/dlls/qcap/qcap_main.c
index fcc55f2..7465bb4 100644
--- a/dlls/qcap/qcap_main.c
+++ b/dlls/qcap/qcap_main.c
@@ -154,17 +154,7 @@ int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
  */
 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 {
-    switch (fdwReason)
-    {
-        case DLL_PROCESS_ATTACH:
-            DisableThreadLibraryCalls(hInstDLL);
-            SetupInitializeServers(g_Templates, g_cTemplates, TRUE);
-            break;
-        case DLL_PROCESS_DETACH:
-            SetupInitializeServers(g_Templates, g_cTemplates, FALSE);
-            break;
-    }
-    return TRUE;
+    return STRMBASE_DllMain(hInstDLL,fdwReason,lpv);
 }
 
 /***********************************************************************
diff --git a/dlls/strmbase/dllfunc.c b/dlls/strmbase/dllfunc.c
index 16a126e..cac93b6 100644
--- a/dlls/strmbase/dllfunc.c
+++ b/dlls/strmbase/dllfunc.c
@@ -91,3 +91,40 @@ HRESULT WINAPI AMovieDllRegisterServer2(BOOL bRegister)
 
     return hr;
 }
+
+/****************************************************************************
+ * SetupInitializeServers
+ *
+ * This function is table driven using the static members of the
+ * CFactoryTemplate class defined in the Dll.
+ *
+ * It calls the initialize function for any class in CFactoryTemplate with
+ * one defined.
+ *
+ ****************************************************************************/
+static void SetupInitializeServers(const FactoryTemplate * pList, int num,
+                            BOOL bLoading)
+{
+    int i;
+
+    for (i = 0; i < num; i++, pList++)
+    {
+        if (pList->m_lpfnInit)
+            pList->m_lpfnInit(bLoading, pList->m_ClsID);
+    }
+}
+
+BOOL WINAPI STRMBASE_DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
+{
+    switch (fdwReason)
+    {
+        case DLL_PROCESS_ATTACH:
+            DisableThreadLibraryCalls(hInstDLL);
+            SetupInitializeServers(g_Templates, g_cTemplates, TRUE);
+            break;
+        case DLL_PROCESS_DETACH:
+            SetupInitializeServers(g_Templates, g_cTemplates, FALSE);
+            break;
+    }
+    return TRUE;
+}
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index d34457a..581643e 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -312,3 +312,6 @@ typedef struct tagFactoryTemplate {
 
 HRESULT WINAPI AMovieDllRegisterServer2(BOOL bRegister);
 HRESULT WINAPI AMovieSetupRegisterFilter2( const AMOVIESETUP_FILTER const * pFilter, IFilterMapper2  *pIFM2, BOOL  bRegister);
+
+/* Dll Functions */
+BOOL WINAPI STRMBASE_DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv);




More information about the wine-cvs mailing list