Jacek Caban : jscript: Move some of registration process to IRegistrar mechanism.

Alexandre Julliard julliard at winehq.org
Fri Dec 17 11:30:40 CST 2010


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Dec 15 19:33:17 2010 +0100

jscript: Move some of registration process to IRegistrar mechanism.

---

 .gitignore                       |    1 +
 dlls/jscript/Makefile.in         |    2 +
 dlls/jscript/jscript.inf         |   18 ----------------
 dlls/jscript/jscript_classes.idl |   41 ++++++++++++++++++++++++++++++++++++++
 dlls/jscript/jscript_main.c      |   23 ++++++++++++++------
 5 files changed, 60 insertions(+), 25 deletions(-)

diff --git a/.gitignore b/.gitignore
index 0f96790..16370d3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,6 +52,7 @@ dlls/dispex/disp_ex_p.c
 dlls/dxdiagn/fil_data.h
 dlls/gameux/gameux_tlb.tlb
 dlls/infosoft/infosoft.h
+dlls/jscript/jscript_classes.h
 dlls/jscript/jsglobal.tlb
 dlls/jscript/parser.tab.c
 dlls/jscript/parser.tab.h
diff --git a/dlls/jscript/Makefile.in b/dlls/jscript/Makefile.in
index 24f5fdb..5819753 100644
--- a/dlls/jscript/Makefile.in
+++ b/dlls/jscript/Makefile.in
@@ -46,6 +46,8 @@ C_SRCS = \
 	vbarray.c
 
 IDL_TLB_SRCS = jsglobal.idl
+IDL_R_SRCS = jscript_classes.idl
+IDL_H_SRCS = jscript_classes.idl
 
 BISON_SRCS = \
 	parser.y
diff --git a/dlls/jscript/jscript.inf b/dlls/jscript/jscript.inf
index d6a6f8c..c8f0105 100644
--- a/dlls/jscript/jscript.inf
+++ b/dlls/jscript/jscript.inf
@@ -11,29 +11,17 @@ DelReg=Classes.Reg, FileType.Reg
 
 
 [Classes.Reg]
-HKCR,"CLSID\%CLSID_JScript%",,,"JScript Language"
 HKCR,"CLSID\%CLSID_JScript%\Implemented Categories\%CATID_ActiveScript%",,16
 HKCR,"CLSID\%CLSID_JScript%\Implemented Categories\%CATID_ActiveScriptParse%",,16
-HKCR,"CLSID\%CLSID_JScript%\InprocServer32",,,"%MODULE%"
-HKCR,"CLSID\%CLSID_JScript%\InprocServer32","ThreadingModel",,"Both"
 HKCR,"CLSID\%CLSID_JScript%\OLEScript",,16
-HKCR,"CLSID\%CLSID_JScript%\ProgID",,,"JScript"
 
-HKCR,"CLSID\%CLSID_JScriptAuthor%",,,"JScript Language Authoring"
 HKCR,"CLSID\%CLSID_JScriptAuthor%\Implemented Categories\%CATID_ActiveScriptAuthor%",,16
-HKCR,"CLSID\%CLSID_JScriptAuthor%\InprocServer32",,,"%MODULE%"
-HKCR,"CLSID\%CLSID_JScriptAuthor%\InprocServer32","ThreadingModel",,"Both"
 HKCR,"CLSID\%CLSID_JScriptAuthor%\OLEScript",,16
-HKCR,"CLSID\%CLSID_JScriptAuthor%\ProgID",,,"JScript Author"
 
-HKCR,"CLSID\%CLSID_JScriptEncode%",,,"JScript Language Encoding"
 HKCR,"CLSID\%CLSID_JScriptEncode%\Implemented Categories\%CATID_ActiveScript%",,16
 HKCR,"CLSID\%CLSID_JScriptEncode%\Implemented Categories\%CATID_ActiveScriptParse%",,16
 HKCR,"CLSID\%CLSID_JScriptEncode%\Implemented Categories\%CATID_ActiveScriptEncode%",,16
-HKCR,"CLSID\%CLSID_JScriptEncode%\InprocServer32",,,"%MODULE%"
-HKCR,"CLSID\%CLSID_JScriptEncode%\InprocServer32","ThreadingModel",,"Both"
 HKCR,"CLSID\%CLSID_JScriptEncode%\OLEScript",,16
-HKCR,"CLSID\%CLSID_JScriptEncode%\ProgID",,,"JScript.Encode"
 
 HKCR,"Component Categories\%CATID_ActiveScriptAuthor%","409",,"Active Scripting Engine with Authoring"
 HKCR,"Component Categories\%CATID_ActiveScript%","409",,"Active Scripting Engine"
@@ -48,8 +36,6 @@ HKCR,"JavaScript",,,"JScript Language"
 HKCR,"JavaScript\CLSID",,,"%CLSID_JScript%"
 HKCR,"JavaScript\OLEScript",,16
 
-HKCR,"JavaScript Author",,,"JScript Language Authoring"
-HKCR,"JavaScript Author\CLSID",,,"%CLSID_JScriptAuthor%"
 HKCR,"JavaScript Author\OLEScript",,16
 
 HKCR,"JavaScript1.1",,,"JScript Language"
@@ -72,16 +58,12 @@ HKCR,"JavaScript1.3",,,"JScript Language"
 HKCR,"JavaScript1.3\CLSID",,,"%CLSID_JScript%"
 HKCR,"JavaScript1.3\OLEScript",,16
 
-HKCR,"JScript",,,"JScript Language"
-HKCR,"JScript\CLSID",,,"%CLSID_JScript%"
 HKCR,"JScript\OLEScript",,16
 
 HKCR,"JScript Author",,,"JScript Language Authoring"
 HKCR,"JScript Author\CLSID",,,"%CLSID_JScriptAuthor%"
 HKCR,"JScript Author\OLEScript",,16
 
-HKCR,"JScript.Encode",,,"JScript Language Encoding"
-HKCR,"JScript.Encode\CLSID",,,"%CLSID_JScriptEncode%"
 HKCR,"JScript.Encode\OLEScript",,16
 
 HKCR,"LiveScript",,,"JScript Language"
diff --git a/dlls/jscript/jscript_classes.idl b/dlls/jscript/jscript_classes.idl
new file mode 100644
index 0000000..d9f481e
--- /dev/null
+++ b/dlls/jscript/jscript_classes.idl
@@ -0,0 +1,41 @@
+/*
+ * 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
+ */
+
+[
+    helpstring("JScript Language"),
+    threading(both),
+    progid("JScript"),
+    uuid(f414c260-6ac0-11cf-b6d1-00aa00bbbb58)
+]
+coclass JScript {}
+
+[
+    helpstring("JScript Language Authoring"),
+    threading(both),
+    progid("JScript Author"),
+    uuid(f414c261-6ac0-11cf-b6d1-00aa00bbbb58)
+]
+coclass JScriptAuthor {}
+
+[
+    helpstring("JScript Language Encoding"),
+    threading(both),
+    progid("JScript.Encode"),
+    uuid(f414c262-6ac0-11cf-b6d1-00aa00bbbb58)
+]
+coclass JScriptEncode {}
diff --git a/dlls/jscript/jscript_main.c b/dlls/jscript/jscript_main.c
index 78f8f00..3f5b7de 100644
--- a/dlls/jscript/jscript_main.c
+++ b/dlls/jscript/jscript_main.c
@@ -25,6 +25,8 @@
 #include "activaut.h"
 #include "objsafe.h"
 #include "mshtmhst.h"
+#include "rpcproxy.h"
+#include "jscript_classes.h"
 
 #include "wine/debug.h"
 
@@ -32,13 +34,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript);
 
 LONG module_ref = 0;
 
-static const CLSID CLSID_JScript =
-    {0xf414c260,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}};
-static const CLSID CLSID_JScriptAuthor =
-    {0xf414c261,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}};
-static const CLSID CLSID_JScriptEncode =
-    {0xf414c262,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}};
-
 DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
 
 HINSTANCE jscript_hinstance;
@@ -204,7 +199,14 @@ static HRESULT register_inf(BOOL doregister)
  */
 HRESULT WINAPI DllRegisterServer(void)
 {
+    HRESULT hres;
+
     TRACE("()\n");
+
+    hres = __wine_register_resources(jscript_hinstance, NULL);
+    if(FAILED(hres))
+       return hres;
+
     return register_inf(TRUE);
 }
 
@@ -213,6 +215,13 @@ HRESULT WINAPI DllRegisterServer(void)
  */
 HRESULT WINAPI DllUnregisterServer(void)
 {
+    HRESULT hres;
+
     TRACE("()\n");
+
+    hres = __wine_unregister_resources(jscript_hinstance, NULL);
+    if(FAILED(hres))
+        return hres;
+
     return register_inf(FALSE);
 }




More information about the wine-cvs mailing list