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
c2624507
Commit
c2624507
authored
Mar 29, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Mar 30, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advpack: Open the INF file if the RSC_FLAG_INF flag is specified.
parent
724a4b36
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
install.c
dlls/advpack/install.c
+19
-0
install.c
dlls/advpack/tests/install.c
+9
-4
No files found.
dlls/advpack/install.c
View file @
c2624507
...
...
@@ -33,6 +33,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
advpack
);
#define SPAPI_ERROR 0xE0000000L
#define SPAPI_PREFIX 0x800F0000L
#define SPAPI_MASK 0xFFFFL
#define HRESULT_FROM_SPAPI(x) ((x & SPAPI_MASK) | SPAPI_PREFIX)
/* this structure very closely resembles parameters of RunSetupCommand() */
typedef
struct
{
...
...
@@ -293,6 +298,9 @@ HRESULT WINAPI RunSetupCommandW(HWND hWnd, LPCWSTR szCmdName,
LPCWSTR
lpszTitle
,
HANDLE
*
phEXE
,
DWORD
dwFlags
,
LPVOID
pvReserved
)
{
HINF
hinf
;
DWORD
err
;
TRACE
(
"(%p, %s, %s, %s, %s, %p, 0x%08lx, %p)
\n
"
,
hWnd
,
debugstr_w
(
szCmdName
),
debugstr_w
(
szInfSection
),
debugstr_w
(
szDir
),
debugstr_w
(
lpszTitle
),
...
...
@@ -307,5 +315,16 @@ HRESULT WINAPI RunSetupCommandW(HWND hWnd, LPCWSTR szCmdName,
if
(
!
(
dwFlags
&
RSC_FLAG_INF
))
return
launch_exe
(
szCmdName
,
szDir
,
phEXE
);
hinf
=
SetupOpenInfFileW
(
szCmdName
,
NULL
,
INF_STYLE_WIN4
,
NULL
);
if
(
hinf
==
INVALID_HANDLE_VALUE
)
{
err
=
GetLastError
();
if
(
err
&
SPAPI_ERROR
)
return
HRESULT_FROM_SPAPI
(
err
);
else
return
HRESULT_FROM_WIN32
(
err
);
}
SetupCloseInfFile
(
hinf
);
return
E_UNEXPECTED
;
}
dlls/advpack/tests/install.c
View file @
c2624507
...
...
@@ -40,6 +40,14 @@ static BOOL init_function_pointers()
return
TRUE
;
}
static
BOOL
is_spapi_err
(
DWORD
err
)
{
const
DWORD
SPAPI_PREFIX
=
0x800F0000L
;
const
DWORD
SPAPI_MASK
=
0xFFFF0000L
;
return
(((
err
&
SPAPI_MASK
)
^
SPAPI_PREFIX
)
==
0
);
}
static
void
test_RunSetupCommand
()
{
HRESULT
hr
;
...
...
@@ -72,10 +80,7 @@ static void test_RunSetupCommand()
/* try to run an exe with the RSC_FLAG_INF flag */
hexe
=
(
HANDLE
)
0xdeadbeef
;
hr
=
pRunSetupCommand
(
NULL
,
"winver.exe"
,
"Install"
,
"c:
\\
windows
\\
system32"
,
"Title"
,
&
hexe
,
RSC_FLAG_INF
,
NULL
);
todo_wine
{
ok
(
hr
==
SPAPI_E_WRONG_INF_STYLE
,
"Expected SPAPI_E_WRONG_INF_STYLE, got %ld
\n
"
,
hr
);
}
ok
(
is_spapi_err
(
hr
),
"Expected a setupapi error, got %ld
\n
"
,
hr
);
ok
(
hexe
==
(
HANDLE
)
0xdeadbeef
,
"Expected hexe to be 0xdeadbeef
\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