| 35 | } |
| 36 | |
| 37 | HRESULT CUpdateRunner::AreWeUACElevated() |
| 38 | { |
| 39 | HANDLE hProcess = GetCurrentProcess(); |
| 40 | HANDLE hToken = 0; |
| 41 | HRESULT hr; |
| 42 | |
| 43 | if (!OpenProcessToken(hProcess, TOKEN_QUERY, &hToken)) { |
| 44 | hr = HRESULT_FROM_WIN32(GetLastError()); |
| 45 | goto out; |
| 46 | } |
| 47 | |
| 48 | TOKEN_ELEVATION_TYPE elevType; |
| 49 | DWORD dontcare; |
| 50 | if (!GetTokenInformation(hToken, TokenElevationType, &elevType, sizeof(TOKEN_ELEVATION_TYPE), &dontcare)) { |
| 51 | hr = HRESULT_FROM_WIN32(GetLastError()); |
| 52 | goto out; |
| 53 | } |
| 54 | |
| 55 | hr = (elevType == TokenElevationTypeFull ? S_OK : S_FALSE); |
| 56 | |
| 57 | out: |
| 58 | if (hToken) { |
| 59 | CloseHandle(hToken); |
| 60 | } |
| 61 | |
| 62 | return hr; |
| 63 | } |
| 64 | |
| 65 | HRESULT FindDesktopFolderView(REFIID riid, void **ppv) |
| 66 | { |
nothing calls this directly
no outgoing calls
no test coverage detected