/***************************************************************************** * UnregisterAsioDriver() ***************************************************************************** */ HRESULT UnregisterAsioDriver ( IN LPTSTR FriendlyName, IN REFGUID ClassId ) { HKEY AsioPublicKey = NULL; DWORD w32Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ASIO_PUBLIC_KEY, 0, KEY_ALL_ACCESS, &AsioPublicKey); if (ERROR_SUCCESS == w32Error) { RegDeleteKey(AsioPublicKey, FriendlyName); RegCloseKey(AsioPublicKey); } if (ERROR_SUCCESS == w32Error) { return UnregisterInprocServer(ClassId); } else { return E_FAIL; } }
// DllUnregisterServer - Removes entries from the system registry STDAPI DllUnregisterServer(void) { m_ac.disconnectFromServer(); HRESULT hr = S_OK; wchar_t szModule[MAX_PATH]; if (GetModuleFileName(g_hInst, szModule, ARRAYSIZE(szModule)) == 0) { hr = HRESULT_FROM_WIN32(GetLastError()); return hr; } // Unregister the component. hr = UnregisterInprocServer(CLSID_DDShellExt); if (SUCCEEDED(hr)) { // Unregister the context menu handler. hr = UnregisterShellExtContextMenuHandler(L"textfile", CLSID_DDShellExt); hr = UnregisterShellExtContextMenuHandler(L"Drive", CLSID_DDShellExt); hr = UnregisterShellExtContextMenuHandler(L"Directory", CLSID_DDShellExt); hr = UnregisterShellExtContextMenuHandler(L"Folder", CLSID_DDShellExt); return hr; } return S_OK; }
STDAPI DllUnregisterServer(void) { HRESULT hr = S_OK; wchar_t szModule[MAX_PATH]; if (GetModuleFileName(g_hInst, szModule, ARRAYSIZE(szModule)) == 0) { hr = HRESULT_FROM_WIN32(GetLastError()); return hr; } hr = UnregisterInprocServer(CLSID_ContextMenuExt); if (SUCCEEDED(hr)) { hr = UnregisterShellExtContextMenuHandler(L"*", CLSID_ContextMenuExt); } return hr; }