Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
c559895c
Commit
c559895c
authored
Sep 01, 2008
by
Paul Vriens
Committed by
Alexandre Julliard
Sep 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Create a system restore point when needed.
parent
262b551a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
5 deletions
+54
-5
install.c
dlls/msi/tests/install.c
+54
-5
No files found.
dlls/msi/tests/install.c
View file @
c559895c
...
...
@@ -29,6 +29,7 @@
#include <msi.h>
#include <fci.h>
#include <objidl.h>
#include <srrestoreptapi.h>
#include "wine/test.h"
...
...
@@ -39,6 +40,10 @@ static UINT (WINAPI *pMsiSourceListEnumSourcesA)
static
UINT
(
WINAPI
*
pMsiSourceListGetInfoA
)
(
LPCSTR
,
LPCSTR
,
MSIINSTALLCONTEXT
,
DWORD
,
LPCSTR
,
LPSTR
,
LPDWORD
);
static
HMODULE
hsrclient
=
0
;
static
BOOL
(
WINAPI
*
pSRRemoveRestorePoint
)(
DWORD
);
static
BOOL
(
WINAPI
*
pSRSetRestorePointA
)(
RESTOREPOINTINFOA
*
,
STATEMGRSTATUS
*
);
static
const
char
*
msifile
=
"msitest.msi"
;
static
const
char
*
msifile2
=
"winetest2.msi"
;
static
const
char
*
mstfile
=
"winetest.mst"
;
...
...
@@ -1271,14 +1276,18 @@ static void init_functionpointers(void)
{
HMODULE
hmsi
=
GetModuleHandleA
(
"msi.dll"
);
#define GET_PROC(func) \
p ## func = (void*)GetProcAddress(
hmsi
, #func); \
#define GET_PROC(
mod,
func) \
p ## func = (void*)GetProcAddress(
mod
, #func); \
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
GET_PROC
(
MsiQueryComponentStateA
);
GET_PROC
(
MsiSourceListEnumSourcesA
);
GET_PROC
(
MsiSourceListGetInfoA
);
GET_PROC
(
hmsi
,
MsiQueryComponentStateA
);
GET_PROC
(
hmsi
,
MsiSourceListEnumSourcesA
);
GET_PROC
(
hmsi
,
MsiSourceListGetInfoA
);
hsrclient
=
LoadLibraryA
(
"srclient.dll"
);
GET_PROC
(
hsrclient
,
SRRemoveRestorePoint
);
GET_PROC
(
hsrclient
,
SRSetRestorePointA
);
#undef GET_PROC
}
...
...
@@ -1618,6 +1627,27 @@ static void check_service_is_installed(void)
CloseServiceHandle
(
scm
);
}
static
BOOL
notify_system_change
(
DWORD
event_type
,
STATEMGRSTATUS
*
status
)
{
RESTOREPOINTINFOA
spec
;
spec
.
dwEventType
=
event_type
;
spec
.
dwRestorePtType
=
APPLICATION_INSTALL
;
spec
.
llSequenceNumber
=
status
->
llSequenceNumber
;
lstrcpyA
(
spec
.
szDescription
,
"msitest restore point"
);
return
pSRSetRestorePointA
(
&
spec
,
status
);
}
static
void
remove_restore_point
(
DWORD
seq_number
)
{
DWORD
res
;
res
=
pSRRemoveRestorePoint
(
seq_number
);
if
(
res
!=
ERROR_SUCCESS
)
trace
(
"Failed to remove the restore point : %08x
\n
"
,
res
);
}
static
void
test_MsiInstallProduct
(
void
)
{
UINT
r
;
...
...
@@ -5402,6 +5432,8 @@ START_TEST(install)
{
DWORD
len
;
char
temp_path
[
MAX_PATH
],
prev_path
[
MAX_PATH
];
STATEMGRSTATUS
status
;
BOOL
ret
=
FALSE
;
init_functionpointers
();
...
...
@@ -5417,6 +5449,15 @@ START_TEST(install)
get_program_files_dir
(
PROG_FILES_DIR
,
COMMON_FILES_DIR
);
/* Create a restore point ourselves so we circumvent the multitude of restore points
* that would have been created by all the installation and removal tests.
*/
if
(
pSRSetRestorePointA
)
{
memset
(
&
status
,
0
,
sizeof
(
status
));
ret
=
notify_system_change
(
BEGIN_NESTED_SYSTEM_CHANGE
,
&
status
);
}
test_MsiInstallProduct
();
test_MsiSetComponentState
();
test_packagecoltypes
();
...
...
@@ -5453,5 +5494,13 @@ START_TEST(install)
test_MsiConfigureProductEx
();
test_missingcomponent
();
if
(
pSRSetRestorePointA
&&
ret
)
{
ret
=
notify_system_change
(
END_NESTED_SYSTEM_CHANGE
,
&
status
);
if
(
ret
)
remove_restore_point
(
status
.
llSequenceNumber
);
}
FreeLibrary
(
hsrclient
);
SetCurrentDirectoryA
(
prev_path
);
}
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