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
c67728f7
Commit
c67728f7
authored
Mar 17, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Added support for calling executables in a RegisterDlls section.
parent
ac602513
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
install.c
dlls/setupapi/install.c
+40
-0
No files found.
dlls/setupapi/install.c
View file @
c67728f7
...
...
@@ -444,6 +444,7 @@ static BOOL do_register_dll( const struct register_dll_info *info, const WCHAR *
HMODULE
module
;
HRESULT
res
;
SP_REGISTER_CONTROL_STATUSW
status
;
IMAGE_NT_HEADERS
*
nt
;
status
.
cbSize
=
sizeof
(
status
);
status
.
FileName
=
path
;
...
...
@@ -473,6 +474,45 @@ static BOOL do_register_dll( const struct register_dll_info *info, const WCHAR *
goto
done
;
}
if
((
nt
=
RtlImageNtHeader
(
module
))
&&
!
(
nt
->
FileHeader
.
Characteristics
&
IMAGE_FILE_DLL
))
{
/* file is an executable, not a dll */
STARTUPINFOW
startup
;
PROCESS_INFORMATION
info
;
WCHAR
*
cmd_line
;
BOOL
res
;
static
const
WCHAR
format
[]
=
{
'"'
,
'%'
,
's'
,
'"'
,
' '
,
'%'
,
's'
,
0
};
static
const
WCHAR
default_args
[]
=
{
'/'
,
'R'
,
'e'
,
'g'
,
'S'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
0
};
FreeLibrary
(
module
);
module
=
NULL
;
if
(
!
args
)
args
=
default_args
;
cmd_line
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
path
)
+
strlenW
(
args
)
+
4
)
*
sizeof
(
WCHAR
)
);
sprintfW
(
cmd_line
,
format
,
path
,
args
);
memset
(
&
startup
,
0
,
sizeof
(
startup
)
);
startup
.
cb
=
sizeof
(
startup
);
TRACE
(
"executing %s
\n
"
,
debugstr_w
(
cmd_line
)
);
res
=
CreateProcessW
(
NULL
,
cmd_line
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
startup
,
&
info
);
HeapFree
(
GetProcessHeap
(),
0
,
cmd_line
);
if
(
!
res
)
{
status
.
FailureCode
=
SPREG_LOADLIBRARY
;
status
.
Win32Error
=
GetLastError
();
goto
done
;
}
CloseHandle
(
info
.
hThread
);
if
(
WaitForSingleObject
(
info
.
hProcess
,
timeout
*
1000
)
==
WAIT_TIMEOUT
)
{
/* timed out, kill the process */
TerminateProcess
(
info
.
hProcess
,
1
);
status
.
FailureCode
=
SPREG_TIMEOUT
;
status
.
Win32Error
=
ERROR_TIMEOUT
;
}
CloseHandle
(
info
.
hProcess
);
goto
done
;
}
if
(
flags
&
FLG_REGSVR_DLLREGISTER
)
{
const
char
*
entry_point
=
info
->
unregister
?
"DllUnregisterServer"
:
"DllRegisterServer"
;
...
...
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