https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a49306360d3768ff25325…
commit a49306360d3768ff25325eded953a2c0c96d7bf6
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 23:57:45 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:28:02 2022 +0100
[WINESYNC] msi/tests: Drop workarounds for Windows 2000.
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 6a3e79b00225a1186a01101cd5614141748e6a53 by Hans Leidekker
<hans(a)codeweavers.com>
---
modules/rostests/winetests/msi/CMakeLists.txt | 2 +-
modules/rostests/winetests/msi/action.c | 14 ++------
modules/rostests/winetests/msi/automation.c | 10 ++----
modules/rostests/winetests/msi/install.c | 6 +---
modules/rostests/winetests/msi/msi.c | 51 +++++++++++----------------
modules/rostests/winetests/msi/package.c | 45 ++++++-----------------
modules/rostests/winetests/msi/patch.c | 7 +---
modules/rostests/winetests/msi/source.c | 25 ++-----------
8 files changed, 42 insertions(+), 118 deletions(-)
diff --git a/modules/rostests/winetests/msi/CMakeLists.txt
b/modules/rostests/winetests/msi/CMakeLists.txt
index 8a6c44c7070..03ad557e08b 100644
--- a/modules/rostests/winetests/msi/CMakeLists.txt
+++ b/modules/rostests/winetests/msi/CMakeLists.txt
@@ -54,7 +54,7 @@ endif()
target_link_libraries(msi_winetest uuid)
set_module_type(msi_winetest win32cui)
-add_importlibs(msi_winetest cabinet msi shell32 ole32 oleaut32 odbccp32 user32 advapi32
version msvcrt kernel32)
+add_importlibs(msi_winetest secur32 cabinet msi shell32 ole32 oleaut32 odbccp32 user32
advapi32 version msvcrt kernel32)
add_pch(msi_winetest precomp.h "${PCH_SKIP_SOURCE}")
add_rostests_file(TARGET msi_winetest)
add_dependencies(msi_winetest custom selfreg msi_winetest_idlheader stdole2)
diff --git a/modules/rostests/winetests/msi/action.c
b/modules/rostests/winetests/msi/action.c
index 59a369d31fe..1e7c8bcbc1e 100644
--- a/modules/rostests/winetests/msi/action.c
+++ b/modules/rostests/winetests/msi/action.c
@@ -37,6 +37,7 @@
#ifdef __REACTOS__
#include <oleauto.h>
#endif
+#include <sddl.h>
#include "wine/test.h"
#include "utils.h"
@@ -53,11 +54,9 @@ static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
static UINT (WINAPI *pMsiQueryFeatureStateExA)
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
-static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR *);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-static HMODULE hsrclient;
static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *);
@@ -2359,6 +2358,7 @@ static void init_functionpointers(void)
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
+ HMODULE hsrclient = LoadLibraryA("srclient.dll");
#define GET_PROC(mod, func) \
p ## func = (void*)GetProcAddress(mod, #func); \
@@ -2371,11 +2371,9 @@ static void init_functionpointers(void)
GET_PROC(hmsi, MsiGetComponentPathExA);
GET_PROC(hmsi, MsiQueryFeatureStateExA);
- GET_PROC(hadvapi32, ConvertSidToStringSidA);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
- hsrclient = LoadLibraryA("srclient.dll");
GET_PROC(hsrclient, SRRemoveRestorePoint);
GET_PROC(hsrclient, SRSetRestorePointA);
@@ -2389,17 +2387,12 @@ static char *get_user_sid(void)
TOKEN_USER *user;
char *usersid = NULL;
- if (!pConvertSidToStringSidA)
- {
- win_skip("ConvertSidToStringSidA is not available\n");
- return NULL;
- }
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
GetTokenInformation(token, TokenUser, NULL, size, &size);
user = HeapAlloc(GetProcessHeap(), 0, size);
GetTokenInformation(token, TokenUser, user, size, &size);
- pConvertSidToStringSidA(user->User.Sid, &usersid);
+ ConvertSidToStringSidA(user->User.Sid, &usersid);
HeapFree(GetProcessHeap(), 0, user);
CloseHandle(token);
@@ -6470,7 +6463,6 @@ START_TEST(action)
if (ret)
remove_restore_point(status.llSequenceNumber);
}
- FreeLibrary(hsrclient);
SetCurrentDirectoryA(prev_path);
}
diff --git a/modules/rostests/winetests/msi/automation.c
b/modules/rostests/winetests/msi/automation.c
index 3478149f429..d7fed415cda 100644
--- a/modules/rostests/winetests/msi/automation.c
+++ b/modules/rostests/winetests/msi/automation.c
@@ -39,8 +39,6 @@
static BOOL is_wow64;
-static BOOL (WINAPI *pCheckTokenMembership)(HANDLE,PSID,PBOOL);
-static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
@@ -223,8 +221,6 @@ static void init_functionpointers(void)
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
- GET_PROC(hadvapi32, CheckTokenMembership);
- GET_PROC(hadvapi32, OpenProcessToken);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
@@ -238,11 +234,9 @@ static BOOL is_process_limited(void)
BOOL IsInGroup;
HANDLE token;
- if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
-
if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group)
||
- !pCheckTokenMembership(NULL, Group, &IsInGroup))
+ !CheckTokenMembership(NULL, Group, &IsInGroup))
{
trace("Could not check if the current user is an administrator\n");
FreeSid(Group);
@@ -256,7 +250,7 @@ static BOOL is_process_limited(void)
return TRUE;
}
- if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
+ if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
{
BOOL ret;
TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
diff --git a/modules/rostests/winetests/msi/install.c
b/modules/rostests/winetests/msi/install.c
index 4fa186246a1..9c8652b353c 100644
--- a/modules/rostests/winetests/msi/install.c
+++ b/modules/rostests/winetests/msi/install.c
@@ -44,13 +44,11 @@ static UINT (WINAPI *pMsiSourceListEnumSourcesA)
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
-static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
static BOOL (WINAPI *pWow64DisableWow64FsRedirection)(void **);
static BOOL (WINAPI *pWow64RevertWow64FsRedirection)(void *);
-static HMODULE hsrclient = 0;
static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
@@ -2146,6 +2144,7 @@ static void init_functionpointers(void)
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
+ HMODULE hsrclient = LoadLibraryA("srclient.dll");
#define GET_PROC(mod, func) \
p ## func = (void*)GetProcAddress(mod, #func); \
@@ -2156,13 +2155,11 @@ static void init_functionpointers(void)
GET_PROC(hmsi, MsiSourceListEnumSourcesA);
GET_PROC(hmsi, MsiGetComponentPathExA);
- GET_PROC(hadvapi32, ConvertSidToStringSidA);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
GET_PROC(hkernel32, Wow64DisableWow64FsRedirection);
GET_PROC(hkernel32, Wow64RevertWow64FsRedirection);
- hsrclient = LoadLibraryA("srclient.dll");
GET_PROC(hsrclient, SRRemoveRestorePoint);
GET_PROC(hsrclient, SRSetRestorePointA);
@@ -6294,7 +6291,6 @@ START_TEST(install)
if (ret)
remove_restore_point(status.llSequenceNumber);
}
- FreeLibrary(hsrclient);
SetCurrentDirectoryA(prev_path);
}
diff --git a/modules/rostests/winetests/msi/msi.c b/modules/rostests/winetests/msi/msi.c
index 099ed1a3291..ee962b52f80 100644
--- a/modules/rostests/winetests/msi/msi.c
+++ b/modules/rostests/winetests/msi/msi.c
@@ -38,7 +38,6 @@ static BOOL is_wow64;
static const char msifile[] = "winetest.msi";
static const WCHAR msifileW[] =
{'w','i','n','e','t','e','s','t','.','m','s','i',0};
-static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
@@ -104,7 +103,6 @@ static void init_functionpointers(void)
GET_PROC(hmsi, MsiEnumComponentsExA)
GET_PROC(hmsi, MsiSourceListGetInfoA)
- GET_PROC(hadvapi32, ConvertSidToStringSidA)
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
@@ -1180,7 +1178,7 @@ static char *get_user_sid(void)
user = HeapAlloc(GetProcessHeap(), 0, size);
GetTokenInformation(token, TokenUser, user, size, &size);
- pConvertSidToStringSidA(user->User.Sid, &usersid);
+ ConvertSidToStringSidA(user->User.Sid, &usersid);
HeapFree(GetProcessHeap(), 0, user);
CloseHandle(token);
@@ -14462,33 +14460,26 @@ START_TEST(msi)
test_MsiGetFileHash();
test_MsiSetInternalUI();
test_MsiSetExternalUI();
-
- if (!pConvertSidToStringSidA)
- win_skip("ConvertSidToStringSidA not implemented\n");
- else
- {
- /* These tests rely on get_user_sid that needs ConvertSidToStringSidA */
- test_MsiQueryProductState();
- test_MsiQueryFeatureState();
- test_MsiQueryComponentState();
- test_MsiGetComponentPath();
- test_MsiGetComponentPathEx();
- test_MsiProvideComponent();
- test_MsiGetProductCode();
- test_MsiEnumClients();
- test_MsiGetProductInfo();
- test_MsiGetProductInfoEx();
- test_MsiGetUserInfo();
- test_MsiOpenProduct();
- test_MsiEnumPatchesEx();
- test_MsiEnumPatches();
- test_MsiGetPatchInfoEx();
- test_MsiGetPatchInfo();
- test_MsiEnumProducts();
- test_MsiEnumProductsEx();
- test_MsiEnumComponents();
- test_MsiEnumComponentsEx();
- }
+ test_MsiQueryProductState();
+ test_MsiQueryFeatureState();
+ test_MsiQueryComponentState();
+ test_MsiGetComponentPath();
+ test_MsiGetComponentPathEx();
+ test_MsiProvideComponent();
+ test_MsiGetProductCode();
+ test_MsiEnumClients();
+ test_MsiGetProductInfo();
+ test_MsiGetProductInfoEx();
+ test_MsiGetUserInfo();
+ test_MsiOpenProduct();
+ test_MsiEnumPatchesEx();
+ test_MsiEnumPatches();
+ test_MsiGetPatchInfoEx();
+ test_MsiGetPatchInfo();
+ test_MsiEnumProducts();
+ test_MsiEnumProductsEx();
+ test_MsiEnumComponents();
+ test_MsiEnumComponentsEx();
test_MsiGetFileVersion();
test_MsiGetFileSignatureInformation();
test_MsiConfigureProductEx();
diff --git a/modules/rostests/winetests/msi/package.c
b/modules/rostests/winetests/msi/package.c
index d6d90ce39fb..d5f156825df 100644
--- a/modules/rostests/winetests/msi/package.c
+++ b/modules/rostests/winetests/msi/package.c
@@ -29,6 +29,7 @@
#include <msiquery.h>
#include <srrestoreptapi.h>
#include <shlobj.h>
+#include <sddl.h>
#include "wine/test.h"
@@ -39,18 +40,10 @@ static const WCHAR msifileW[] =
static char CURR_DIR[MAX_PATH];
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR,
MSIINSTALLCONTEXT, LPSTR, LPDWORD);
-static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
-static BOOL (WINAPI *pCheckTokenMembership)(HANDLE,PSID,PBOOL);
-static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
-static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-static void (WINAPI *pGetSystemInfo)(LPSYSTEM_INFO);
-static void (WINAPI *pGetNativeSystemInfo)(LPSYSTEM_INFO);
-static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR, UINT);
-
static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
@@ -59,28 +52,20 @@ static void init_functionpointers(void)
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
- HMODULE hshell32 = GetModuleHandleA("shell32.dll");
- HMODULE hsrclient;
+ HMODULE hsrclient = LoadLibraryA("srclient.dll");
#define GET_PROC(mod, func) \
p ## func = (void*)GetProcAddress(mod, #func);
GET_PROC(hmsi, MsiGetComponentPathExA);
- GET_PROC(hshell32, SHGetFolderPathA);
- GET_PROC(hadvapi32, CheckTokenMembership);
- GET_PROC(hadvapi32, ConvertSidToStringSidA);
- GET_PROC(hadvapi32, OpenProcessToken);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hadvapi32, RegDeleteKeyExW)
GET_PROC(hkernel32, IsWow64Process)
- GET_PROC(hkernel32, GetNativeSystemInfo)
- GET_PROC(hkernel32, GetSystemInfo)
- GET_PROC(hkernel32, GetSystemWow64DirectoryA)
- hsrclient = LoadLibraryA("srclient.dll");
GET_PROC(hsrclient, SRRemoveRestorePoint);
GET_PROC(hsrclient, SRSetRestorePointA);
+
#undef GET_PROC
}
@@ -91,11 +76,9 @@ static BOOL is_process_limited(void)
BOOL IsInGroup;
HANDLE token;
- if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
-
if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group)
||
- !pCheckTokenMembership(NULL, Group, &IsInGroup))
+ !CheckTokenMembership(NULL, Group, &IsInGroup))
{
trace("Could not check if the current user is an administrator\n");
FreeSid(Group);
@@ -109,7 +92,7 @@ static BOOL is_process_limited(void)
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_POWER_USERS,
0, 0, 0, 0, 0, 0, &Group) ||
- !pCheckTokenMembership(NULL, Group, &IsInGroup))
+ !CheckTokenMembership(NULL, Group, &IsInGroup))
{
trace("Could not check if the current user is a power user\n");
return FALSE;
@@ -121,7 +104,7 @@ static BOOL is_process_limited(void)
}
}
- if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
+ if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
{
BOOL ret;
TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
@@ -148,17 +131,12 @@ static char *get_user_sid(void)
TOKEN_USER *user;
char *usersid = NULL;
- if (!pConvertSidToStringSidA)
- {
- win_skip("ConvertSidToStringSidA is not available\n");
- return NULL;
- }
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
GetTokenInformation(token, TokenUser, NULL, size, &size);
user = HeapAlloc(GetProcessHeap(), 0, size);
GetTokenInformation(token, TokenUser, user, size, &size);
- pConvertSidToStringSidA(user->User.Sid, &usersid);
+ ConvertSidToStringSidA(user->User.Sid, &usersid);
HeapFree(GetProcessHeap(), 0, user);
CloseHandle(token);
@@ -4705,7 +4683,7 @@ static void test_appsearch_reglocator(void)
ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got
\"%s\"\n", prop);
memset(&si, 0, sizeof(si));
- if (pGetNativeSystemInfo) pGetNativeSystemInfo(&si);
+ GetNativeSystemInfo(&si);
if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
{
@@ -5721,10 +5699,7 @@ static void test_installprops(void)
r = MsiGetPropertyA(hpkg, "MsiNetAssemblySupport", buf, &size);
if (r == ERROR_SUCCESS) trace( "MsiNetAssemblySupport \"%s\"\n",
buf );
- if (pGetNativeSystemInfo)
- pGetNativeSystemInfo(&si);
- else
- pGetSystemInfo(&si);
+ GetNativeSystemInfo(&si);
if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
{
@@ -5739,7 +5714,7 @@ static void test_installprops(void)
strcat(path, "\\");
check_prop(hpkg, "System64Folder", path);
- pGetSystemWow64DirectoryA(path, MAX_PATH);
+ GetSystemWow64DirectoryA(path, MAX_PATH);
strcat(path, "\\");
check_prop(hpkg, "SystemFolder", path);
diff --git a/modules/rostests/winetests/msi/patch.c
b/modules/rostests/winetests/msi/patch.c
index b5779824430..63d38b8ff9b 100644
--- a/modules/rostests/winetests/msi/patch.c
+++ b/modules/rostests/winetests/msi/patch.c
@@ -36,7 +36,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 *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
static const char *msifile = "winetest-patch.msi";
static const char *mspfile = "winetest-patch.msp";
@@ -145,7 +144,6 @@ static const struct msi_table tables[] =
static void init_function_pointers( void )
{
HMODULE hmsi = GetModuleHandleA( "msi.dll" );
- HMODULE hadvapi32 = GetModuleHandleA( "advapi32.dll" );
#define GET_PROC( mod, func ) \
p ## func = (void *)GetProcAddress( mod, #func ); \
@@ -156,7 +154,6 @@ static void init_function_pointers( void )
GET_PROC( hmsi, MsiGetPatchInfoExA );
GET_PROC( hmsi, MsiEnumPatchesExA );
- GET_PROC( hadvapi32, OpenProcessToken );
#undef GET_PROC
}
@@ -164,9 +161,7 @@ static BOOL is_process_limited(void)
{
HANDLE token;
- if (!pOpenProcessToken) return FALSE;
-
- if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
+ if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
{
BOOL ret;
TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
diff --git a/modules/rostests/winetests/msi/source.c
b/modules/rostests/winetests/msi/source.c
index a03cf557aaf..654df35f540 100644
--- a/modules/rostests/winetests/msi/source.c
+++ b/modules/rostests/winetests/msi/source.c
@@ -34,9 +34,7 @@
static BOOL is_wow64;
-static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
-static BOOLEAN (WINAPI *pGetUserNameExA)(EXTENDED_NAME_FORMAT, LPSTR, PULONG);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
static UINT (WINAPI *pMsiSourceListAddMediaDiskA)
@@ -60,7 +58,6 @@ static void init_functionpointers(void)
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
- HMODULE hsecur32 = LoadLibraryA("secur32.dll");
#define GET_PROC(dll, func) \
p ## func = (void *)GetProcAddress(dll, #func); \
@@ -75,10 +72,8 @@ static void init_functionpointers(void)
GET_PROC(hmsi, MsiSourceListSetInfoA)
GET_PROC(hmsi, MsiSourceListAddSourceA)
- GET_PROC(hadvapi32, ConvertSidToStringSidA)
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
- GET_PROC(hsecur32, GetUserNameExA)
#undef GET_PROC
}
@@ -142,17 +137,12 @@ static char *get_user_sid(void)
TOKEN_USER *user;
char *usersid = NULL;
- if (!pConvertSidToStringSidA)
- {
- win_skip("ConvertSidToStringSidA is not available\n");
- return NULL;
- }
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
GetTokenInformation(token, TokenUser, NULL, size, &size);
user = HeapAlloc(GetProcessHeap(), 0, size);
GetTokenInformation(token, TokenUser, user, size, &size);
- pConvertSidToStringSidA(user->User.Sid, &usersid);
+ ConvertSidToStringSidA(user->User.Sid, &usersid);
HeapFree(GetProcessHeap(), 0, user);
CloseHandle(token);
@@ -3241,7 +3231,7 @@ static void test_MsiSourceListAddSource(void)
CHAR prod_squashed[MAX_PATH];
CHAR keypath[MAX_PATH*2];
CHAR username[MAX_PATH];
- LPSTR usersid, ptr;
+ LPSTR usersid;
LONG res;
UINT r;
HKEY prodkey, userkey, net, source;
@@ -3263,16 +3253,7 @@ static void test_MsiSourceListAddSource(void)
/* MACHINENAME\username */
size = MAX_PATH;
- if (pGetUserNameExA != NULL)
- pGetUserNameExA(NameSamCompatible, username, &size);
- else
- {
- GetComputerNameA(username, &size);
- lstrcatA(username, "\\");
- ptr = username + lstrlenA(username);
- size = MAX_PATH - (ptr - username);
- GetUserNameA(ptr, &size);
- }
+ GetUserNameExA(NameSamCompatible, username, &size);
trace("username: %s\n", username);
if (is_wow64)