2 * Shell Library Functions
4 * Copyright 1998 Marcus Meissner
5 * Copyright 2002 Eric Pouech
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "wine/port.h"
47 #include "wine/winbase16.h"
48 #include "shell32_main.h"
49 #include "undocshell.h"
52 #include "wine/debug.h"
54 WINE_DEFAULT_DEBUG_CHANNEL(exec
);
56 static const WCHAR wszOpen
[] = {'o','p','e','n',0};
57 static const WCHAR wszExe
[] = {'.','e','x','e',0};
58 static const WCHAR wszILPtr
[] = {':','%','p',0};
59 static const WCHAR wszShell
[] = {'\\','s','h','e','l','l','\\',0};
60 static const WCHAR wszFolder
[] = {'F','o','l','d','e','r',0};
61 static const WCHAR wszEmpty
[] = {0};
64 /***********************************************************************
65 * SHELL_ArgifyW [Internal]
67 * this function is supposed to expand the escape sequences found in the registry
68 * some diving reported that the following were used:
69 * + %1, %2... seem to report to parameter of index N in ShellExecute pmts
74 * %I address of a global item ID (explorer switch /idlist)
75 * %L seems to be %1 as long filename followed by the 8+3 variation
77 * %* all following parameters (see batfile)
81 static BOOL
SHELL_ArgifyW(WCHAR
* out
, int len
, const WCHAR
* fmt
, const WCHAR
* lpFile
, LPITEMIDLIST pidl
, LPCWSTR args
)
121 while(*args
&& !isspace(*args
))
124 while(isspace(*args
))
129 /* else fall through */
131 if (!done
|| (*fmt
== '1'))
133 /*FIXME Is the call to SearchPathW() really needed? We already have separated out the parameter string in args. */
134 if (SearchPathW(NULL
, lpFile
, wszExe
, sizeof(xlpFile
)/sizeof(WCHAR
), xlpFile
, NULL
))
139 /* Add double quotation marks unless we already have them (e.g.: "%1" %* for exefile) */
140 if (res
==out
|| res
[-1]!='"')
156 * IE uses this alot for activating things such as windows media
157 * player. This is not verified to be fully correct but it appears
163 strcpyW(res
, lpFile
);
164 res
+= strlenW(lpFile
);
171 HGLOBAL hmem
= SHAllocShared(pidl
, ILGetSize(pidl
), 0);
172 pv
= SHLockShared(hmem
, 0);
173 res
+= sprintfW(res
, wszILPtr
, pv
);
178 default: FIXME("Unknown escape sequence %%%c\n", *fmt
);
193 HRESULT
SHELL_GetPathFromIDListForExecuteA(LPCITEMIDLIST pidl
, LPSTR pszPath
, UINT uOutSize
)
196 IShellFolder
* desktop
;
198 HRESULT hr
= SHGetDesktopFolder(&desktop
);
201 hr
= IShellFolder_GetDisplayNameOf(desktop
, pidl
, SHGDN_FORPARSING
, &strret
);
204 StrRetToStrNA(pszPath
, uOutSize
, &strret
, pidl
);
206 IShellFolder_Release(desktop
);
212 HRESULT
SHELL_GetPathFromIDListForExecuteW(LPCITEMIDLIST pidl
, LPWSTR pszPath
, UINT uOutSize
)
215 IShellFolder
* desktop
;
217 HRESULT hr
= SHGetDesktopFolder(&desktop
);
220 hr
= IShellFolder_GetDisplayNameOf(desktop
, pidl
, SHGDN_FORPARSING
, &strret
);
223 StrRetToStrNW(pszPath
, uOutSize
, &strret
, pidl
);
225 IShellFolder_Release(desktop
);
231 /*************************************************************************
232 * SHELL_ResolveShortCutW [Internal]
233 * read shortcut file at 'wcmd'
235 static HRESULT
SHELL_ResolveShortCutW(LPWSTR wcmd
, LPWSTR wargs
, LPWSTR wdir
, HWND hwnd
, LPCWSTR lpVerb
, int* pshowcmd
, LPITEMIDLIST
* ppidl
)
239 HRESULT hr
= SHGetDesktopFolder(&psf
);
247 hr
= IShellFolder_ParseDisplayName(psf
, 0, 0, wcmd
, &l
, &pidl
, 0);
252 hr
= IShellFolder_GetUIObjectOf(psf
, NULL
, 1, (LPCITEMIDLIST
*)&pidl
, &IID_IShellLinkW
, NULL
, (LPVOID
*)&psl
);
255 hr
= IShellLinkW_Resolve(psl
, hwnd
, 0);
258 hr
= IShellLinkW_GetPath(psl
, wcmd
, MAX_PATH
, NULL
, SLGP_UNCPRIORITY
);
262 /* We could not translate the PIDL in the shell link into a valid file system path - so return the PIDL instead. */
263 hr
= IShellLinkW_GetIDList(psl
, ppidl
);
265 if (SUCCEEDED(hr
) && *ppidl
) {
266 /* We got a PIDL instead of a file system path - try to translate it. */
267 if (SUCCEEDED(SHELL_GetPathFromIDListW(*ppidl
, wcmd
, MAX_PATH
))) {
275 /* get command line arguments, working directory and display mode if available */
276 IShellLinkW_GetWorkingDirectory(psl
, wdir
, MAX_PATH
);
277 IShellLinkW_GetArguments(psl
, wargs
, MAX_PATH
);
278 IShellLinkW_GetShowCmd(psl
, pshowcmd
);
283 IShellLinkW_Release(psl
);
289 IShellFolder_Release(psf
);
295 /*************************************************************************
296 * SHELL_ExecuteW [Internal]
299 static UINT
SHELL_ExecuteW(const WCHAR
*lpCmd
, void *env
, BOOL shWait
,
300 LPSHELLEXECUTEINFOW psei
, LPSHELLEXECUTEINFOW psei_out
)
302 STARTUPINFOW startup
;
303 PROCESS_INFORMATION info
;
306 WCHAR curdir
[MAX_PATH
];
308 TRACE("Execute %s from directory %s\n", debugstr_w(lpCmd
), debugstr_w(psei
->lpDirectory
));
310 /* ShellExecute specifies the command from psei->lpDirectory
311 * if present. Not from the current dir as CreateProcess does */
312 if( psei
->lpDirectory
&& psei
->lpDirectory
[0] )
313 if( ( gcdret
= GetCurrentDirectoryW( MAX_PATH
, curdir
)))
314 if( !SetCurrentDirectoryW( psei
->lpDirectory
))
315 ERR("cannot set directory %s\n", debugstr_w(psei
->lpDirectory
));
317 ZeroMemory(&startup
, sizeof(startup
));
318 startup
.cb
= sizeof(STARTUPINFOW
);
319 startup
.dwFlags
= STARTF_USESHOWWINDOW
;
320 startup
.wShowWindow
= psei
->nShow
;
322 if (CreateProcessW(NULL
, (LPWSTR
)lpCmd
, NULL
, NULL
, FALSE
, 0,
323 env
, *psei
->lpDirectory
? psei
->lpDirectory
: NULL
, &startup
, &info
))
325 /* Give 30 seconds to the app to come up, if desired. Probably only needed
326 when starting app immediately before making a DDE connection. */
328 if (WaitForInputIdle( info
.hProcess
, 30000 ) == WAIT_FAILED
)
329 WARN("WaitForInputIdle failed: Error %ld\n", GetLastError() );
332 if (psei
->fMask
& SEE_MASK_NOCLOSEPROCESS
)
333 psei_out
->hProcess
= info
.hProcess
;
335 CloseHandle(info
.hProcess
);
337 CloseHandle(info
.hThread
);
339 else if ((retval
= GetLastError()) >= 32)
341 FIXME("Strange error set by CreateProcess: %d\n", retval
);
342 retval
= ERROR_BAD_FORMAT
;
345 TRACE("returning %u\n", retval
);
347 psei_out
->hInstApp
= (HINSTANCE
)retval
;
350 if( !SetCurrentDirectoryW( curdir
))
351 ERR("cannot return to directory %s\n", debugstr_w(curdir
));
357 /***********************************************************************
358 * SHELL_BuildEnvW [Internal]
360 * Build the environment for the new process, adding the specified
361 * path to the PATH variable. Returned pointer must be freed by caller.
363 static void *SHELL_BuildEnvW( const WCHAR
*path
)
365 static const WCHAR wPath
[] = {'P','A','T','H','=',0};
366 WCHAR
*strings
, *new_env
;
368 int total
= strlenW(path
) + 1;
369 BOOL got_path
= FALSE
;
371 if (!(strings
= GetEnvironmentStringsW())) return NULL
;
375 int len
= strlenW(p
) + 1;
376 if (!strncmpiW( p
, wPath
, 5 )) got_path
= TRUE
;
380 if (!got_path
) total
+= 5; /* we need to create PATH */
381 total
++; /* terminating null */
383 if (!(new_env
= HeapAlloc( GetProcessHeap(), 0, total
* sizeof(WCHAR
) )))
385 FreeEnvironmentStringsW( strings
);
392 int len
= strlenW(p
) + 1;
393 memcpy( p2
, p
, len
* sizeof(WCHAR
) );
394 if (!strncmpiW( p
, wPath
, 5 ))
397 strcpyW( p2
+ len
, path
);
398 p2
+= strlenW(path
) + 1;
405 strcpyW( p2
, wPath
);
407 p2
+= strlenW(p2
) + 1;
410 FreeEnvironmentStringsW( strings
);
415 /***********************************************************************
416 * SHELL_TryAppPathW [Internal]
418 * Helper function for SHELL_FindExecutable
419 * @param lpResult - pointer to a buffer of size MAX_PATH
420 * On entry: szName is a filename (probably without path separators).
421 * On exit: if szName found in "App Path", place full path in lpResult, and return true
423 static BOOL
SHELL_TryAppPathW(LPCWSTR szName
, LPWSTR lpResult
, void** env
)
425 static const WCHAR wszKeyAppPaths
[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s',
426 '\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','A','p','p',' ','P','a','t','h','s','\\',0};
427 static const WCHAR wPath
[] = {'P','a','t','h',0};
435 if (env
) *env
= NULL
;
436 strcpyW(buffer
, wszKeyAppPaths
);
437 strcatW(buffer
, szName
);
438 res
= RegOpenKeyExW(HKEY_LOCAL_MACHINE
, buffer
, 0, KEY_READ
, &hkApp
);
441 len
= MAX_PATH
*sizeof(WCHAR
);
442 res
= RegQueryValueW(hkApp
, NULL
, lpResult
, &len
);
448 DWORD count
= sizeof(buffer
);
449 if (!RegQueryValueExW(hkApp
, wPath
, NULL
, NULL
, (LPBYTE
)buffer
, &count
) && buffer
[0])
450 *env
= SHELL_BuildEnvW( buffer
);
454 if (hkApp
) RegCloseKey(hkApp
);
458 static UINT
SHELL_FindExecutableByOperation(LPCWSTR lpPath
, LPCWSTR lpFile
, LPCWSTR lpOperation
, LPWSTR key
, LPWSTR filetype
, LPWSTR command
, LONG commandlen
)
460 static const WCHAR wCommand
[] = {'\\','c','o','m','m','a','n','d',0};
462 /* Looking for ...buffer\shell\<verb>\command */
463 strcatW(filetype
, wszShell
);
464 strcatW(filetype
, lpOperation
);
465 strcatW(filetype
, wCommand
);
467 if (RegQueryValueW(HKEY_CLASSES_ROOT
, filetype
, command
,
468 &commandlen
) == ERROR_SUCCESS
)
470 commandlen
/= sizeof(WCHAR
);
471 if (key
) strcpyW(key
, filetype
);
475 LONG paramlen
= sizeof(param
);
476 static const WCHAR wSpace
[] = {' ',0};
478 /* FIXME: it seems all Windows version don't behave the same here.
479 * the doc states that this ddeexec information can be found after
481 * on Win98, it doesn't appear, but I think it does on Win2k
483 /* Get the parameters needed by the application
484 from the associated ddeexec key */
485 tmp
= strstrW(filetype
, wCommand
);
487 strcatW(filetype
, wDdeexec
);
488 if (RegQueryValueW(HKEY_CLASSES_ROOT
, filetype
, param
,
489 ¶mlen
) == ERROR_SUCCESS
)
491 paramlen
/= sizeof(WCHAR
);
492 strcatW(command
, wSpace
);
493 strcatW(command
, param
);
494 commandlen
+= paramlen
;
498 command
[commandlen
] = '\0';
500 return 33; /* FIXME see SHELL_FindExecutable() */
503 return 31; /* default - 'No association was found' */
506 /*************************************************************************
507 * SHELL_FindExecutable [Internal]
509 * Utility for code sharing between FindExecutable and ShellExecute
511 * lpFile the name of a file
512 * lpOperation the operation on it (open)
514 * lpResult a buffer, big enough :-(, to store the command to do the
515 * operation on the file
516 * key a buffer, big enough, to get the key name to do actually the
517 * command (it'll be used afterwards for more information
520 UINT
SHELL_FindExecutable(LPCWSTR lpPath
, LPCWSTR lpFile
, LPCWSTR lpOperation
,
521 LPWSTR lpResult
, int resultLen
, LPWSTR key
, void **env
, LPITEMIDLIST pidl
, LPCWSTR args
)
523 static const WCHAR wWindows
[] = {'w','i','n','d','o','w','s',0};
524 static const WCHAR wPrograms
[] = {'p','r','o','g','r','a','m','s',0};
525 static const WCHAR wExtensions
[] = {'e','x','e',' ','p','i','f',' ','b','a','t',' ','c','m','d',' ','c','o','m',0};
527 WCHAR
*extension
= NULL
; /* pointer to file extension */
528 WCHAR filetype
[256]; /* registry name for this filetype */
529 LONG filetypelen
= sizeof(filetype
); /* length of above */
530 WCHAR command
[1024]; /* command from registry */
531 WCHAR wBuffer
[256]; /* Used to GetProfileString */
532 UINT retval
= 31; /* default - 'No association was found' */
533 WCHAR
*tok
; /* token pointer */
534 WCHAR xlpFile
[256]; /* result of SearchPath */
535 DWORD attribs
; /* file attributes */
537 TRACE("%s\n", (lpFile
!= NULL
) ? debugstr_w(lpFile
) : "-");
540 lpResult
[0] = '\0'; /* Start off with an empty return string */
541 if (key
) *key
= '\0';
543 /* trap NULL parameters on entry */
544 if ((lpFile
== NULL
) || (lpResult
== NULL
))
546 WARN("(lpFile=%s,lpResult=%s): NULL parameter\n", debugstr_w(lpFile
), debugstr_w(lpResult
));
547 return 2; /* File not found. Close enough, I guess. */
550 if (SHELL_TryAppPathW( lpFile
, lpResult
, env
))
552 TRACE("found %s via App Paths\n", debugstr_w(lpResult
));
556 if (SearchPathW(lpPath
, lpFile
, wszExe
, sizeof(xlpFile
)/sizeof(WCHAR
), xlpFile
, NULL
))
558 TRACE("SearchPathW returned non-zero\n");
560 /* Hey, isn't this value ignored? Why make this call? Shouldn't we return here? --dank*/
563 attribs
= GetFileAttributesW(lpFile
);
564 if (attribs
!=INVALID_FILE_ATTRIBUTES
&& (attribs
&FILE_ATTRIBUTE_DIRECTORY
))
566 strcpyW(filetype
, wszFolder
);
567 filetypelen
= 6; /* strlen("Folder") */
571 /* First thing we need is the file's extension */
572 extension
= strrchrW(xlpFile
, '.'); /* Assume last "." is the one; */
573 /* File->Run in progman uses */
575 TRACE("xlpFile=%s,extension=%s\n", debugstr_w(xlpFile
), debugstr_w(extension
));
577 if (extension
== NULL
|| extension
[1]==0)
579 WARN("Returning 31 - No association\n");
580 return 31; /* no association */
583 /* Three places to check: */
584 /* 1. win.ini, [windows], programs (NB no leading '.') */
585 /* 2. Registry, HKEY_CLASS_ROOT\<filetype>\shell\open\command */
586 /* 3. win.ini, [extensions], extension (NB no leading '.' */
587 /* All I know of the order is that registry is checked before */
588 /* extensions; however, it'd make sense to check the programs */
589 /* section first, so that's what happens here. */
591 /* See if it's a program - if GetProfileString fails, we skip this
592 * section. Actually, if GetProfileString fails, we've probably
593 * got a lot more to worry about than running a program... */
594 if (GetProfileStringW(wWindows
, wPrograms
, wExtensions
, wBuffer
, sizeof(wBuffer
)/sizeof(WCHAR
)) > 0)
601 while (*p
&& *p
!= ' ' && *p
!= '\t') p
++;
605 while (*p
== ' ' || *p
== '\t') p
++;
608 if (strcmpiW(tok
, &extension
[1]) == 0) /* have to skip the leading "." */
610 strcpyW(lpResult
, xlpFile
);
611 /* Need to perhaps check that the file has a path
613 TRACE("found %s\n", debugstr_w(lpResult
));
616 /* Greater than 32 to indicate success FIXME According to the
617 * docs, I should be returning a handle for the
618 * executable. Does this mean I'm supposed to open the
619 * executable file or something? More RTFM, I guess... */
626 if (RegQueryValueW(HKEY_CLASSES_ROOT
, extension
, filetype
,
627 &filetypelen
) == ERROR_SUCCESS
)
629 filetypelen
/= sizeof(WCHAR
);
630 filetype
[filetypelen
] = '\0';
631 TRACE("File type: %s\n", debugstr_w(filetype
));
639 /* pass the operation string to SHELL_FindExecutableByOperation() */
640 filetype
[filetypelen
] = '\0';
641 retval
= SHELL_FindExecutableByOperation(lpPath
, lpFile
, lpOperation
, key
, filetype
, command
, sizeof(command
));
645 WCHAR operation
[MAX_PATH
];
648 /* Looking for ...buffer\shell\<operation>\command */
649 strcatW(filetype
, wszShell
);
651 /* enumerate the operation subkeys in the registry and search for one with an associated command */
652 if (RegOpenKeyW(HKEY_CLASSES_ROOT
, filetype
, &hkey
) == ERROR_SUCCESS
)
657 if (RegEnumKeyW(hkey
, idx
, operation
, MAX_PATH
) != ERROR_SUCCESS
)
660 filetype
[filetypelen
] = '\0';
661 retval
= SHELL_FindExecutableByOperation(lpPath
, lpFile
, operation
, key
, filetype
, command
, sizeof(command
));
672 SHELL_ArgifyW(lpResult
, resultLen
, command
, xlpFile
, pidl
, args
);
674 /* Remove double quotation marks and command line arguments */
675 if (*lpResult
== '"')
678 while (*(p
+ 1) != '"')
687 else if (extension
) /* Check win.ini */
689 static const WCHAR wExtensions
[] = {'e','x','t','e','n','s','i','o','n','s',0};
691 /* Toss the leading dot */
693 if (GetProfileStringW(wExtensions
, extension
, wszEmpty
, command
, sizeof(command
)/sizeof(WCHAR
)) > 0)
695 if (strlenW(command
) != 0)
697 strcpyW(lpResult
, command
);
698 tok
= strchrW(lpResult
, '^'); /* should be ^.extension? */
703 strcatW(lpResult
, xlpFile
); /* what if no dir in xlpFile? */
704 tok
= strchrW(command
, '^'); /* see above */
705 if ((tok
!= NULL
) && (strlenW(tok
)>5))
707 strcatW(lpResult
, &tok
[5]);
711 retval
= 33; /* FIXME - see above */
716 TRACE("returning %s\n", debugstr_w(lpResult
));
720 /******************************************************************
723 * callback for the DDE connection. not really usefull
725 static HDDEDATA CALLBACK
dde_cb(UINT uType
, UINT uFmt
, HCONV hConv
,
727 HDDEDATA hData
, DWORD dwData1
, DWORD dwData2
)
732 /******************************************************************
735 * ShellExecute helper. Used to do an operation with a DDE connection
737 * Handles both the direct connection (try #1), and if it fails,
738 * launching an application and trying (#2) to connect to it
741 static unsigned dde_connect(WCHAR
* key
, WCHAR
* start
, WCHAR
* ddeexec
,
742 const WCHAR
* lpFile
, void *env
,
743 LPCWSTR szCommandline
, LPITEMIDLIST pidl
, SHELL_ExecuteW32 execfunc
,
744 LPSHELLEXECUTEINFOW psei
, LPSHELLEXECUTEINFOW psei_out
)
746 static const WCHAR wApplication
[] = {'\\','a','p','p','l','i','c','a','t','i','o','n',0};
747 static const WCHAR wTopic
[] = {'\\','t','o','p','i','c',0};
749 WCHAR
* endkey
= key
+ strlenW(key
);
750 WCHAR app
[256], topic
[256], ifexec
[256];
752 LONG applen
, topiclen
, ifexeclen
;
756 HSZ hszApp
, hszTopic
;
760 strcpyW(endkey
, wApplication
);
761 applen
= sizeof(app
);
762 if (RegQueryValueW(HKEY_CLASSES_ROOT
, key
, app
, &applen
) != ERROR_SUCCESS
)
764 FIXME("default app name NIY %s\n", debugstr_w(key
));
768 strcpyW(endkey
, wTopic
);
769 topiclen
= sizeof(topic
);
770 if (RegQueryValueW(HKEY_CLASSES_ROOT
, key
, topic
, &topiclen
) != ERROR_SUCCESS
)
772 static const WCHAR wSystem
[] = {'S','y','s','t','e','m',0};
773 strcpyW(topic
, wSystem
);
776 if (DdeInitializeW(&ddeInst
, dde_cb
, APPCMD_CLIENTONLY
, 0L) != DMLERR_NO_ERROR
)
781 hszApp
= DdeCreateStringHandleW(ddeInst
, app
, CP_WINANSI
);
782 hszTopic
= DdeCreateStringHandleW(ddeInst
, topic
, CP_WINANSI
);
784 hConv
= DdeConnect(ddeInst
, hszApp
, hszTopic
, NULL
);
788 static const WCHAR wIfexec
[] = {'\\','i','f','e','x','e','c',0};
789 TRACE("Launching '%s'\n", debugstr_w(start
));
790 ret
= execfunc(start
, env
, TRUE
, psei
, psei_out
);
793 TRACE("Couldn't launch\n");
796 hConv
= DdeConnect(ddeInst
, hszApp
, hszTopic
, NULL
);
799 TRACE("Couldn't connect. ret=%d\n", ret
);
800 DdeUninitialize(ddeInst
);
801 SetLastError(ERROR_DDE_FAIL
);
802 return 30; /* whatever */
804 strcpyW(endkey
, wIfexec
);
805 ifexeclen
= sizeof(ifexec
);
806 if (RegQueryValueW(HKEY_CLASSES_ROOT
, key
, ifexec
, &ifexeclen
) == ERROR_SUCCESS
)
812 SHELL_ArgifyW(res
, sizeof(res
)/sizeof(WCHAR
), exec
, lpFile
, pidl
, szCommandline
);
813 TRACE("%s %s => %s\n", debugstr_w(exec
), debugstr_w(lpFile
), debugstr_w(res
));
815 ret
= (DdeClientTransaction((LPBYTE
)res
, (strlenW(res
) + 1) * sizeof(WCHAR
), hConv
, 0L, 0,
816 XTYP_EXECUTE
, 10000, &tid
) != DMLERR_NO_ERROR
) ? 31 : 33;
817 DdeDisconnect(hConv
);
820 DdeUninitialize(ddeInst
);
825 /*************************************************************************
826 * execute_from_key [Internal]
828 static UINT
execute_from_key(LPWSTR key
, LPCWSTR lpFile
, void *env
, LPCWSTR szCommandline
,
829 SHELL_ExecuteW32 execfunc
,
830 LPSHELLEXECUTEINFOW psei
, LPSHELLEXECUTEINFOW psei_out
)
833 LONG cmdlen
= sizeof(cmd
);
838 /* Get the application for the registry */
839 if (RegQueryValueW(HKEY_CLASSES_ROOT
, key
, cmd
, &cmdlen
) == ERROR_SUCCESS
)
841 static const WCHAR wCommand
[] = {'c','o','m','m','a','n','d',0};
842 static const WCHAR wDdeexec
[] = {'d','d','e','e','x','e','c',0};
846 LONG paramlen
= sizeof(param
);
850 /* Get the parameters needed by the application
851 from the associated ddeexec key */
852 tmp
= strstrW(key
, wCommand
);
854 strcpyW(tmp
, wDdeexec
);
856 if (RegQueryValueW(HKEY_CLASSES_ROOT
, key
, param
, ¶mlen
) == ERROR_SUCCESS
)
858 TRACE("Got ddeexec %s => %s\n", debugstr_w(key
), debugstr_w(param
));
859 retval
= dde_connect(key
, cmd
, param
, lpFile
, env
, szCommandline
, psei
->lpIDList
, execfunc
, psei
, psei_out
);
863 /* Is there a replace() function anywhere? */
864 cmdlen
/= sizeof(WCHAR
);
866 SHELL_ArgifyW(param
, sizeof(param
)/sizeof(WCHAR
), cmd
, lpFile
, psei
->lpIDList
, szCommandline
);
867 retval
= execfunc(param
, env
, FALSE
, psei
, psei_out
);
870 else TRACE("ooch\n");
875 /*************************************************************************
876 * FindExecutableA [SHELL32.@]
878 HINSTANCE WINAPI
FindExecutableA(LPCSTR lpFile
, LPCSTR lpDirectory
, LPSTR lpResult
)
881 WCHAR
*wFile
= NULL
, *wDirectory
= NULL
;
882 WCHAR wResult
[MAX_PATH
];
884 if (lpFile
) __SHCloneStrAtoW(&wFile
, lpFile
);
885 if (lpDirectory
) __SHCloneStrAtoW(&wDirectory
, lpDirectory
);
887 retval
= FindExecutableW(wFile
, wDirectory
, wResult
);
888 WideCharToMultiByte(CP_ACP
, 0, wResult
, -1, lpResult
, MAX_PATH
, NULL
, NULL
);
889 if (wFile
) SHFree( wFile
);
890 if (wDirectory
) SHFree( wDirectory
);
892 TRACE("returning %s\n", lpResult
);
893 return (HINSTANCE
)retval
;
896 /*************************************************************************
897 * FindExecutableW [SHELL32.@]
899 HINSTANCE WINAPI
FindExecutableW(LPCWSTR lpFile
, LPCWSTR lpDirectory
, LPWSTR lpResult
)
901 UINT retval
= 31; /* default - 'No association was found' */
904 TRACE("File %s, Dir %s\n",
905 (lpFile
!= NULL
? debugstr_w(lpFile
) : "-"), (lpDirectory
!= NULL
? debugstr_w(lpDirectory
) : "-"));
907 lpResult
[0] = '\0'; /* Start off with an empty return string */
909 /* trap NULL parameters on entry */
910 if ((lpFile
== NULL
) || (lpResult
== NULL
))
912 /* FIXME - should throw a warning, perhaps! */
913 return (HINSTANCE
)2; /* File not found. Close enough, I guess. */
918 GetCurrentDirectoryW(sizeof(old_dir
)/sizeof(WCHAR
), old_dir
);
919 SetCurrentDirectoryW(lpDirectory
);
922 retval
= SHELL_FindExecutable(lpDirectory
, lpFile
, wszOpen
, lpResult
, MAX_PATH
, NULL
, NULL
, NULL
, NULL
);
924 TRACE("returning %s\n", debugstr_w(lpResult
));
926 SetCurrentDirectoryW(old_dir
);
927 return (HINSTANCE
)retval
;
930 /*************************************************************************
931 * ShellExecuteExW32 [Internal]
933 BOOL WINAPI
ShellExecuteExW32 (LPSHELLEXECUTEINFOW psei
, SHELL_ExecuteW32 execfunc
)
935 static const WCHAR wQuote
[] = {'"',0};
936 static const WCHAR wSpace
[] = {' ',0};
937 static const WCHAR wWww
[] = {'w','w','w',0};
938 static const WCHAR wFile
[] = {'f','i','l','e',0};
939 static const WCHAR wHttp
[] = {'h','t','t','p',':','/','/',0};
940 static const WCHAR wExtLnk
[] = {'.','l','n','k',0};
941 static const WCHAR wExplorer
[] = {'e','x','p','l','o','r','e','r','.','e','x','e',0};
943 WCHAR wszApplicationName
[MAX_PATH
+2], wszParameters
[1024], wszDir
[MAX_PATH
];
944 SHELLEXECUTEINFOW sei_tmp
; /* modifyable copy of SHELLEXECUTEINFO struct */
945 WCHAR wfileName
[MAX_PATH
];
947 WCHAR wszProtocol
[256];
953 /* make a local copy of the LPSHELLEXECUTEINFO structure and work with this from now on */
954 memcpy(&sei_tmp
, psei
, sizeof(sei_tmp
));
956 TRACE("mask=0x%08lx hwnd=%p verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s\n",
957 sei_tmp
.fMask
, sei_tmp
.hwnd
, debugstr_w(sei_tmp
.lpVerb
),
958 debugstr_w(sei_tmp
.lpFile
), debugstr_w(sei_tmp
.lpParameters
),
959 debugstr_w(sei_tmp
.lpDirectory
), sei_tmp
.nShow
,
960 (sei_tmp
.fMask
& SEE_MASK_CLASSNAME
) ? debugstr_w(sei_tmp
.lpClass
) : "not used");
962 psei
->hProcess
= NULL
;
964 /* make copies of all path/command strings */
966 strcpyW(wszApplicationName
, sei_tmp
.lpFile
);
968 *wszApplicationName
= '\0';
970 if (sei_tmp
.lpParameters
)
971 strcpyW(wszParameters
, sei_tmp
.lpParameters
);
973 *wszParameters
= '\0';
975 if (sei_tmp
.lpDirectory
)
976 strcpyW(wszDir
, sei_tmp
.lpDirectory
);
980 /* adjust string pointers to point to the new buffers */
981 sei_tmp
.lpFile
= wszApplicationName
;
982 sei_tmp
.lpParameters
= wszParameters
;
983 sei_tmp
.lpDirectory
= wszDir
;
985 if (sei_tmp
.fMask
& (SEE_MASK_ICON
| SEE_MASK_HOTKEY
|
986 SEE_MASK_CONNECTNETDRV
| SEE_MASK_FLAG_DDEWAIT
|
987 SEE_MASK_DOENVSUBST
| SEE_MASK_FLAG_NO_UI
| SEE_MASK_UNICODE
|
988 SEE_MASK_NO_CONSOLE
| SEE_MASK_ASYNCOK
| SEE_MASK_HMONITOR
))
990 FIXME("flags ignored: 0x%08lx\n", sei_tmp
.fMask
);
993 /* process the IDList */
994 if (sei_tmp
.fMask
& SEE_MASK_IDLIST
)
996 IShellExecuteHookW
* pSEH
;
998 HRESULT hr
= SHBindToParent(sei_tmp
.lpIDList
, &IID_IShellExecuteHookW
, (LPVOID
*)&pSEH
, NULL
);
1002 hr
= IShellExecuteHookW_Execute(pSEH
, psei
);
1004 IShellExecuteHookW_Release(pSEH
);
1010 /* try to translate PIDL directly into the corresponding file system path */
1011 if (SUCCEEDED(SHELL_GetPathFromIDListW(sei_tmp
.lpIDList
, wszApplicationName
/*sei_tmp.lpFile*/, sizeof(wszApplicationName
)/sizeof(WCHAR
))))
1013 sei_tmp
.lpIDList
= NULL
;
1014 sei_tmp
.fMask
&= ~SEE_MASK_INVOKEIDLIST
;
1017 TRACE("-- idlist=%p (%s)\n", sei_tmp
.lpIDList
, debugstr_w(wszApplicationName
));
1020 if (sei_tmp
.fMask
& (SEE_MASK_CLASSNAME
| SEE_MASK_CLASSKEY
))
1022 /* launch a document by fileclass like 'WordPad.Document.1' */
1023 /* the Commandline contains 'c:\Path\wordpad.exe "%1"' */
1024 /* FIXME: wszParameters should not be of a fixed size. Fixed to 1024, MAX_PATH is way too short! */
1025 HCR_GetExecuteCommandW((sei_tmp
.fMask
& SEE_MASK_CLASSKEY
)? sei_tmp
.hkeyClass
: NULL
,
1026 (sei_tmp
.fMask
& SEE_MASK_CLASSNAME
)? sei_tmp
.lpClass
: NULL
,
1027 (sei_tmp
.lpVerb
)? sei_tmp
.lpVerb
: wszOpen
,
1028 wszParameters
/*sei_tmp.lpParameters*/, sizeof(wszParameters
)/sizeof(WCHAR
));
1030 /* FIXME: get the extension of lpFile, check if it fits to the lpClass */
1031 TRACE("SEE_MASK_CLASSNAME->'%s', doc->'%s'\n", debugstr_w(sei_tmp
.lpParameters
), debugstr_w(sei_tmp
.lpFile
));
1035 if (!SHELL_ArgifyW(buffer
, sizeof(buffer
)/sizeof(WCHAR
), sei_tmp
.lpParameters
, sei_tmp
.lpFile
, sei_tmp
.lpIDList
, NULL
) && sei_tmp
.lpFile
[0])
1037 strcatW(buffer
, wExtLnk
);
1038 strcatW(buffer
, sei_tmp
.lpFile
);
1041 retval
= execfunc(buffer
, NULL
, FALSE
, &sei_tmp
, psei
);
1049 /* resolve shell shortcuts */
1050 ext
= PathFindExtensionW(sei_tmp
.lpFile
);
1052 if (ext
&& !strcmpiW(ext
, wExtLnk
)) /* or check for: shell_attribs & SFGAO_LINK */
1056 /* expand paths before reading shell link */
1057 if (ExpandEnvironmentStringsW(sei_tmp
.lpFile
, buffer
, MAX_PATH
))
1058 lstrcpyW(wszApplicationName
/*sei_tmp.lpFile*/, buffer
);
1060 if (*sei_tmp
.lpParameters
)
1061 if (ExpandEnvironmentStringsW(sei_tmp
.lpParameters
, buffer
, MAX_PATH
))
1062 lstrcpyW(wszParameters
/*sei_tmp.lpParameters*/, buffer
);
1064 hr
= SHELL_ResolveShortCutW((LPWSTR
)sei_tmp
.lpFile
, (LPWSTR
)sei_tmp
.lpParameters
, (LPWSTR
)sei_tmp
.lpDirectory
,
1065 sei_tmp
.hwnd
, sei_tmp
.lpVerb
?sei_tmp
.lpVerb
:wszEmpty
, &sei_tmp
.nShow
, (LPITEMIDLIST
*)&sei_tmp
.lpIDList
);
1068 psei
->fMask
|= SEE_MASK_IDLIST
; //@@ nicht sei_tmp.fMask ?!
1072 /* repeat IDList processing if needed */
1073 if (sei_tmp
.fMask
& SEE_MASK_IDLIST
)
1075 IShellExecuteHookW
* pSEH
;
1077 HRESULT hr
= SHBindToParent(sei_tmp
.lpIDList
, &IID_IShellExecuteHookW
, (LPVOID
*)&pSEH
, NULL
);
1081 hr
= IShellExecuteHookW_Execute(pSEH
, psei
);
1083 IShellExecuteHookW_Release(pSEH
);
1089 TRACE("-- idlist=%p (%s)\n", debugstr_w(sei_tmp
.lpIDList
), debugstr_w(sei_tmp
.lpFile
));
1095 /* Has the IDList not yet been translated? */
1096 if (sei_tmp
.fMask
& SEE_MASK_IDLIST
)
1098 /* last chance to translate IDList: now also allow CLSID paths */
1099 if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW(sei_tmp
.lpIDList
, buffer
, sizeof(buffer
)))) {
1100 if (buffer
[0]==':' && buffer
[1]==':') {
1101 /* open shell folder for the specified class GUID */
1102 strcpyW(wszParameters
, buffer
);
1103 strcpyW(wszApplicationName
, wExplorer
);
1105 sei_tmp
.fMask
&= ~SEE_MASK_INVOKEIDLIST
;
1106 } else if (HCR_GetExecuteCommandW(0, wszFolder
, sei_tmp
.lpVerb
?sei_tmp
.lpVerb
:wszOpen
, buffer
, sizeof(buffer
))) {
1107 SHELL_ArgifyW(wszApplicationName
, sizeof(wszApplicationName
)/sizeof(WCHAR
), buffer
, NULL
, sei_tmp
.lpIDList
, NULL
);
1109 sei_tmp
.fMask
&= ~SEE_MASK_INVOKEIDLIST
;
1115 /* expand environment strings */
1117 if (ExpandEnvironmentStringsW(sei_tmp
.lpFile
, buffer
, MAX_PATH
))
1118 lstrcpyW(wszApplicationName
/*sei_tmp.lpFile*/, buffer
);
1120 if (*sei_tmp
.lpParameters
)
1121 if (ExpandEnvironmentStringsW(sei_tmp
.lpParameters
, buffer
, MAX_PATH
))
1122 lstrcpyW(wszParameters
/*sei_tmp.lpParameters*/, buffer
);
1124 if (*sei_tmp
.lpDirectory
)
1125 if (ExpandEnvironmentStringsW(sei_tmp
.lpDirectory
, buffer
, MAX_PATH
))
1126 lstrcpyW(wszDir
/*sei_tmp.lpDirectory*/, buffer
);
1128 /* Else, try to execute the filename */
1129 TRACE("execute:'%s','%s','%s'\n", debugstr_w(wszApplicationName
), debugstr_w(wszCommandline
), debugstr_w(wszDir
));
1132 /* separate out command line arguments from executable file name */
1133 if (!*sei_tmp
.lpParameters
) {
1134 /* If the executable path is quoted, handle the rest of the command line as parameters. */
1135 if (sei_tmp
.lpFile
[0] == '"') {
1136 LPWSTR src
= wszApplicationName
/*sei_tmp.lpFile*/ + 1;
1137 LPWSTR dst
= wfileName
;
1140 /* copy the unquoted executabe path to 'wfileName' */
1141 while(*src
&& *src
!='"')
1149 while(isspace(*src
))
1154 /* copy the parameter string to 'wszParameters' */
1155 strcpyW(wszParameters
, src
);
1157 /* terminate previous command string after the quote character */
1162 /* If the executable name is not quoted, we have to use this search loop here,
1163 that in CreateProcess() is not sufficient because it does not handle shell links. */
1164 WCHAR buffer
[MAX_PATH
], xlpFile
[MAX_PATH
];
1167 LPWSTR beg
= wszApplicationName
/*sei_tmp.lpFile*/;
1168 for(s
=beg
; (space
=strchrW(s
, ' ')); s
=space
+1) {
1169 int idx
= space
-sei_tmp
.lpFile
;
1170 strncpyW(buffer
, sei_tmp
.lpFile
, idx
);
1173 /*FIXME This finds directory paths if the targeted file name contains spaces. */
1174 if (SearchPathW(*sei_tmp
.lpDirectory
? sei_tmp
.lpDirectory
: NULL
, buffer
, wszExe
, sizeof(xlpFile
), xlpFile
, NULL
))
1176 /* separate out command from parameter string */
1177 LPCWSTR p
= space
+ 1;
1182 strcpyW(wszParameters
, p
);
1189 strcpyW(wfileName
, sei_tmp
.lpFile
);
1192 strcpyW(wfileName
, sei_tmp
.lpFile
);
1196 if (sei_tmp
.lpParameters
[0]) {
1197 strcatW(wszApplicationName
/*sei_tmp.lpFile*/, wSpace
);
1198 strcatW(wszApplicationName
/*sei_tmp.lpFile*/, sei_tmp
.lpParameters
);
1201 retval
= execfunc(sei_tmp
.lpFile
, NULL
, FALSE
, &sei_tmp
, psei
);
1204 /* Now, that we have successfully launched a process, we can free the PIDL.
1205 It may have been used before for %I command line options. */
1206 if (sei_tmp
.lpIDList
!=psei
->lpIDList
&& sei_tmp
.lpIDList
)
1207 SHFree(sei_tmp
.lpIDList
);
1209 TRACE("execfunc: retval=%d psei->hInstApp=%p\n", retval
, psei
->hInstApp
);
1213 /* Else, try to find the executable */
1215 retval
= SHELL_FindExecutable(*sei_tmp
.lpDirectory
? sei_tmp
.lpDirectory
: NULL
, lpFile
, sei_tmp
.lpVerb
, buffer
, 1024, wszProtocol
, &env
, sei_tmp
.lpIDList
, sei_tmp
.lpParameters
);
1217 if (retval
> 32) /* Found */
1219 WCHAR wszQuotedCmd
[MAX_PATH
+2];
1220 /* Must quote to handle case where 'buffer' contains spaces,
1221 * else security hole if malicious user creates executable file "C:\\Program"
1223 * FIXME: If we don't have set explicitly command line arguments, we must first
1224 * split executable path from optional command line arguments. Otherwise we would quote
1225 * the complete string with executable path _and_ arguments, which is not what we want.
1227 strcpyW(wszQuotedCmd
, wQuote
);
1228 strcatW(wszQuotedCmd
, buffer
);
1229 strcatW(wszQuotedCmd
, wQuote
);
1231 if (*sei_tmp
.lpParameters
) {
1232 strcatW(wszQuotedCmd
, wSpace
);
1233 strcatW(wszQuotedCmd
, sei_tmp
.lpParameters
);
1236 TRACE("%s/%s => %s/%s\n", debugstr_w(wszApplicationName
), debugstr_w(buffer
), debugstr_w(wszQuotedCmd
), debugstr_w(wszProtocol
));
1239 retval
= execute_from_key(wszProtocol
, lpFile
, env
, sei_tmp
.lpParameters
, execfunc
, &sei_tmp
, psei
);
1241 retval
= execfunc(wszQuotedCmd
, env
, FALSE
, &sei_tmp
, psei
);
1243 if (env
) HeapFree( GetProcessHeap(), 0, env
);
1245 else if (PathIsURLW((LPWSTR
)lpFile
)) /* File not found, check for URL */
1247 static const WCHAR wszShell
[] = {'\\','s','h','e','l','l','\\',0};
1248 static const WCHAR wCommand
[] = {'\\','c','o','m','m','a','n','d',0};
1252 lpstrRes
= strchrW(lpFile
, ':');
1254 iSize
= lpstrRes
- lpFile
;
1256 iSize
= strlenW(lpFile
);
1258 TRACE("Got URL: %s\n", debugstr_w(lpFile
));
1259 /* Looking for ...protocol\shell\<verb>\command */
1260 strncpyW(wszProtocol
, lpFile
, iSize
);
1261 wszProtocol
[iSize
] = '\0';
1262 strcatW(wszProtocol
, wszShell
);
1263 strcatW(wszProtocol
, sei_tmp
.lpVerb
? sei_tmp
.lpVerb
: wszOpen
);
1264 strcatW(wszProtocol
, wCommand
);
1266 /* Remove File Protocol from lpFile */
1267 /* In the case file://path/file */
1268 if (!strncmpiW(lpFile
, wFile
, iSize
))
1271 while (*lpFile
== ':') lpFile
++;
1274 retval
= execute_from_key(wszProtocol
, lpFile
, NULL
, sei_tmp
.lpParameters
, execfunc
, &sei_tmp
, psei
);
1276 /* Check if file specified is in the form www.??????.*** */
1277 else if (!strncmpiW(lpFile
, wWww
, 3))
1279 /* if so, append lpFile http:// and call ShellExecute */
1280 WCHAR lpstrTmpFile
[256];
1281 strcpyW(lpstrTmpFile
, wHttp
);
1282 strcatW(lpstrTmpFile
, lpFile
);
1283 retval
= (UINT
)ShellExecuteW(sei_tmp
.hwnd
, sei_tmp
.lpVerb
, lpstrTmpFile
, NULL
, NULL
, 0);
1286 /* Now we can free the PIDL. It may have been used before for %I command line options. */
1287 if (sei_tmp
.lpIDList
!=psei
->lpIDList
&& sei_tmp
.lpIDList
)
1288 SHFree(sei_tmp
.lpIDList
);
1290 TRACE("retval %u\n", retval
);
1294 psei
->hInstApp
= (HINSTANCE
)retval
;
1298 psei
->hInstApp
= (HINSTANCE
)33;
1302 /*************************************************************************
1303 * ShellExecuteA [SHELL32.290]
1305 HINSTANCE WINAPI
ShellExecuteA(HWND hWnd
, LPCSTR lpOperation
, LPCSTR lpFile
,
1306 LPCSTR lpParameters
, LPCSTR lpDirectory
, INT iShowCmd
)
1308 SHELLEXECUTEINFOA sei
;
1309 HANDLE hProcess
= 0;
1312 sei
.cbSize
= sizeof(sei
);
1315 sei
.lpVerb
= lpOperation
;
1316 sei
.lpFile
= lpFile
;
1317 sei
.lpParameters
= lpParameters
;
1318 sei
.lpDirectory
= lpDirectory
;
1319 sei
.nShow
= iShowCmd
;
1324 sei
.hProcess
= hProcess
;
1326 ShellExecuteExA (&sei
);
1327 return sei
.hInstApp
;
1330 /*************************************************************************
1331 * ShellExecuteEx [SHELL32.291]
1334 BOOL WINAPI
ShellExecuteExAW (LPVOID sei
)
1336 if (SHELL_OsIsUnicode())
1337 return ShellExecuteExW32 (sei
, SHELL_ExecuteW
);
1338 return ShellExecuteExA (sei
);
1341 /*************************************************************************
1342 * ShellExecuteExA [SHELL32.292]
1345 BOOL WINAPI
ShellExecuteExA (LPSHELLEXECUTEINFOA sei
)
1347 SHELLEXECUTEINFOW seiW
;
1349 WCHAR
*wVerb
= NULL
, *wFile
= NULL
, *wParameters
= NULL
, *wDirectory
= NULL
, *wClass
= NULL
;
1353 memcpy(&seiW
, sei
, sizeof(SHELLEXECUTEINFOW
));
1356 seiW
.lpVerb
= __SHCloneStrAtoW(&wVerb
, sei
->lpVerb
);
1359 seiW
.lpFile
= __SHCloneStrAtoW(&wFile
, sei
->lpFile
);
1361 if (sei
->lpParameters
)
1362 seiW
.lpParameters
= __SHCloneStrAtoW(&wParameters
, sei
->lpParameters
);
1364 if (sei
->lpDirectory
)
1365 seiW
.lpDirectory
= __SHCloneStrAtoW(&wDirectory
, sei
->lpDirectory
);
1367 if ((sei
->fMask
& SEE_MASK_CLASSNAME
) && sei
->lpClass
)
1368 seiW
.lpClass
= __SHCloneStrAtoW(&wClass
, sei
->lpClass
);
1370 seiW
.lpClass
= NULL
;
1372 ret
= ShellExecuteExW32 (&seiW
, SHELL_ExecuteW
);
1374 sei
->hInstApp
= seiW
.hInstApp
;
1376 if (wVerb
) SHFree(wVerb
);
1377 if (wFile
) SHFree(wFile
);
1378 if (wParameters
) SHFree(wParameters
);
1379 if (wDirectory
) SHFree(wDirectory
);
1380 if (wClass
) SHFree(wClass
);
1385 /*************************************************************************
1386 * ShellExecuteExW [SHELL32.293]
1389 BOOL WINAPI
ShellExecuteExW (LPSHELLEXECUTEINFOW sei
)
1391 return ShellExecuteExW32 (sei
, SHELL_ExecuteW
);
1394 /*************************************************************************
1395 * ShellExecuteW [SHELL32.294]
1397 * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation,
1398 * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
1400 HINSTANCE WINAPI
ShellExecuteW(HWND hwnd
, LPCWSTR lpOperation
, LPCWSTR lpFile
,
1401 LPCWSTR lpParameters
, LPCWSTR lpDirectory
, INT nShowCmd
)
1403 SHELLEXECUTEINFOW sei
;
1406 sei
.cbSize
= sizeof(sei
);
1409 sei
.lpVerb
= lpOperation
;
1410 sei
.lpFile
= lpFile
;
1411 sei
.lpParameters
= lpParameters
;
1412 sei
.lpDirectory
= lpDirectory
;
1413 sei
.nShow
= nShowCmd
;
1420 ShellExecuteExW32 (&sei
, SHELL_ExecuteW
);
1421 return sei
.hInstApp
;