Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
167ef047
Commit
167ef047
authored
15 years ago
by
Ge van Geldorp
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
msi/tests: Create only a single restore point.
parent
87779948
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/msi/tests/package.c
+48
-0
48 additions, 0 deletions
dlls/msi/tests/package.c
with
48 additions
and
0 deletions
dlls/msi/tests/package.c
+
48
−
0
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
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment