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
167ef047
Commit
167ef047
authored
Aug 28, 2009
by
Ge van Geldorp
Committed by
Alexandre Julliard
Aug 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Create only a single restore point.
parent
87779948
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
package.c
dlls/msi/tests/package.c
+48
-0
No files found.
dlls/msi/tests/package.c
View file @
167ef047
...
...
@@ -26,6 +26,7 @@
#include <msidefs.h>
#include <msi.h>
#include <msiquery.h>
#include <srrestoreptapi.h>
#include "wine/test.h"
...
...
@@ -36,10 +37,14 @@ static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
static
BOOL
(
WINAPI
*
pConvertSidToStringSidA
)(
PSID
,
LPSTR
*
);
static
BOOL
(
WINAPI
*
pSRRemoveRestorePoint
)(
DWORD
);
static
BOOL
(
WINAPI
*
pSRSetRestorePointA
)(
RESTOREPOINTINFOA
*
,
STATEMGRSTATUS
*
);
static
void
init_functionpointers
(
void
)
{
HMODULE
hmsi
=
GetModuleHandleA
(
"msi.dll"
);
HMODULE
hadvapi32
=
GetModuleHandleA
(
"advapi32.dll"
);
HMODULE
hsrclient
;
#define GET_PROC(mod, func) \
p ## func = (void*)GetProcAddress(mod, #func);
...
...
@@ -48,6 +53,9 @@ static void init_functionpointers(void)
GET_PROC
(
hadvapi32
,
ConvertSidToStringSidA
);
hsrclient
=
LoadLibraryA
(
"srclient.dll"
);
GET_PROC
(
hsrclient
,
SRRemoveRestorePoint
);
GET_PROC
(
hsrclient
,
SRSetRestorePointA
);
#undef GET_PROC
}
...
...
@@ -774,6 +782,27 @@ done:
return
ret
;
}
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_createpackage
(
void
)
{
MSIHANDLE
hPackage
=
0
;
...
...
@@ -11870,10 +11899,22 @@ static void test_MsiApplyPatch(void)
START_TEST
(
package
)
{
STATEMGRSTATUS
status
;
BOOL
ret
=
FALSE
;
init_functionpointers
();
GetCurrentDirectoryA
(
MAX_PATH
,
CURR_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_createpackage
();
test_doaction
();
test_gettargetpath_bad
();
...
...
@@ -11905,4 +11946,11 @@ START_TEST(package)
test_MsiSetProperty
();
test_MsiApplyMultiplePatches
();
test_MsiApplyPatch
();
if
(
pSRSetRestorePointA
&&
ret
)
{
ret
=
notify_system_change
(
END_NESTED_SYSTEM_CHANGE
,
&
status
);
if
(
ret
)
remove_restore_point
(
status
.
llSequenceNumber
);
}
}
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