IsElevationRequired

Go to Home Page

Determines whether the current user account needs to be elevated to execute a file

Syntax

BOOL WINAPI IsElevationRequired (
    LPCWSTR pwszExeFile
)

Parameters

pwszExeFile
Path to the executable file to check

Return Value

Non-zero if elevation is required. Zero otherwise or if the function fails. GetLastError will provide additional information.

Remarks

pwszExeFile must be a path that makes PathIsExe returns TRUE. The function then calls CheckElevation from kernel32.dll and checks the info it returns against the current users token.

This function is also known as _IsElevationRequired@4.