void Debugger::StartClient(const DebuggerClientOptions &options) { SmartPtr<Socket> localProxy = DebuggerClient::Start(options); if (localProxy.get()) { RegisterProxy(localProxy, true); } }
HRESULT RegisterServer(const CLSID& clsid, // Class ID const char* szFriendlyName, // Friendly Name const char* szVerIndProgID, // Programmatic const char* szProgID) // IDs { HMODULE hModule = GetModuleHandle(NULL); char szModuleName[MAX_SIZE]; char szCLSID[CLSID_STRING_SIZE]; nsCAutoString independentProgId(szVerIndProgID); nsCAutoString progId(szProgID); DWORD dwResult = ::GetModuleFileName(hModule, szModuleName, sizeof(szModuleName)/sizeof(char)); if (dwResult == 0) return S_FALSE; nsCAutoString moduleName(szModuleName); nsCAutoString registryKey("CLSID\\"); moduleName += MAPI_STARTUP_ARG; // Convert the CLSID into a char. if (!CLSIDtochar(clsid, szCLSID, sizeof(szCLSID))) return S_FALSE; registryKey += szCLSID; // Add the CLSID to the registry. if (!setKeyAndValue(registryKey, NULL, szFriendlyName)) return S_FALSE; if (!setKeyAndValue(registryKey, "LocalServer32", moduleName.get())) return S_FALSE; // Add the ProgID subkey under the CLSID key. if (!setKeyAndValue(registryKey, "ProgID", szProgID)) return S_FALSE; // Add the version-independent ProgID subkey under CLSID key. if (!setKeyAndValue(registryKey, "VersionIndependentProgID", szVerIndProgID)) return S_FALSE; // Add the version-independent ProgID subkey under HKEY_CLASSES_ROOT. if (!setKeyAndValue(independentProgId, NULL, szFriendlyName)) return S_FALSE; if (!setKeyAndValue(independentProgId, "CLSID", szCLSID)) return S_FALSE; if (!setKeyAndValue(independentProgId, "CurVer", szProgID)) return S_FALSE; // Add the versioned ProgID subkey under HKEY_CLASSES_ROOT. if (!setKeyAndValue(progId, NULL, szFriendlyName)) return S_FALSE; if (!setKeyAndValue(progId, "CLSID", szCLSID)) return S_FALSE; RegisterProxy(); return S_OK; }