[mlang.dll] DllCanUnloadNow
Christian Gmeiner
christian.gmeiner at students.fh-vorarlberg.ac.at
Fri Mar 3 08:54:53 CST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This patch
+ implements LockServer
+ implements DllCanUnloadNow
+ add some needed calls to LockModule() & UnlockModule()
If it didn't get into cvs i want a mail with the cause.
- --
Christian Gmeiner - student of computer science
http://dxr3plugin.sf.net
http://itb04.ath.cx
http://javamill.ath.cx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFECFi9Dwe2AbwGBA8RApDQAJ4nCMpbbOeWBTi/x1xV36MrBaKoNgCfRTG8
54cyjapBkvdO9DUkNP41k3k=
=HK0l
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: dlls/mlang/mlang.c
===================================================================
RCS file: /home/wine/wine/dlls/mlang/mlang.c,v
retrieving revision 1.25
diff -u -r1.25 mlang.c
--- dlls/mlang/mlang.c 6 Dec 2005 10:39:43 -0000 1.25
+++ dlls/mlang/mlang.c 3 Mar 2006 08:47:38 -0000
@@ -453,6 +453,21 @@
static void fill_cp_info(const struct mlang_data *ml_data, UINT index, MIMECPINFO *mime_cp_info);
+static LONG dll_count;
+
+/*
+ * Dll lifetime tracking declaration
+ */
+static void LockModule(void)
+{
+ InterlockedIncrement(&dll_count);
+}
+
+static void UnlockModule(void)
+{
+ InterlockedDecrement(&dll_count);
+}
+
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
{
switch(fdwReason) {
@@ -709,6 +724,7 @@
{
TRACE("Destroying %p\n", This);
HeapFree(GetProcessHeap(), 0, This);
+ UnlockModule();
}
return ref;
@@ -735,8 +751,11 @@
static HRESULT WINAPI MLANGCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
- FIXME("(%p)->(%d),stub!\n",This,dolock);
+ if (dolock)
+ LockModule();
+ else
+ UnlockModule();
+
return S_OK;
}
@@ -2281,6 +2300,9 @@
mlang->ref = 1;
*ppObj = (LPVOID) mlang;
TRACE("returning %p\n", mlang);
+
+ LockModule();
+
return S_OK;
}
@@ -2288,8 +2310,7 @@
HRESULT WINAPI DllCanUnloadNow(void)
{
- FIXME("\n");
- return S_FALSE;
+ return dll_count == 0 ? S_OK : S_FALSE;
}
HRESULT WINAPI GetGlobalFontLinkObject(void)
More information about the wine-devel
mailing list