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
22204c2c
Commit
22204c2c
authored
Feb 01, 2006
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 01, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: execute_from_key should fallback to a DDE exec only if the
command to execute from is not found in the registry. Pass already found executable name to dde_connect.
parent
0d4e1bc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
15 deletions
+28
-15
shlexec.c
dlls/shell32/shlexec.c
+28
-15
No files found.
dlls/shell32/shlexec.c
View file @
22204c2c
...
...
@@ -705,7 +705,7 @@ static HDDEDATA CALLBACK dde_cb(UINT uType, UINT uFmt, HCONV hConv,
* launching an application and trying (#2) to connect to it
*
*/
static
unsigned
dde_connect
(
WCHAR
*
key
,
WCHAR
*
start
,
WCHAR
*
ddeexec
,
static
unsigned
dde_connect
(
WCHAR
*
key
,
const
WCHAR
*
start
,
WCHAR
*
ddeexec
,
const
WCHAR
*
lpFile
,
WCHAR
*
env
,
LPCWSTR
szCommandline
,
LPITEMIDLIST
pidl
,
SHELL_ExecuteW32
execfunc
,
LPSHELLEXECUTEINFOW
psei
,
LPSHELLEXECUTEINFOW
psei_out
)
...
...
@@ -790,7 +790,7 @@ static unsigned dde_connect(WCHAR* key, WCHAR* start, WCHAR* ddeexec,
*/
if
(
unicode
)
hDdeData
=
DdeClientTransaction
((
LPBYTE
)
res
,
(
strlenW
(
res
)
+
1
)
*
sizeof
(
WCHAR
),
hConv
,
0L
,
0
,
XTYP_EXECUTE
,
1
0000
,
&
tid
);
XTYP_EXECUTE
,
3
0000
,
&
tid
);
else
{
DWORD
lenA
=
WideCharToMultiByte
(
CP_ACP
,
0
,
res
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
...
...
@@ -818,18 +818,36 @@ static unsigned dde_connect(WCHAR* key, WCHAR* start, WCHAR* ddeexec,
* execute_from_key [Internal]
*/
static
UINT_PTR
execute_from_key
(
LPWSTR
key
,
LPCWSTR
lpFile
,
WCHAR
*
env
,
LPCWSTR
szCommandline
,
LPCWSTR
executable_name
,
SHELL_ExecuteW32
execfunc
,
LPSHELLEXECUTEINFOW
psei
,
LPSHELLEXECUTEINFOW
psei_out
)
{
WCHAR
cmd
[
1024
];
WCHAR
cmd
[
256
];
LONG
cmdlen
=
sizeof
(
cmd
);
UINT_PTR
retval
=
31
;
TRACE
(
"%s %s %s %s %s
\n
"
,
debugstr_w
(
key
),
debugstr_w
(
lpFile
),
debugstr_w
(
env
),
debugstr_w
(
szCommandline
),
debugstr_w
(
executable_name
));
cmd
[
0
]
=
'\0'
;
/* Get the application f
or
the registry */
/* Get the application f
rom
the registry */
if
(
RegQueryValueW
(
HKEY_CLASSES_ROOT
,
key
,
cmd
,
&
cmdlen
)
==
ERROR_SUCCESS
)
{
WCHAR
param
[
1024
];
TRACE
(
"got cmd: %s
\n
"
,
debugstr_w
(
cmd
));
param
[
0
]
=
'\0'
;
/* Is there a replace() function anywhere? */
cmdlen
/=
sizeof
(
WCHAR
);
cmd
[
cmdlen
]
=
'\0'
;
SHELL_ArgifyW
(
param
,
sizeof
(
param
)
/
sizeof
(
WCHAR
),
cmd
,
lpFile
,
psei
->
lpIDList
,
szCommandline
);
retval
=
execfunc
(
param
,
env
,
FALSE
,
psei
,
psei_out
);
}
else
{
static
const
WCHAR
wCommand
[]
=
{
'c'
,
'o'
,
'm'
,
'm'
,
'a'
,
'n'
,
'd'
,
0
};
static
const
WCHAR
wDdeexec
[]
=
{
'd'
,
'd'
,
'e'
,
'e'
,
'x'
,
'e'
,
'c'
,
0
};
LPWSTR
tmp
;
...
...
@@ -844,21 +862,16 @@ static UINT_PTR execute_from_key(LPWSTR key, LPCWSTR lpFile, WCHAR *env, LPCWSTR
assert
(
tmp
);
strcpyW
(
tmp
,
wDdeexec
);
TRACE
(
"trying ddeexec cmd: %s
\n
"
,
debugstr_w
(
key
));
if
(
RegQueryValueW
(
HKEY_CLASSES_ROOT
,
key
,
param
,
&
paramlen
)
==
ERROR_SUCCESS
)
{
TRACE
(
"Got ddeexec %s => %s
\n
"
,
debugstr_w
(
key
),
debugstr_w
(
param
));
retval
=
dde_connect
(
key
,
cmd
,
param
,
lpFile
,
env
,
szCommandline
,
psei
->
lpIDList
,
execfunc
,
psei
,
psei_out
);
retval
=
dde_connect
(
key
,
executable_name
,
param
,
lpFile
,
env
,
szCommandline
,
psei
->
lpIDList
,
execfunc
,
psei
,
psei_out
);
}
else
{
/* Is there a replace() function anywhere? */
cmdlen
/=
sizeof
(
WCHAR
);
cmd
[
cmdlen
]
=
'\0'
;
SHELL_ArgifyW
(
param
,
sizeof
(
param
)
/
sizeof
(
WCHAR
),
cmd
,
lpFile
,
psei
->
lpIDList
,
szCommandline
);
retval
=
execfunc
(
param
,
env
,
FALSE
,
psei
,
psei_out
);
}
WARN
(
"Nothing appropriate found for %s
\n
"
,
debugstr_w
(
key
));
}
else
TRACE
(
"ooch
\n
"
);
return
retval
;
}
...
...
@@ -1448,7 +1461,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
}
TRACE
(
"%s/%s => %s/%s
\n
"
,
debugstr_w
(
wszApplicationName
),
debugstr_w
(
sei_tmp
.
lpVerb
),
debugstr_w
(
wszQuotedCmd
),
debugstr_w
(
lpstrProtocol
));
if
(
*
lpstrProtocol
)
retval
=
execute_from_key
(
lpstrProtocol
,
wszApplicationName
,
env
,
sei_tmp
.
lpParameters
,
execfunc
,
&
sei_tmp
,
sei
);
retval
=
execute_from_key
(
lpstrProtocol
,
wszApplicationName
,
env
,
sei_tmp
.
lpParameters
,
wcmd
,
execfunc
,
&
sei_tmp
,
sei
);
else
retval
=
execfunc
(
wszQuotedCmd
,
env
,
FALSE
,
&
sei_tmp
,
sei
);
HeapFree
(
GetProcessHeap
(),
0
,
env
);
...
...
@@ -1481,7 +1494,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
lpFile
+=
iSize
;
while
(
*
lpFile
==
':'
)
lpFile
++
;
}
retval
=
execute_from_key
(
lpstrProtocol
,
lpFile
,
NULL
,
sei_tmp
.
lpParameters
,
execfunc
,
&
sei_tmp
,
sei
);
retval
=
execute_from_key
(
lpstrProtocol
,
lpFile
,
NULL
,
sei_tmp
.
lpParameters
,
wcmd
,
execfunc
,
&
sei_tmp
,
sei
);
}
/* Check if file specified is in the form www.??????.*** */
else
if
(
!
strncmpiW
(
lpFile
,
wWww
,
3
))
...
...
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