Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
90aadc70
Commit
90aadc70
authored
May 16, 2021
by
Zebediah Figura
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Create the custom action server as an elevated process.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51143
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
parent
77d40cf4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
custom.c
dlls/msi/custom.c
+22
-2
No files found.
dlls/msi/custom.c
View file @
90aadc70
...
...
@@ -572,12 +572,28 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid)
return
r
;
}
static
HANDLE
get_admin_token
(
void
)
{
TOKEN_ELEVATION_TYPE
type
;
TOKEN_LINKED_TOKEN
linked
;
DWORD
size
;
if
(
!
GetTokenInformation
(
GetCurrentThreadEffectiveToken
(),
TokenElevationType
,
&
type
,
sizeof
(
type
),
&
size
)
||
type
==
TokenElevationTypeFull
)
return
NULL
;
if
(
!
GetTokenInformation
(
GetCurrentThreadEffectiveToken
(),
TokenLinkedToken
,
&
linked
,
sizeof
(
linked
),
&
size
))
return
NULL
;
return
linked
.
LinkedToken
;
}
static
DWORD
custom_start_server
(
MSIPACKAGE
*
package
,
DWORD
arch
)
{
WCHAR
path
[
MAX_PATH
],
cmdline
[
MAX_PATH
+
23
];
PROCESS_INFORMATION
pi
=
{
0
};
STARTUPINFOW
si
=
{
0
};
WCHAR
buffer
[
24
];
HANDLE
token
;
void
*
cookie
;
HANDLE
pipe
;
...
...
@@ -599,14 +615,18 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch)
lstrcatW
(
path
,
L"
\\
msiexec.exe"
);
swprintf
(
cmdline
,
ARRAY_SIZE
(
cmdline
),
L"%s -Embedding %d"
,
path
,
GetCurrentProcessId
());
token
=
get_admin_token
();
if
(
is_wow64
&&
arch
==
SCS_64BIT_BINARY
)
{
Wow64DisableWow64FsRedirection
(
&
cookie
);
CreateProcess
W
(
path
,
cmdline
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
CreateProcess
AsUserW
(
token
,
path
,
cmdline
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
Wow64RevertWow64FsRedirection
(
cookie
);
}
else
CreateProcessW
(
path
,
cmdline
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
CreateProcessAsUserW
(
token
,
path
,
cmdline
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
if
(
token
)
CloseHandle
(
token
);
CloseHandle
(
pi
.
hThread
);
...
...
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