Jacek Caban : npmshtml: Added Mozilla plugin for mshtml ActiveX controls.

Alexandre Julliard julliard at winehq.org
Fri Dec 3 09:31:38 CST 2010


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Dec  2 19:15:28 2010 +0100

npmshtml: Added Mozilla plugin for mshtml ActiveX controls.

---

 configure                       |    1 +
 configure.ac                    |    1 +
 dlls/mshtml/main.c              |    9 ++++++++
 dlls/mshtml/mshtml.spec         |    3 ++
 dlls/mshtml/nsembed.c           |    8 +++++++
 dlls/npmshtml/Makefile.in       |    7 ++++++
 dlls/npmshtml/main.c            |   42 +++++++++++++++++++++++++++++++++++++++
 dlls/npmshtml/npmshtml.spec     |    3 ++
 dlls/npmshtml/rsrc.rc           |   24 ++++++++++++++++++++++
 include/wine/wine_common_ver.rc |    3 ++
 tools/wine.inf.in               |    1 +
 11 files changed, 102 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 83a3205..9ce65b3 100755
--- a/configure
+++ b/configure
@@ -15022,6 +15022,7 @@ wine_fn_config_dll nddeapi enable_nddeapi nddeapi
 wine_fn_config_dll netapi32 enable_netapi32 netapi32
 wine_fn_config_test dlls/netapi32/tests netapi32_test
 wine_fn_config_dll newdev enable_newdev newdev
+wine_fn_config_dll npmshtml enable_npmshtml
 wine_fn_config_dll ntdll enable_ntdll ntdll
 wine_fn_config_test dlls/ntdll/tests ntdll_test
 wine_fn_config_dll ntdsapi enable_ntdsapi ntdsapi
diff --git a/configure.ac b/configure.ac
index de1ba7d..14f9718 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2599,6 +2599,7 @@ WINE_CONFIG_DLL(nddeapi,,[nddeapi])
 WINE_CONFIG_DLL(netapi32,,[netapi32])
 WINE_CONFIG_TEST(dlls/netapi32/tests)
 WINE_CONFIG_DLL(newdev,,[newdev])
+WINE_CONFIG_DLL(npmshtml)
 WINE_CONFIG_DLL(ntdll,,[ntdll])
 WINE_CONFIG_TEST(dlls/ntdll/tests)
 WINE_CONFIG_DLL(ntdsapi,,[ntdsapi])
diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c
index 679c206..1b3c767 100644
--- a/dlls/mshtml/main.c
+++ b/dlls/mshtml/main.c
@@ -520,3 +520,12 @@ const char *debugstr_variant(const VARIANT *v)
         return wine_dbg_sprintf("{vt %d}", V_VT(v));
     }
 }
+
+/***********************************************************************
+ *          NP_GetEntryPoints (npmshtml.@)
+ */
+INT16 WINAPI NP_GetEntryPoints(void *funcs)
+{
+    FIXME("(%p)\n", funcs);
+    return 1;
+}
diff --git a/dlls/mshtml/mshtml.spec b/dlls/mshtml/mshtml.spec
index 5dfcdcd..81f9f0e 100644
--- a/dlls/mshtml/mshtml.spec
+++ b/dlls/mshtml/mshtml.spec
@@ -19,3 +19,6 @@
 @ stub com_ms_osp_ospmrshl_copyToExternal
 @ stub com_ms_osp_ospmrshl_releaseByValExternal
 @ stub com_ms_osp_ospmrshl_toJava
+
+#Wine extension for Mozilla plugin support
+@ stdcall NP_GetEntryPoints(ptr)
diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c
index f282b03..5d21a1f 100644
--- a/dlls/mshtml/nsembed.c
+++ b/dlls/mshtml/nsembed.c
@@ -244,6 +244,8 @@ static void set_environment(LPCWSTR gre_path)
     static const WCHAR nspr_log_modulesW[] =
         {'N','S','P','R','_','L','O','G','_','M','O','D','U','L','E','S',0};
     static const WCHAR debug_formatW[] = {'a','l','l',':','%','d',0};
+    static const WCHAR moz_plugin_pathW[] = {'M','O','Z','_','P','L','U','G','I','N','_','P','A','T','H',0};
+    static const WCHAR gecko_pluginW[] = {'\\','g','e','c','k','o','\\','p','l','u','g','i','n',0};
 
     /* We have to modify PATH as XPCOM loads other DLLs from this directory. */
     GetEnvironmentVariableW(pathW, path_env, sizeof(path_env)/sizeof(WCHAR));
@@ -263,6 +265,12 @@ static void set_environment(LPCWSTR gre_path)
 
     sprintfW(buf, debug_formatW, debug_level);
     SetEnvironmentVariableW(nspr_log_modulesW, buf);
+
+    len = GetSystemDirectoryW(path_env, (sizeof(path_env)-sizeof(gecko_pluginW))/sizeof(WCHAR)+1);
+    if(len) {
+        strcpyW(path_env+len, gecko_pluginW);
+        SetEnvironmentVariableW(moz_plugin_pathW, path_env);
+    }
 }
 
 static BOOL load_xpcom(const PRUnichar *gre_path)
diff --git a/dlls/npmshtml/Makefile.in b/dlls/npmshtml/Makefile.in
new file mode 100644
index 0000000..3e3c54f
--- /dev/null
+++ b/dlls/npmshtml/Makefile.in
@@ -0,0 +1,7 @@
+MODULE    = npmshtml.dll
+IMPORTS   = mshtml
+
+C_SRCS = main.c
+RC_SRCS = rsrc.rc
+
+ at MAKE_DLL_RULES@
diff --git a/dlls/npmshtml/main.c b/dlls/npmshtml/main.c
new file mode 100644
index 0000000..9beaa35
--- /dev/null
+++ b/dlls/npmshtml/main.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2010 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(npmshtml);
+
+/***********************************************************************
+ *          NP_Initialize (npmshtml.@)
+ */
+INT16 WINAPI NP_Initialize(void *arg)
+{
+    return 0;
+}
+
+/***********************************************************************
+ *          NP_Shutdown (npmshtml.@)
+ */
+INT16 WINAPI NP_Shutdown(void)
+{
+    return 0;
+}
diff --git a/dlls/npmshtml/npmshtml.spec b/dlls/npmshtml/npmshtml.spec
new file mode 100644
index 0000000..e0b6dea
--- /dev/null
+++ b/dlls/npmshtml/npmshtml.spec
@@ -0,0 +1,3 @@
+1 stdcall NP_GetEntryPoints(ptr) mshtml.NP_GetEntryPoints
+2 stdcall NP_Initialize(ptr)
+3 stdcall NP_Shutdown()
diff --git a/dlls/npmshtml/rsrc.rc b/dlls/npmshtml/rsrc.rc
new file mode 100644
index 0000000..2ed88ac
--- /dev/null
+++ b/dlls/npmshtml/rsrc.rc
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2010 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define WINE_OLESELFREGISTER
+#define WINE_FILEDESCRIPTION_STR "Wine ActiveX plugin"
+#define WINE_FILENAME_STR "npmshtml.dll"
+#define WINE_MIMETYPE "application/x-oleobject"
+
+#include "wine/wine_common_ver.rc"
diff --git a/include/wine/wine_common_ver.rc b/include/wine/wine_common_ver.rc
index 29dcd98..a6f40a0 100644
--- a/include/wine/wine_common_ver.rc
+++ b/include/wine/wine_common_ver.rc
@@ -111,6 +111,9 @@ FILESUBTYPE    WINE_FILESUBTYPE
 #ifdef WINE_OLESELFREGISTER
 	    VALUE "OLESelfRegister", ""
 #endif
+#ifdef WINE_MIMETYPE
+            VALUE "MIMEType", WINE_MIMETYPE
+#endif
 	}
     }
     BLOCK "VarFileInfo"
diff --git a/tools/wine.inf.in b/tools/wine.inf.in
index 1ceb2e4..8d8ac3f 100644
--- a/tools/wine.inf.in
+++ b/tools/wine.inf.in
@@ -2607,6 +2607,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
 10,Microsoft.NET\Framework\v3.0\windows communication foundation,servicemodelreg.exe
 10,Microsoft.NET\Framework\v4.0.30319,ngen.exe
 10,Microsoft.NET\Framework\v4.0.30319,fusion.dll
+11,gecko\plugin,npmshtml.dll
 11,wbem,mofcomp.exe
 16422,Internet Explorer,iexplore.exe
 11,,*




More information about the wine-cvs mailing list