diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/IClassFactory.java | |
| download | worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip | |
Diffstat (limited to 'NET/worlds/console/IClassFactory.java')
| -rw-r--r-- | NET/worlds/console/IClassFactory.java | 178 |
1 files changed, 178 insertions, 0 deletions
diff --git a/NET/worlds/console/IClassFactory.java b/NET/worlds/console/IClassFactory.java new file mode 100644 index 0000000..408d4c4 --- /dev/null +++ b/NET/worlds/console/IClassFactory.java @@ -0,0 +1,178 @@ +/* */ package NET.worlds.console; +/* */ +/* */ import NET.worlds.core.RegKey; +/* */ import NET.worlds.core.RegKeyNotFoundException; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class IClassFactory +/* */ extends IUnknown +/* */ { +/* */ private static final String IID_IClassFactory = "{00000001-0000-0000-C000-000000000046}"; +/* */ private long _registerID; +/* */ +/* */ public IClassFactory() +/* */ throws IOException +/* */ {} +/* */ +/* */ public IClassFactory(String svrID) +/* */ throws IOException +/* */ { +/* 32 */ super(svrID, "{00000001-0000-0000-C000-000000000046}"); +/* */ } +/* */ +/* */ public IClassFactory(IUnknown pIUnknown) throws IOException, OLEInvalidObjectException +/* */ { +/* 37 */ super(pIUnknown, "{00000001-0000-0000-C000-000000000046}"); +/* */ } +/* */ +/* */ public synchronized void activate(String CLSID) throws IOException { +/* 41 */ assert (this._registerID == 0L); +/* */ +/* 43 */ assert (Main.isMainThread()); +/* */ +/* 45 */ if ((ActiveX.getDebugLevel() & 0x8) > 0) { +/* 46 */ System.out.println(this + ": activating server as " + CLSID); +/* */ } +/* 48 */ this._registerID = nActivate(CLSID); +/* */ +/* 50 */ if ((ActiveX.getDebugLevel() & 0x8) > 0) { +/* 51 */ System.out.println(this + ": successful"); +/* */ } +/* */ } +/* */ +/* */ public synchronized void deactivate() throws IOException { +/* 56 */ assert (this._registerID != 0L); +/* 57 */ assert (Main.isMainThread()); +/* */ +/* 59 */ if ((ActiveX.getDebugLevel() & 0x8) > 0) { +/* 60 */ System.out.println(this + ": deactivating server"); +/* */ } +/* 62 */ nDeactivate(this._registerID); +/* */ } +/* */ +/* */ public synchronized void Release() +/* */ throws OLEInvalidObjectException +/* */ { +/* 68 */ if (this._refs == 1) +/* */ { +/* */ +/* 71 */ if (this._registerID != 0L) +/* */ { +/* */ +/* */ +/* 75 */ if ((ActiveX.getDebugLevel() & 0x4) > 0) { +/* 76 */ System.out.println(this + +/* 77 */ ": deactivating before Release"); +/* */ } +/* */ try { +/* 80 */ deactivate(); +/* */ +/* */ } +/* */ catch (IOException e) +/* */ { +/* 85 */ System.out.println("DEBUG: " + this); +/* 86 */ e.printStackTrace(System.out); +/* 87 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* 89 */ this._registerID = 0L; +/* */ } +/* */ } +/* 92 */ super.Release(); +/* */ } +/* */ +/* */ public String internalData() +/* */ { +/* 97 */ return "_registerID = " + this._registerID + ", " + super.internalData(); +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 102 */ return "IClassFactory(" + internalData() + ")"; +/* */ } +/* */ +/* */ public void register(String friendlyName, String CLSID, String VerIndProgID, String ProgID) +/* */ { +/* */ try { +/* 108 */ RegKey root = RegKey.getRootKey(0); +/* */ +/* */ +/* */ +/* 112 */ RegKey gammaKey = new RegKey(root, "world\\shell\\open\\command", +/* 113 */ 0); +/* 114 */ String gammaPath = gammaKey.getStringValue(""); +/* 115 */ int argIndx = gammaPath.indexOf(" \"%1\""); +/* 116 */ gammaPath = gammaPath.substring(0, argIndx); +/* */ +/* */ +/* 119 */ RegKey classKey = new RegKey(root, "CLSID\\" + CLSID, +/* 120 */ 2); +/* 121 */ classKey.setStringValue("", friendlyName, false); +/* */ +/* */ +/* 124 */ RegKey subKey = new RegKey(classKey, "LocalServer32", +/* 125 */ 2); +/* 126 */ subKey.setStringValue("", gammaPath, false); +/* 127 */ subKey.close(); +/* */ +/* */ +/* 130 */ subKey = new RegKey(classKey, "ProgID", 2); +/* 131 */ subKey.setStringValue("", ProgID, false); +/* 132 */ subKey.close(); +/* */ +/* */ +/* 135 */ subKey = new RegKey(classKey, "VersionIndependentProgID", +/* 136 */ 2); +/* 137 */ subKey.setStringValue("", VerIndProgID, false); +/* 138 */ subKey.close(); +/* */ +/* 140 */ classKey.close(); +/* */ +/* */ +/* */ +/* 144 */ RegKey verIndKey = new RegKey(root, VerIndProgID, +/* 145 */ 2); +/* 146 */ verIndKey.setStringValue("", friendlyName, false); +/* 147 */ subKey = new RegKey(verIndKey, "CLSID", 2); +/* 148 */ subKey.setStringValue("", CLSID, false); +/* 149 */ subKey.close(); +/* 150 */ subKey = new RegKey(verIndKey, "CurVer", 2); +/* 151 */ subKey.setStringValue("", ProgID, false); +/* 152 */ subKey.close(); +/* 153 */ verIndKey.close(); +/* */ +/* 155 */ RegKey progKey = new RegKey(root, ProgID, 2); +/* 156 */ progKey.setStringValue("", friendlyName, false); +/* 157 */ subKey = new RegKey(progKey, "CLSID", 2); +/* 158 */ subKey.setStringValue("", CLSID, false); +/* 159 */ subKey.close(); +/* 160 */ progKey.close(); +/* */ } +/* */ catch (RegKeyNotFoundException e) { +/* 163 */ System.out.println("Warning: System Registry not configured properly by Worlds."); +/* */ } +/* */ } +/* */ +/* */ private native long nActivate(String paramString) +/* */ throws IOException; +/* */ +/* */ private native void nDeactivate(long paramLong) +/* */ throws IOException; +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\IClassFactory.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |