Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6a3e79b0
Commit
6a3e79b0
authored
Sep 26, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Drop workarounds for Windows 2000.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
783c2d66
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
118 deletions
+42
-118
Makefile.in
dlls/msi/tests/Makefile.in
+1
-1
action.c
dlls/msi/tests/action.c
+3
-11
automation.c
dlls/msi/tests/automation.c
+2
-8
install.c
dlls/msi/tests/install.c
+1
-5
msi.c
dlls/msi/tests/msi.c
+21
-30
package.c
dlls/msi/tests/package.c
+10
-35
patch.c
dlls/msi/tests/patch.c
+1
-6
source.c
dlls/msi/tests/source.c
+3
-22
No files found.
dlls/msi/tests/Makefile.in
View file @
6a3e79b0
TESTDLL
=
msi.dll
IMPORTS
=
cabinet msi shell32 ole32 oleaut32 user32 advapi32 version odbccp32
IMPORTS
=
secur32
cabinet msi shell32 ole32 oleaut32 user32 advapi32 version odbccp32
custom_IMPORTS
=
uuid msi ole32 shell32 advapi32 odbccp32 oleaut32
...
...
dlls/msi/tests/action.c
View file @
6a3e79b0
...
...
@@ -34,6 +34,7 @@
#include <shellapi.h>
#include <winsvc.h>
#include <odbcinst.h>
#include <sddl.h>
#include "wine/test.h"
#include "utils.h"
...
...
@@ -50,11 +51,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
*
);
...
...
@@ -2356,6 +2355,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); \
...
...
@@ -2368,11 +2368,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
);
...
...
@@ -2386,17 +2384,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
);
p
ConvertSidToStringSidA
(
user
->
User
.
Sid
,
&
usersid
);
ConvertSidToStringSidA
(
user
->
User
.
Sid
,
&
usersid
);
HeapFree
(
GetProcessHeap
(),
0
,
user
);
CloseHandle
(
token
);
...
...
@@ -6467,7 +6460,6 @@ START_TEST(action)
if
(
ret
)
remove_restore_point
(
status
.
llSequenceNumber
);
}
FreeLibrary
(
hsrclient
);
SetCurrentDirectoryA
(
prev_path
);
}
dlls/msi/tests/automation.c
View file @
6a3e79b0
...
...
@@ -35,8 +35,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
);
...
...
@@ -219,8 +217,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
)
...
...
@@ -234,11 +230,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
)
||
!
p
CheckTokenMembership
(
NULL
,
Group
,
&
IsInGroup
))
!
CheckTokenMembership
(
NULL
,
Group
,
&
IsInGroup
))
{
trace
(
"Could not check if the current user is an administrator
\n
"
);
FreeSid
(
Group
);
...
...
@@ -252,7 +246,7 @@ static BOOL is_process_limited(void)
return
TRUE
;
}
if
(
p
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
))
if
(
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
))
{
BOOL
ret
;
TOKEN_ELEVATION_TYPE
type
=
TokenElevationTypeDefault
;
...
...
dlls/msi/tests/install.c
View file @
6a3e79b0
...
...
@@ -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
);
}
dlls/msi/tests/msi.c
View file @
6a3e79b0
...
...
@@ -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
);
p
ConvertSidToStringSidA
(
user
->
User
.
Sid
,
&
usersid
);
ConvertSidToStringSidA
(
user
->
User
.
Sid
,
&
usersid
);
HeapFree
(
GetProcessHeap
(),
0
,
user
);
CloseHandle
(
token
);
...
...
@@ -14445,33 +14443,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
();
...
...
dlls/msi/tests/package.c
View file @
6a3e79b0
...
...
@@ -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
)
||
!
p
CheckTokenMembership
(
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
)
||
!
p
CheckTokenMembership
(
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
(
p
OpenProcessToken
(
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
);
p
ConvertSidToStringSidA
(
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
)
p
GetNativeSystemInfo
(
&
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
);
p
GetSystemWow64DirectoryA
(
path
,
MAX_PATH
);
GetSystemWow64DirectoryA
(
path
,
MAX_PATH
);
strcat
(
path
,
"
\\
"
);
check_prop
(
hpkg
,
"SystemFolder"
,
path
);
...
...
dlls/msi/tests/patch.c
View file @
6a3e79b0
...
...
@@ -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
;
...
...
dlls/msi/tests/source.c
View file @
6a3e79b0
...
...
@@ -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
);
p
ConvertSidToStringSidA
(
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment