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
b198924c
Commit
b198924c
authored
Jun 23, 2008
by
Owen Rudge
Committed by
Alexandre Julliard
Jun 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Ensure the correct applet is loaded in multi-applet control panels.
parent
3a95e276
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
29 deletions
+76
-29
control.c
dlls/shell32/control.c
+76
-29
No files found.
dlls/shell32/control.c
View file @
b198924c
...
...
@@ -358,7 +358,8 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
LPWSTR
end
;
WCHAR
ch
;
LPWSTR
ptr
;
unsigned
sp
=
0
;
signed
sp
=
-
1
;
LPWSTR
extraPmtsBuf
=
NULL
;
LPWSTR
extraPmts
=
NULL
;
int
quoted
=
0
;
...
...
@@ -368,46 +369,92 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
end
=
lstrcpyW
(
buffer
,
wszCmd
);
for
(;;)
{
ch
=
*
end
;
ch
=
*
end
;
if
(
ch
==
'"'
)
quoted
=
!
quoted
;
if
(
!
quoted
&&
(
ch
==
' '
||
ch
==
','
||
ch
==
'\0'
))
{
*
end
=
'\0'
;
if
(
beg
)
{
if
(
*
beg
==
'@'
)
{
sp
=
atoiW
(
beg
+
1
);
}
else
if
(
*
beg
==
'\0'
)
{
sp
=
0
;
}
else
{
extraPmts
=
beg
;
}
}
if
(
ch
==
'\0'
)
break
;
beg
=
end
+
1
;
if
(
ch
==
' '
)
while
(
end
[
1
]
==
' '
)
end
++
;
}
end
++
;
if
(
!
quoted
&&
(
ch
==
' '
||
ch
==
','
||
ch
==
'\0'
))
{
*
end
=
'\0'
;
if
(
beg
)
{
if
(
*
beg
==
'@'
)
{
sp
=
atoiW
(
beg
+
1
);
}
else
if
(
*
beg
==
'\0'
)
{
sp
=
-
1
;
}
else
{
extraPmtsBuf
=
beg
;
}
}
if
(
ch
==
'\0'
)
break
;
beg
=
end
+
1
;
if
(
ch
==
' '
)
while
(
end
[
1
]
==
' '
)
end
++
;
}
end
++
;
}
while
((
ptr
=
StrChrW
(
buffer
,
'"'
)))
memmove
(
ptr
,
ptr
+
1
,
lstrlenW
(
ptr
)
*
sizeof
(
WCHAR
));
/* now check for any quotes in extraPmtsBuf and remove */
if
(
extraPmtsBuf
!=
NULL
)
{
beg
=
end
=
extraPmtsBuf
;
quoted
=
0
;
for
(;;)
{
ch
=
*
end
;
if
(
ch
==
'"'
)
quoted
=
!
quoted
;
if
(
!
quoted
&&
(
ch
==
' '
||
ch
==
','
||
ch
==
'\0'
))
{
*
end
=
'\0'
;
if
(
beg
)
{
if
(
*
beg
!=
'\0'
)
{
extraPmts
=
beg
;
}
}
if
(
ch
==
'\0'
)
break
;
beg
=
end
+
1
;
if
(
ch
==
' '
)
while
(
end
[
1
]
==
' '
)
end
++
;
}
end
++
;
}
while
((
ptr
=
StrChrW
(
extraPmts
,
'"'
)))
memmove
(
ptr
,
ptr
+
1
,
lstrlenW
(
ptr
)
*
sizeof
(
WCHAR
));
if
(
extraPmts
==
NULL
)
extraPmts
=
extraPmtsBuf
;
}
TRACE
(
"cmd %s, extra %s, sp %d
\n
"
,
debugstr_w
(
buffer
),
debugstr_w
(
extraPmts
),
sp
);
Control_LoadApplet
(
hWnd
,
buffer
,
panel
);
if
(
panel
->
first
)
{
CPlApplet
*
applet
=
panel
->
first
;
CPlApplet
*
applet
=
panel
->
first
;
assert
(
applet
&&
applet
->
next
==
NULL
);
if
(
sp
>=
applet
->
count
)
{
WARN
(
"Out of bounds (%u >= %u), setting to 0
\n
"
,
sp
,
applet
->
count
);
sp
=
0
;
}
if
(
applet
->
info
[
sp
].
dwSize
)
{
if
(
!
applet
->
proc
(
applet
->
hWnd
,
CPL_STARTWPARMSA
,
sp
,
(
LPARAM
)
extraPmts
))
applet
->
proc
(
applet
->
hWnd
,
CPL_DBLCLK
,
sp
,
applet
->
info
[
sp
].
lData
);
}
Control_UnloadApplet
(
applet
);
assert
(
applet
&&
applet
->
next
==
NULL
);
/* we've been given a textual parameter (or none at all) */
if
(
sp
==
-
1
)
{
while
((
++
sp
)
!=
applet
->
count
)
{
if
(
applet
->
info
[
sp
].
dwSize
)
{
TRACE
(
"sp %d, name %s
\n
"
,
sp
,
debugstr_w
(
applet
->
info
[
sp
].
szName
));
if
(
StrCmpIW
(
extraPmts
,
applet
->
info
[
sp
].
szName
)
==
0
)
break
;
}
}
}
if
(
sp
>=
applet
->
count
)
{
WARN
(
"Out of bounds (%u >= %u), setting to 0
\n
"
,
sp
,
applet
->
count
);
sp
=
0
;
}
if
(
applet
->
info
[
sp
].
dwSize
)
{
if
(
!
applet
->
proc
(
applet
->
hWnd
,
CPL_STARTWPARMSA
,
sp
,
(
LPARAM
)
extraPmts
))
applet
->
proc
(
applet
->
hWnd
,
CPL_DBLCLK
,
sp
,
applet
->
info
[
sp
].
lData
);
}
Control_UnloadApplet
(
applet
);
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
...
...
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