Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
480b6495
Commit
480b6495
authored
Mar 26, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Mar 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advpack: Implement the launching of executables in RunSetupCommand.
parent
e4b31800
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
10 deletions
+40
-10
install.c
dlls/advpack/install.c
+39
-3
install.c
dlls/advpack/tests/install.c
+1
-7
No files found.
dlls/advpack/install.c
View file @
480b6495
...
...
@@ -156,6 +156,39 @@ HRESULT WINAPI LaunchINFSectionExA( HWND hWnd, HINSTANCE hInst, LPSTR cmdline, I
return
E_FAIL
;
}
static
HRESULT
launch_exe
(
LPCWSTR
cmd
,
LPCWSTR
dir
,
HANDLE
*
phEXE
)
{
STARTUPINFOW
si
;
PROCESS_INFORMATION
pi
;
if
(
phEXE
)
*
phEXE
=
NULL
;
ZeroMemory
(
&
pi
,
sizeof
(
pi
));
ZeroMemory
(
&
si
,
sizeof
(
si
));
si
.
cb
=
sizeof
(
si
);
if
(
!
CreateProcessW
(
NULL
,
(
LPWSTR
)
cmd
,
NULL
,
NULL
,
FALSE
,
CREATE_DEFAULT_ERROR_MODE
|
CREATE_NEW_PROCESS_GROUP
,
NULL
,
dir
,
&
si
,
&
pi
))
{
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
CloseHandle
(
pi
.
hThread
);
if
(
phEXE
)
{
*
phEXE
=
pi
.
hProcess
;
return
S_ASYNCHRONOUS
;
}
/* wait for the child process to finish */
WaitForSingleObject
(
pi
.
hProcess
,
INFINITE
);
CloseHandle
(
pi
.
hProcess
);
return
S_OK
;
}
/***********************************************************************
* RunSetupCommandA (ADVPACK.@)
*
...
...
@@ -220,23 +253,26 @@ HRESULT WINAPI RunSetupCommandA(HWND hWnd, LPCSTR szCmdName,
* HRESULT_FROM_WIN32(GetLastError()) Some other error
*
* BUGS
*
Unimplemented
*
INF install unimplemented.
*/
HRESULT
WINAPI
RunSetupCommandW
(
HWND
hWnd
,
LPCWSTR
szCmdName
,
LPCWSTR
szInfSection
,
LPCWSTR
szDir
,
LPCWSTR
lpszTitle
,
HANDLE
*
phEXE
,
DWORD
dwFlags
,
LPVOID
pvReserved
)
{
FIXME
(
"(%p, %s, %s, %s, %s, %p, 0x%08lx, %p): stub
\n
"
,
TRACE
(
"(%p, %s, %s, %s, %s, %p, 0x%08lx, %p)
\n
"
,
hWnd
,
debugstr_w
(
szCmdName
),
debugstr_w
(
szInfSection
),
debugstr_w
(
szDir
),
debugstr_w
(
lpszTitle
),
phEXE
,
dwFlags
,
pvReserved
);
if
(
dwFlags
)
FIXME
(
"Unhandled flags: 0x%08lx
\n
"
,
dwFlags
);
if
(
!
szCmdName
||
!
szDir
)
return
E_INVALIDARG
;
if
(
!
(
dwFlags
&
RSC_FLAG_INF
))
*
phEXE
=
NULL
;
return
launch_exe
(
szCmdName
,
szDir
,
phEXE
)
;
return
E_UNEXPECTED
;
}
dlls/advpack/tests/install.c
View file @
480b6495
...
...
@@ -56,22 +56,16 @@ static void test_RunSetupCommand()
/* try to run a non-existent exe */
hexe
=
(
HANDLE
)
0xdeadbeef
;
hr
=
pRunSetupCommand
(
NULL
,
"idontexist.exe"
,
"Install"
,
"c:
\\
windows
\\
system32"
,
"Title"
,
&
hexe
,
0
,
NULL
);
todo_wine
{
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %ld
\n
"
,
hr
);
}
ok
(
hexe
==
NULL
,
"Expcted hexe to be NULL
\n
"
);
ok
(
!
TerminateProcess
(
hexe
,
0
),
"Expected TerminateProcess to fail
\n
"
);
/* try a bad directory */
hexe
=
(
HANDLE
)
0xdeadbeef
;
hr
=
pRunSetupCommand
(
NULL
,
"winve.exe"
,
"Install"
,
""
,
"Title"
,
&
hexe
,
0
,
NULL
);
todo_wine
{
hr
=
pRunSetupCommand
(
NULL
,
"winver.exe"
,
"Install"
,
"non
\\
existent
\\
directory"
,
"Title"
,
&
hexe
,
0
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_DIRECTORY
),
"Expected HRESULT_FROM_WIN32(ERROR_DIRECTORY), got %ld
\n
"
,
hr
);
}
ok
(
hexe
==
NULL
,
"Expcted hexe to be NULL
\n
"
);
ok
(
!
TerminateProcess
(
hexe
,
0
),
"Expected TerminateProcess to fail
\n
"
);
...
...
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