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
0e369586
Commit
0e369586
authored
Jun 22, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
Jun 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Simplify code as native setupapi does not handle quoted paths.
parent
ec4936a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
42 deletions
+5
-42
install.c
dlls/setupapi/install.c
+4
-41
install.c
dlls/setupapi/tests/install.c
+1
-1
No files found.
dlls/setupapi/install.c
View file @
0e369586
...
...
@@ -1001,9 +1001,9 @@ void WINAPI InstallHinfSectionW( HWND hwnd, HINSTANCE handle, LPCWSTR cmdline, I
#endif
static
const
WCHAR
nt_genericW
[]
=
{
'.'
,
'n'
,
't'
,
0
};
WCHAR
*
s
,
*
d
,
*
path
,
section
[
MAX_PATH
+
sizeof
(
nt_platformW
)
/
sizeof
(
WCHAR
)];
WCHAR
*
s
,
*
path
,
section
[
MAX_PATH
+
sizeof
(
nt_platformW
)
/
sizeof
(
WCHAR
)];
void
*
callback_context
;
UINT
mode
,
in_quotes
,
bcount
;
UINT
mode
;
HINF
hinf
;
TRACE
(
"hwnd %p, handle %p, cmdline %s
\n
"
,
hwnd
,
handle
,
debugstr_w
(
cmdline
));
...
...
@@ -1015,47 +1015,10 @@ void WINAPI InstallHinfSectionW( HWND hwnd, HINSTANCE handle, LPCWSTR cmdline, I
while
(
*
s
==
' '
)
s
++
;
mode
=
atoiW
(
s
);
/* quoted paths are not allowed on native, the rest of the command line is taken as the path */
if
(
!
(
s
=
strchrW
(
s
,
' '
)))
return
;
while
(
*
s
==
' '
)
s
++
;
/* The inf path may be quoted. Code adapted from CommandLineToArgvW() */
bcount
=
0
;
in_quotes
=
0
;
path
=
d
=
s
;
while
(
*
s
)
{
if
(
*
s
==
0
)
{
/* end of this command line argument */
break
;
}
else
if
(
*
s
==
'\\'
)
{
/* '\\' */
*
d
++=*
s
++
;
bcount
++
;
}
else
if
(
*
s
==
'"'
)
{
/* '"' */
if
((
bcount
&
1
)
==
0
)
{
/* Preceded by an even number of '\', this is half that
* number of '\', plus a quote which we erase.
*/
d
-=
bcount
/
2
;
in_quotes
=!
in_quotes
;
s
++
;
}
else
{
/* Preceded by an odd number of '\', this is half that
* number of '\' followed by a '"'
*/
d
=
d
-
bcount
/
2
-
1
;
*
d
++=
'"'
;
s
++
;
}
bcount
=
0
;
}
else
{
/* a regular character */
*
d
++=*
s
++
;
bcount
=
0
;
}
}
*
d
=
0
;
path
=
s
;
hinf
=
SetupOpenInfFileW
(
path
,
NULL
,
INF_STYLE_WIN4
,
NULL
);
if
(
hinf
==
INVALID_HANDLE_VALUE
)
return
;
...
...
dlls/setupapi/tests/install.c
View file @
0e369586
...
...
@@ -124,7 +124,7 @@ static void test_cmdline(void)
ok_cmdline
(
"DefaultInstall"
,
128
,
path
,
TRUE
);
sprintf
(
path
,
"
\"
%s
\\
%s
\"
"
,
CURR_DIR
,
infwithspaces
);
todo_wine
ok_cmdline
(
"DefaultInstall"
,
128
,
path
,
FALSE
);
ok_cmdline
(
"DefaultInstall"
,
128
,
path
,
FALSE
);
ok
(
DeleteFile
(
infwithspaces
),
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
}
...
...
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