Don't clobber IsUserAnAdmin()

This commit is contained in:
Adam Demasi 2024-09-17 01:01:11 +09:30
parent 84c15556ad
commit 803ef07635
No known key found for this signature in database
GPG key ID: 5D3B26B3D58C7D91
3 changed files with 3 additions and 3 deletions

View file

@ -316,7 +316,7 @@ STDMETHODIMP CLegacyUpdateCtrl::RunWizard(IUpdateInstaller *installer, BSTR dial
STDMETHODIMP CLegacyUpdateCtrl::GetUserType(UserType *retval) {
DoIsPermittedCheck();
if (IsUserAnAdmin()) {
if (IsUserAdmin()) {
// Entire process is elevated.
*retval = e_admin;
} else if (m_elevatedHelper != NULL) {

View file

@ -51,7 +51,7 @@ void LaunchUpdateSite(int argc, LPWSTR *argv, int nCmdShow) {
}
// If running on 2k/XP, make sure we're elevated. If not, show Run As prompt.
if (!IsOSVersionOrLater(6, 0) && !IsUserAnAdmin()) {
if (!IsOSVersionOrLater(6, 0) && !IsUserAdmin()) {
LPWSTR filename;
DWORD filenameSize;
GetOwnFileName(&filename, &filenameSize);

View file

@ -2,7 +2,7 @@
#include <windows.h>
static inline BOOL IsUserAnAdmin() {
static inline BOOL IsUserAdmin() {
SID_IDENTIFIER_AUTHORITY authority = SECURITY_NT_AUTHORITY;
PSID adminsSid;
BOOL result = FALSE;