Mercurial > trustbridge
comparison cinst/windowsstore.c @ 262:759a898990d1
Use DWORD value directly to dertermine elevation
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Tue, 01 Apr 2014 15:01:38 +0000 |
parents | 3595ea4fd3fb |
children | 824ef90a6721 |
comparison
equal
deleted
inserted
replaced
261:7707191ddb01 | 262:759a898990d1 |
---|---|
163 static bool is_elevated() { | 163 static bool is_elevated() { |
164 HANDLE hToken = NULL; | 164 HANDLE hToken = NULL; |
165 bool ret = false; | 165 bool ret = false; |
166 if (OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hToken)) | 166 if (OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hToken)) |
167 { | 167 { |
168 TOKEN_ELEVATION elevation; | 168 DWORD elevation; |
169 DWORD cbSize = sizeof (TOKEN_ELEVATION); | 169 DWORD cbSize = sizeof (DWORD); |
170 if (GetTokenInformation (hToken, TokenElevation, &elevation, | 170 if (GetTokenInformation (hToken, TokenElevation, &elevation, |
171 sizeof (TokenElevation), &cbSize)) | 171 sizeof (TokenElevation), &cbSize)) |
172 { | 172 { |
173 ret = elevation.TokenIsElevated; | 173 ret = elevation; |
174 } | 174 } |
175 } | 175 } |
176 if (hToken) | 176 if (hToken) |
177 CloseHandle (hToken); | 177 CloseHandle (hToken); |
178 | 178 |