msi/tests: Use always static binding for GetTokenInformation.
This commit is contained in:
parent
35eef16ba7
commit
a7e1b7c6ea
|
@ -41,7 +41,6 @@ static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
|
|||
(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
|
||||
|
||||
static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR *);
|
||||
static BOOL (WINAPI *pGetTokenInformation)(HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD);
|
||||
static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE);
|
||||
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
|
||||
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
|
||||
|
@ -2014,7 +2013,6 @@ static void init_functionpointers(void)
|
|||
GET_PROC(hmsi, MsiGetComponentPathExA);
|
||||
|
||||
GET_PROC(hadvapi32, ConvertSidToStringSidA);
|
||||
GET_PROC(hadvapi32, GetTokenInformation);
|
||||
GET_PROC(hadvapi32, OpenProcessToken);
|
||||
GET_PROC(hadvapi32, RegDeleteKeyExA)
|
||||
GET_PROC(hkernel32, IsWow64Process)
|
||||
|
@ -2030,7 +2028,7 @@ static BOOL is_process_limited(void)
|
|||
{
|
||||
HANDLE token;
|
||||
|
||||
if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
|
||||
if (!pOpenProcessToken) return FALSE;
|
||||
|
||||
if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
|
||||
{
|
||||
|
@ -2038,7 +2036,7 @@ static BOOL is_process_limited(void)
|
|||
TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
|
||||
DWORD size;
|
||||
|
||||
ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
|
||||
ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
|
||||
CloseHandle(token);
|
||||
return (ret && type == TokenElevationTypeLimited);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@ static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
|
|||
(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
|
||||
|
||||
static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
|
||||
static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
|
||||
static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
|
||||
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
|
||||
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
|
||||
|
@ -2115,7 +2114,6 @@ static void init_functionpointers(void)
|
|||
GET_PROC(hmsi, MsiGetComponentPathExA);
|
||||
|
||||
GET_PROC(hadvapi32, ConvertSidToStringSidA);
|
||||
GET_PROC(hadvapi32, GetTokenInformation);
|
||||
GET_PROC(hadvapi32, OpenProcessToken);
|
||||
GET_PROC(hadvapi32, RegDeleteKeyExA)
|
||||
GET_PROC(hkernel32, IsWow64Process)
|
||||
|
@ -2131,7 +2129,7 @@ static BOOL is_process_limited(void)
|
|||
{
|
||||
HANDLE token;
|
||||
|
||||
if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
|
||||
if (!pOpenProcessToken) return FALSE;
|
||||
|
||||
if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
|
||||
{
|
||||
|
@ -2139,7 +2137,7 @@ static BOOL is_process_limited(void)
|
|||
TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
|
||||
DWORD size;
|
||||
|
||||
ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
|
||||
ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
|
||||
CloseHandle(token);
|
||||
return (ret && type == TokenElevationTypeLimited);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,6 @@ static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MS
|
|||
static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
|
||||
|
||||
static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
|
||||
static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
|
||||
static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
|
||||
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
|
||||
static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
|
||||
|
@ -68,7 +67,6 @@ static void init_functionpointers(void)
|
|||
GET_PROC(hshell32, SHGetFolderPathA);
|
||||
|
||||
GET_PROC(hadvapi32, ConvertSidToStringSidA);
|
||||
GET_PROC(hadvapi32, GetTokenInformation);
|
||||
GET_PROC(hadvapi32, OpenProcessToken);
|
||||
GET_PROC(hadvapi32, RegDeleteKeyExA)
|
||||
GET_PROC(hadvapi32, RegDeleteKeyExW)
|
||||
|
@ -87,7 +85,7 @@ static BOOL is_process_limited(void)
|
|||
{
|
||||
HANDLE token;
|
||||
|
||||
if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
|
||||
if (!pOpenProcessToken) return FALSE;
|
||||
|
||||
if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
|
||||
{
|
||||
|
@ -95,7 +93,7 @@ static BOOL is_process_limited(void)
|
|||
TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
|
||||
DWORD size;
|
||||
|
||||
ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
|
||||
ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
|
||||
CloseHandle(token);
|
||||
return (ret && type == TokenElevationTypeLimited);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ static UINT (WINAPI *pMsiGetPatchInfoExA)( LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCON
|
|||
LPCSTR, LPSTR, DWORD * );
|
||||
static UINT (WINAPI *pMsiEnumPatchesExA)( LPCSTR, LPCSTR, DWORD, DWORD, DWORD, LPSTR,
|
||||
LPSTR, MSIINSTALLCONTEXT *, LPSTR, LPDWORD );
|
||||
static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
|
||||
static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
|
||||
|
||||
static const char *msifile = "winetest-patch.msi";
|
||||
|
@ -152,7 +151,6 @@ static void init_function_pointers( void )
|
|||
GET_PROC( hmsi, MsiGetPatchInfoExA );
|
||||
GET_PROC( hmsi, MsiEnumPatchesExA );
|
||||
|
||||
GET_PROC( hadvapi32, GetTokenInformation );
|
||||
GET_PROC( hadvapi32, OpenProcessToken );
|
||||
#undef GET_PROC
|
||||
}
|
||||
|
@ -161,7 +159,7 @@ static BOOL is_process_limited(void)
|
|||
{
|
||||
HANDLE token;
|
||||
|
||||
if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
|
||||
if (!pOpenProcessToken) return FALSE;
|
||||
|
||||
if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
|
||||
{
|
||||
|
@ -169,7 +167,7 @@ static BOOL is_process_limited(void)
|
|||
TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
|
||||
DWORD size;
|
||||
|
||||
ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
|
||||
ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
|
||||
CloseHandle(token);
|
||||
return (ret && type == TokenElevationTypeLimited);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue