Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Lois Gomez
wine
Commits
2d08d3e0
Commit
2d08d3e0
authored
15 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
wineboot: Use rundll32 to apply wine.inf instead of calling setupapi directly.
parent
18c6f23a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
programs/wineboot/Makefile.in
+1
-1
1 addition, 1 deletion
programs/wineboot/Makefile.in
programs/wineboot/wineboot.c
+47
-12
47 additions, 12 deletions
programs/wineboot/wineboot.c
with
48 additions
and
13 deletions
programs/wineboot/Makefile.in
+
1
−
1
View file @
2d08d3e0
...
...
@@ -6,7 +6,7 @@ VPATH = @srcdir@
MODULE
=
wineboot.exe
APPMODE
=
-mconsole
IMPORTS
=
uuid advapi32 kernel32 ntdll
DELAYIMPORTS
=
setupapi
shell32 shlwapi version user32
DELAYIMPORTS
=
shell32 shlwapi version user32
C_SRCS
=
\
shutdown.c
\
...
...
This diff is collapsed.
Click to expand it.
programs/wineboot/wineboot.c
+
47
−
12
View file @
2d08d3e0
...
...
@@ -81,7 +81,6 @@
#include
<shobjidl.h>
#include
<shlwapi.h>
#include
<shellapi.h>
#include
<setupapi.h>
WINE_DEFAULT_DEBUG_CHANNEL
(
wineboot
);
...
...
@@ -860,12 +859,49 @@ static BOOL start_services_process(void)
return
TRUE
;
}
static
HANDLE
start_rundll32
(
const
char
*
inf_path
)
{
static
const
WCHAR
rundll
[]
=
{
'\\'
,
'r'
,
'u'
,
'n'
,
'd'
,
'l'
,
'l'
,
'3'
,
'2'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
static
const
WCHAR
setupapi
[]
=
{
' '
,
's'
,
'e'
,
't'
,
'u'
,
'p'
,
'a'
,
'p'
,
'i'
,
','
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'H'
,
'i'
,
'n'
,
'f'
,
'S'
,
'e'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
definstall
[]
=
{
' '
,
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
inf
[]
=
{
' '
,
'1'
,
'2'
,
'8'
,
' '
,
'\\'
,
'\\'
,
'?'
,
'\\'
,
'u'
,
'n'
,
'i'
,
'x'
,
0
};
WCHAR
app
[
MAX_PATH
+
sizeof
(
rundll
)
/
sizeof
(
WCHAR
)];
STARTUPINFOW
si
;
PROCESS_INFORMATION
pi
;
WCHAR
*
buffer
;
DWORD
inf_len
,
cmd_len
;
memset
(
&
si
,
0
,
sizeof
(
si
)
);
si
.
cb
=
sizeof
(
si
);
GetSystemDirectoryW
(
app
,
MAX_PATH
);
strcatW
(
app
,
rundll
);
cmd_len
=
strlenW
(
app
)
*
sizeof
(
WCHAR
)
+
sizeof
(
setupapi
)
+
sizeof
(
definstall
)
+
sizeof
(
inf
);
inf_len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
inf_path
,
-
1
,
NULL
,
0
);
if
(
!
(
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cmd_len
+
inf_len
*
sizeof
(
WCHAR
)
)))
return
0
;
strcpyW
(
buffer
,
app
);
strcatW
(
buffer
,
setupapi
);
strcatW
(
buffer
,
definstall
);
strcatW
(
buffer
,
inf
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
inf_path
,
-
1
,
buffer
+
strlenW
(
buffer
),
inf_len
);
if
(
CreateProcessW
(
app
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
))
CloseHandle
(
pi
.
hThread
);
else
pi
.
hProcess
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
return
pi
.
hProcess
;
}
/* execute rundll32 on the wine.inf file if necessary */
static
void
update_wineprefix
(
int
force
)
{
static
const
WCHAR
cmdlineW
[]
=
{
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
' '
,
'1'
,
'2'
,
'8'
,
' '
,
'\\'
,
'\\'
,
'?'
,
'\\'
,
'u'
,
'n'
,
'i'
,
'x'
};
const
char
*
config_dir
=
wine_get_config_dir
();
char
*
inf_path
=
get_wine_inf_path
();
int
fd
;
...
...
@@ -887,14 +923,13 @@ static void update_wineprefix( int force )
if
(
update_timestamp
(
config_dir
,
st
.
st_mtime
)
||
force
)
{
WCHAR
*
buffer
;
DWORD
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
inf_path
,
-
1
,
NULL
,
0
);
if
(
!
(
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
cmdlineW
)
+
len
*
sizeof
(
WCHAR
)
)))
goto
done
;
memcpy
(
buffer
,
cmdlineW
,
sizeof
(
cmdlineW
)
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
inf_path
,
-
1
,
buffer
+
sizeof
(
cmdlineW
)
/
sizeof
(
WCHAR
),
len
);
InstallHinfSectionW
(
0
,
0
,
buffer
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
HANDLE
process
;
if
((
process
=
start_rundll32
(
inf_path
)))
{
WaitForSingleObject
(
process
,
INFINITE
);
CloseHandle
(
process
);
}
WINE_MESSAGE
(
"wine: configuration in '%s' has been updated.
\n
"
,
config_dir
);
}
...
...
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