FUNCTION: UnregisterInprocServer PURPOSE: Unegister the in-process component in the registry. PARAMETERS: clsid - Class ID of the component NOTE: The function deletes the HKCR\CLSID\{ } key in the registry.
| 173 | // NOTE: The function deletes the HKCR\CLSID\{<CLSID>} key in the registry. |
| 174 | // |
| 175 | HRESULT UnregisterInprocServer(const CLSID& clsid) |
| 176 | { |
| 177 | HRESULT hr = S_OK; |
| 178 | |
| 179 | wchar_t szCLSID[MAX_PATH]; |
| 180 | StringFromGUID2(clsid, szCLSID, ARRAYSIZE(szCLSID)); |
| 181 | |
| 182 | wchar_t szSubkey[MAX_PATH]; |
| 183 | |
| 184 | // Delete the HKCR\CLSID\{<CLSID>} key. |
| 185 | hr = StringCchPrintf(szSubkey, ARRAYSIZE(szSubkey), L"CLSID\\%s", szCLSID); |
| 186 | if (SUCCEEDED(hr)) { |
| 187 | hr = HRESULT_FROM_WIN32(static_cast<unsigned>(RegDeleteTree(HKEY_CLASSES_ROOT, szSubkey))); |
| 188 | ; |
| 189 | } |
| 190 | |
| 191 | return hr; |
| 192 | } |
| 193 | |
| 194 | // |
| 195 | // FUNCTION: RegisterShellExtThumbnailHandler |
no outgoing calls
no test coverage detected