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
4df23731
Commit
4df23731
authored
Apr 28, 2006
by
James Hawkins
Committed by
Alexandre Julliard
May 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advpack: Implement the CheckAdminRights option.
parent
c9cff908
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
install.c
dlls/advpack/install.c
+26
-0
No files found.
dlls/advpack/install.c
View file @
4df23731
...
...
@@ -57,6 +57,9 @@ typedef struct _ADVInfo
typedef
HRESULT
(
*
iterate_fields_func
)(
HINF
hinf
,
PCWSTR
field
,
void
*
arg
);
/* Advanced INF commands */
static
const
WCHAR
CheckAdminRights
[]
=
{
'C'
,
'h'
,
'e'
,
'c'
,
'k'
,
'A'
,
'd'
,
'm'
,
'i'
,
'n'
,
'R'
,
'i'
,
'g'
,
'h'
,
't'
,
's'
,
0
};
static
const
WCHAR
PerUserInstall
[]
=
{
'P'
,
'e'
,
'r'
,
'U'
,
's'
,
'e'
,
'r'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
RegisterOCXs
[]
=
{
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'e'
,
'r'
,
'O'
,
'C'
,
'X'
,
's'
,
0
};
static
const
WCHAR
RunPreSetupCommands
[]
=
{
...
...
@@ -254,6 +257,25 @@ static HRESULT iterate_section_fields(HINF hinf, PCWSTR section, PCWSTR key,
return
hr
;
}
static
HRESULT
check_admin_rights
(
ADVInfo
*
info
)
{
INT
check
;
INFCONTEXT
context
;
HRESULT
hr
=
S_OK
;
if
(
!
SetupFindFirstLineW
(
info
->
hinf
,
info
->
install_sec
,
CheckAdminRights
,
&
context
))
return
S_OK
;
if
(
!
SetupGetIntField
(
&
context
,
1
,
&
check
))
return
S_OK
;
if
(
check
==
1
)
hr
=
IsNTAdmin
(
0
,
NULL
)
?
S_OK
:
E_FAIL
;
return
hr
;
}
/* performs a setupapi-level install of the INF file */
static
HRESULT
spapi_install
(
ADVInfo
*
info
)
{
...
...
@@ -294,6 +316,10 @@ static HRESULT adv_install(ADVInfo *info)
{
HRESULT
hr
;
hr
=
check_admin_rights
(
info
);
if
(
hr
!=
S_OK
)
return
hr
;
hr
=
iterate_section_fields
(
info
->
hinf
,
info
->
install_sec
,
RunPreSetupCommands
,
run_setup_commands_callback
,
info
);
if
(
hr
!=
S_OK
)
...
...
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