/* */ 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 */