msi/tests: Handle running the tests as a domain user.
This commit is contained in:
parent
c98513f9c8
commit
215fd0b813
|
@ -27,10 +27,12 @@
|
||||||
#include <msidefs.h>
|
#include <msidefs.h>
|
||||||
#include <msi.h>
|
#include <msi.h>
|
||||||
#include <sddl.h>
|
#include <sddl.h>
|
||||||
|
#include <secext.h>
|
||||||
|
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
|
static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
|
||||||
|
static BOOLEAN (WINAPI *pGetUserNameExA)(EXTENDED_NAME_FORMAT, LPSTR, PULONG);
|
||||||
static UINT (WINAPI *pMsiSourceListAddMediaDiskA)
|
static UINT (WINAPI *pMsiSourceListAddMediaDiskA)
|
||||||
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPCSTR, LPCSTR);
|
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPCSTR, LPCSTR);
|
||||||
static UINT (WINAPI *pMsiSourceListAddSourceExA)
|
static UINT (WINAPI *pMsiSourceListAddSourceExA)
|
||||||
|
@ -51,6 +53,7 @@ static void init_functionpointers(void)
|
||||||
{
|
{
|
||||||
HMODULE hmsi = GetModuleHandleA("msi.dll");
|
HMODULE hmsi = GetModuleHandleA("msi.dll");
|
||||||
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
|
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
|
||||||
|
HMODULE hsecur32 = LoadLibraryA("secur32.dll");
|
||||||
|
|
||||||
#define GET_PROC(dll, func) \
|
#define GET_PROC(dll, func) \
|
||||||
p ## func = (void *)GetProcAddress(dll, #func); \
|
p ## func = (void *)GetProcAddress(dll, #func); \
|
||||||
|
@ -67,6 +70,8 @@ static void init_functionpointers(void)
|
||||||
|
|
||||||
GET_PROC(hadvapi32, ConvertSidToStringSidA)
|
GET_PROC(hadvapi32, ConvertSidToStringSidA)
|
||||||
|
|
||||||
|
GET_PROC(hsecur32, GetUserNameExA)
|
||||||
|
|
||||||
#undef GET_PROC
|
#undef GET_PROC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3139,12 +3144,16 @@ static void test_MsiSourceListAddSource(void)
|
||||||
|
|
||||||
/* MACHINENAME\username */
|
/* MACHINENAME\username */
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
GetComputerNameA(username, &size);
|
if (pGetUserNameExA != NULL)
|
||||||
lstrcatA(username, "\\");
|
pGetUserNameExA(NameSamCompatible, username, &size);
|
||||||
ptr = username + lstrlenA(username);
|
else
|
||||||
size = MAX_PATH;
|
{
|
||||||
GetUserNameA(ptr, &size);
|
GetComputerNameA(username, &size);
|
||||||
|
lstrcatA(username, "\\");
|
||||||
|
ptr = username + lstrlenA(username);
|
||||||
|
size = MAX_PATH - (ptr - username);
|
||||||
|
GetUserNameA(ptr, &size);
|
||||||
|
}
|
||||||
trace("username: %s\n", username);
|
trace("username: %s\n", username);
|
||||||
|
|
||||||
/* GetLastError is not set by the function */
|
/* GetLastError is not set by the function */
|
||||||
|
|
Loading…
Reference in New Issue