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
03d3d9de
Commit
03d3d9de
authored
Oct 29, 2002
by
György 'Nog' Jeney
Committed by
Alexandre Julliard
Oct 29, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate out 16-bit ShellExecute function.
parent
f9768f47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
67 deletions
+73
-67
shell.c
dlls/shell32/shell.c
+37
-0
shell32_main.h
dlls/shell32/shell32_main.h
+3
-0
shlexec.c
dlls/shell32/shlexec.c
+33
-67
No files found.
dlls/shell32/shell.c
View file @
03d3d9de
...
...
@@ -624,3 +624,40 @@ DWORD WINAPI RegEnumKey16( HKEY hkey, DWORD index, LPSTR name, DWORD name_len )
fix_win16_hkey
(
&
hkey
);
return
RegEnumKeyA
(
hkey
,
index
,
name
,
name_len
);
}
/*************************************************************************
* SHELL_Execute16 [Internal]
*/
static
HINSTANCE
SHELL_Execute16
(
char
*
lpCmd
,
LPSHELLEXECUTEINFOA
sei
,
BOOL
shWait
)
{
sei
->
hInstApp
=
WinExec16
(
lpCmd
,
sei
->
nShow
);
return
sei
->
hInstApp
;
}
/*************************************************************************
* ShellExecute [SHELL.20]
*/
HINSTANCE16
WINAPI
ShellExecute16
(
HWND16
hWnd
,
LPCSTR
lpOperation
,
LPCSTR
lpFile
,
LPCSTR
lpParameters
,
LPCSTR
lpDirectory
,
INT16
iShowCmd
)
{
SHELLEXECUTEINFOA
sei
;
HANDLE
hProcess
=
0
;
sei
.
cbSize
=
sizeof
(
sei
);
sei
.
fMask
=
0
;
sei
.
hwnd
=
HWND_32
(
hWnd
);
sei
.
lpVerb
=
lpOperation
;
sei
.
lpFile
=
lpFile
;
sei
.
lpParameters
=
lpParameters
;
sei
.
lpDirectory
=
lpDirectory
;
sei
.
nShow
=
iShowCmd
;
sei
.
lpIDList
=
0
;
sei
.
lpClass
=
0
;
sei
.
hkeyClass
=
0
;
sei
.
dwHotKey
=
0
;
sei
.
hProcess
=
hProcess
;
ShellExecuteExA32
(
&
sei
,
SHELL_Execute16
);
return
(
HINSTANCE16
)
sei
.
hInstApp
;
}
dlls/shell32/shell32_main.h
View file @
03d3d9de
...
...
@@ -201,4 +201,7 @@ inline static void __SHCloneStrWtoA(char ** target, const WCHAR * source)
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
typedef
HINSTANCE
(
*
SHELL_ExecuteA1632
)(
char
*
lpCmd
,
LPSHELLEXECUTEINFOA
sei
,
BOOL
shWait
);
BOOL
WINAPI
ShellExecuteExA32
(
LPSHELLEXECUTEINFOA
sei
,
SHELL_ExecuteA1632
execfunc
);
#endif
dlls/shell32/shlexec.c
View file @
03d3d9de
...
...
@@ -108,7 +108,7 @@ static BOOL argify(char* res, int len, const char* fmt, const char* lpFile)
* SHELL_ExecuteA [Internal]
*
*/
static
HINSTANCE
SHELL_ExecuteA
(
char
*
lpCmd
,
LPSHELLEXECUTEINFOA
sei
,
BOOL
is32
,
BOOL
shWait
)
static
HINSTANCE
SHELL_ExecuteA
(
char
*
lpCmd
,
LPSHELLEXECUTEINFOA
sei
,
BOOL
shWait
)
{
STARTUPINFOA
startup
;
PROCESS_INFORMATION
info
;
...
...
@@ -119,31 +119,26 @@ static HINSTANCE SHELL_ExecuteA(char *lpCmd, LPSHELLEXECUTEINFOA sei, BOOL is32,
startup
.
cb
=
sizeof
(
STARTUPINFOA
);
startup
.
dwFlags
=
STARTF_USESHOWWINDOW
;
startup
.
wShowWindow
=
sei
->
nShow
;
if
(
is32
)
if
(
CreateProcessA
(
NULL
,
lpCmd
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
sei
->
lpDirectory
,
&
startup
,
&
info
))
{
if
(
CreateProcessA
(
NULL
,
lpCmd
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
sei
->
lpDirectory
,
&
startup
,
&
info
))
{
/* Give 30 seconds to the app to come up, if desired. Probably only needed
when starting app immediately before making a DDE connection. */
if
(
shWait
)
if
(
WaitForInputIdle
(
info
.
hProcess
,
30000
)
==
-
1
)
WARN
(
"WaitForInputIdle failed: Error %ld
\n
"
,
GetLastError
()
);
retval
=
(
HINSTANCE
)
33
;
if
(
sei
->
fMask
&
SEE_MASK_NOCLOSEPROCESS
)
sei
->
hProcess
=
info
.
hProcess
;
else
CloseHandle
(
info
.
hProcess
);
CloseHandle
(
info
.
hThread
);
}
else
if
((
retval
=
GetLastError
())
>=
(
HINSTANCE
)
32
)
{
FIXME
(
"Strange error set by CreateProcess: %d
\n
"
,
retval
);
retval
=
(
HINSTANCE
)
ERROR_BAD_FORMAT
;
}
/* Give 30 seconds to the app to come up, if desired. Probably only needed
when starting app immediately before making a DDE connection. */
if
(
shWait
)
if
(
WaitForInputIdle
(
info
.
hProcess
,
30000
)
==
-
1
)
WARN
(
"WaitForInputIdle failed: Error %ld
\n
"
,
GetLastError
()
);
retval
=
(
HINSTANCE
)
33
;
if
(
sei
->
fMask
&
SEE_MASK_NOCLOSEPROCESS
)
sei
->
hProcess
=
info
.
hProcess
;
else
CloseHandle
(
info
.
hProcess
);
CloseHandle
(
info
.
hThread
);
}
else
if
((
retval
=
GetLastError
())
>=
(
HINSTANCE
)
32
)
{
FIXME
(
"Strange error set by CreateProcess: %d
\n
"
,
retval
);
retval
=
(
HINSTANCE
)
ERROR_BAD_FORMAT
;
}
else
retval
=
WinExec16
(
lpCmd
,
sei
->
nShow
);
sei
->
hInstApp
=
retval
;
return
retval
;
...
...
@@ -348,7 +343,7 @@ static HDDEDATA CALLBACK dde_cb(UINT uType, UINT uFmt, HCONV hConv,
*/
static
unsigned
dde_connect
(
char
*
key
,
char
*
start
,
char
*
ddeexec
,
const
char
*
lpFile
,
LPSHELLEXECUTEINFOA
sei
,
BOOL
is32
)
LPSHELLEXECUTEINFOA
sei
,
SHELL_ExecuteA1632
execfunc
)
{
char
*
endkey
=
key
+
strlen
(
key
);
char
app
[
256
],
topic
[
256
],
ifexec
[
256
],
res
[
256
];
...
...
@@ -388,7 +383,7 @@ static unsigned dde_connect(char* key, char* start, char* ddeexec,
if
(
!
hConv
)
{
TRACE
(
"Launching '%s'
\n
"
,
start
);
ret
=
SHELL_ExecuteA
(
start
,
sei
,
is32
,
TRUE
);
ret
=
execfunc
(
start
,
sei
,
TRUE
);
if
(
ret
<
32
)
{
TRACE
(
"Couldn't launch
\n
"
);
...
...
@@ -423,7 +418,7 @@ static unsigned dde_connect(char* key, char* start, char* ddeexec,
/*************************************************************************
* execute_from_key [Internal]
*/
static
HINSTANCE
execute_from_key
(
LPSTR
key
,
LPCSTR
lpFile
,
LPSHELLEXECUTEINFOA
sei
,
BOOL
is32
)
static
HINSTANCE
execute_from_key
(
LPSTR
key
,
LPCSTR
lpFile
,
LPSHELLEXECUTEINFOA
sei
,
SHELL_ExecuteA1632
execfunc
)
{
char
cmd
[
1024
]
=
""
;
LONG
cmdlen
=
sizeof
(
cmd
);
...
...
@@ -445,14 +440,14 @@ static HINSTANCE execute_from_key(LPSTR key, LPCSTR lpFile, LPSHELLEXECUTEINFOA
if
(
RegQueryValueA
(
HKEY_CLASSES_ROOT
,
key
,
param
,
&
paramlen
)
==
ERROR_SUCCESS
)
{
TRACE
(
"Got ddeexec %s => %s
\n
"
,
key
,
param
);
retval
=
dde_connect
(
key
,
cmd
,
param
,
lpFile
,
sei
,
is32
);
retval
=
dde_connect
(
key
,
cmd
,
param
,
lpFile
,
sei
,
execfunc
);
}
else
{
/* Is there a replace() function anywhere? */
cmd
[
cmdlen
]
=
'\0'
;
argify
(
param
,
sizeof
(
param
),
cmd
,
lpFile
);
retval
=
SHELL_ExecuteA
(
param
,
sei
,
is32
,
FALSE
);
retval
=
execfunc
(
param
,
sei
,
FALSE
);
}
}
else
TRACE
(
"ooch
\n
"
);
...
...
@@ -506,7 +501,7 @@ HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpR
/*************************************************************************
* ShellExecuteExA32 [Internal]
*/
BOOL
WINAPI
ShellExecuteExA32
(
LPSHELLEXECUTEINFOA
sei
,
BOOL
is32
)
BOOL
WINAPI
ShellExecuteExA32
(
LPSHELLEXECUTEINFOA
sei
,
SHELL_ExecuteA1632
execfunc
)
{
CHAR
szApplicationName
[
MAX_PATH
],
szCommandline
[
MAX_PATH
],
szPidl
[
20
],
fileName
[
MAX_PATH
];
LPSTR
pos
;
...
...
@@ -584,7 +579,7 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, BOOL is32)
strcat
(
cmd
,
" "
);
strcat
(
cmd
,
szApplicationName
);
}
retval
=
SHELL_ExecuteA
(
cmd
,
sei
,
is32
,
FALSE
);
retval
=
execfunc
(
cmd
,
sei
,
FALSE
);
if
(
retval
>
32
)
return
TRUE
;
else
...
...
@@ -608,7 +603,7 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, BOOL is32)
strcat
(
szApplicationName
,
szCommandline
);
}
retval
=
SHELL_ExecuteA
(
szApplicationName
,
sei
,
is32
,
FALSE
);
retval
=
execfunc
(
szApplicationName
,
sei
,
FALSE
);
if
(
retval
>
32
)
return
TRUE
;
...
...
@@ -623,9 +618,9 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, BOOL is32)
}
TRACE
(
"%s/%s => %s/%s
\n
"
,
szApplicationName
,
lpOperation
,
cmd
,
lpstrProtocol
);
if
(
*
lpstrProtocol
)
retval
=
execute_from_key
(
lpstrProtocol
,
szApplicationName
,
sei
,
is32
);
retval
=
execute_from_key
(
lpstrProtocol
,
szApplicationName
,
sei
,
execfunc
);
else
retval
=
SHELL_ExecuteA
(
cmd
,
sei
,
is32
,
FALSE
);
retval
=
execfunc
(
cmd
,
sei
,
FALSE
);
}
else
if
(
PathIsURLA
((
LPSTR
)
lpFile
))
/* File not found, check for URL */
{
...
...
@@ -653,7 +648,7 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, BOOL is32)
lpFile
+=
iSize
;
while
(
*
lpFile
==
':'
)
lpFile
++
;
}
retval
=
execute_from_key
(
lpstrProtocol
,
lpFile
,
sei
,
is32
);
retval
=
execute_from_key
(
lpstrProtocol
,
lpFile
,
sei
,
execfunc
);
}
/* Check if file specified is in the form www.??????.*** */
else
if
(
!
strncasecmp
(
lpFile
,
"www"
,
3
))
...
...
@@ -674,35 +669,6 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, BOOL is32)
return
TRUE
;
}
/*************************************************************************
* ShellExecute [SHELL.20]
*/
HINSTANCE16
WINAPI
ShellExecute16
(
HWND16
hWnd
,
LPCSTR
lpOperation
,
LPCSTR
lpFile
,
LPCSTR
lpParameters
,
LPCSTR
lpDirectory
,
INT16
iShowCmd
)
{
SHELLEXECUTEINFOA
sei
;
HANDLE
hProcess
=
0
;
sei
.
cbSize
=
sizeof
(
sei
);
sei
.
fMask
=
0
;
sei
.
hwnd
=
HWND_32
(
hWnd
);
sei
.
lpVerb
=
lpOperation
;
sei
.
lpFile
=
lpFile
;
sei
.
lpParameters
=
lpParameters
;
sei
.
lpDirectory
=
lpDirectory
;
sei
.
nShow
=
iShowCmd
;
sei
.
lpIDList
=
0
;
sei
.
lpClass
=
0
;
sei
.
hkeyClass
=
0
;
sei
.
dwHotKey
=
0
;
sei
.
hProcess
=
hProcess
;
ShellExecuteExA32
(
&
sei
,
FALSE
);
return
(
HINSTANCE16
)
sei
.
hInstApp
;
}
/*************************************************************************
* ShellExecuteA [SHELL32.290]
*/
...
...
@@ -727,7 +693,7 @@ HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation,LPCSTR lpFile,
sei
.
dwHotKey
=
0
;
sei
.
hProcess
=
hProcess
;
ShellExecuteExA32
(
&
sei
,
TRUE
);
ShellExecuteExA32
(
&
sei
,
SHELL_ExecuteA
);
return
sei
.
hInstApp
;
}
...
...
@@ -739,7 +705,7 @@ BOOL WINAPI ShellExecuteExAW (LPVOID sei)
{
if
(
SHELL_OsIsUnicode
())
return
ShellExecuteExW
(
sei
);
return
ShellExecuteExA32
(
sei
,
TRUE
);
return
ShellExecuteExA32
(
sei
,
SHELL_ExecuteA
);
}
/*************************************************************************
...
...
@@ -748,7 +714,7 @@ BOOL WINAPI ShellExecuteExAW (LPVOID sei)
*/
BOOL
WINAPI
ShellExecuteExA
(
LPSHELLEXECUTEINFOA
sei
)
{
return
ShellExecuteExA32
(
sei
,
TRUE
);
return
ShellExecuteExA32
(
sei
,
SHELL_ExecuteA
);
}
/*************************************************************************
...
...
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