DllInstall - Adds/Removes entries to the system registry per user per machine.
| 95 | // DllInstall - Adds/Removes entries to the system registry per user |
| 96 | // per machine. |
| 97 | STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) |
| 98 | { |
| 99 | HRESULT hr = E_FAIL; |
| 100 | static const wchar_t szUserSwitch[] = _T("user"); |
| 101 | |
| 102 | if (pszCmdLine != nullptr) |
| 103 | { |
| 104 | #pragma warning(suppress: ALL_CPPCORECHECK_WARNINGS) |
| 105 | if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0) |
| 106 | { |
| 107 | ATL::AtlSetPerUserRegistration(true); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | if (bInstall) |
| 112 | { |
| 113 | hr = DllRegisterServer(); |
| 114 | if (FAILED(hr)) |
| 115 | { |
| 116 | DllUnregisterServer(); |
| 117 | } |
| 118 | } |
| 119 | else |
| 120 | { |
| 121 | hr = DllUnregisterServer(); |
| 122 | } |
| 123 | |
| 124 | return hr; |
| 125 | } |
nothing calls this directly
no test coverage detected