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
43 #include "wine/winbase16.h"
44 #include "shell32_main.h"
45 #include "undocshell.h"
47 #include "wine/debug.h"
49 WINE_DEFAULT_DEBUG_CHANNEL(exec
);
51 /***********************************************************************
52 * this function is supposed to expand the escape sequences found in the registry
53 * some diving reported that the following were used:
54 * + %1, %2... seem to report to parameter of index N in ShellExecute pmts
59 * %I adress of a global item ID (explorer switch /idlist)
60 * %L seems to be %1 as long filename followed by the 8+3 variation
62 * %* all following parameters (see batfile)
64 static BOOL
argify(char* res
, int len
, const char* fmt
, const char* lpFile
)
81 if (!done
|| (*fmt
== '1'))
83 if (SearchPathA(NULL
, lpFile
, ".exe", sizeof(xlpFile
), xlpFile
, NULL
))
86 res
+= strlen(xlpFile
);
91 res
+= strlen(lpFile
);
95 default: FIXME("Unknown escape sequence %%%c\n", *fmt
);
107 /*************************************************************************
108 * SHELL_ExecuteA [Internal]
111 static UINT
SHELL_ExecuteA(char *lpCmd
, LPSHELLEXECUTEINFOA sei
, BOOL shWait
)
113 STARTUPINFOA startup
;
114 PROCESS_INFORMATION info
;
117 TRACE("Execute %s from directory %s\n", lpCmd
, sei
->lpDirectory
);
118 ZeroMemory(&startup
,sizeof(STARTUPINFOA
));
119 startup
.cb
= sizeof(STARTUPINFOA
);
120 startup
.dwFlags
= STARTF_USESHOWWINDOW
;
121 startup
.wShowWindow
= sei
->nShow
;
122 if (CreateProcessA(NULL
, lpCmd
, NULL
, NULL
, FALSE
, 0,
123 NULL
, sei
->lpDirectory
, &startup
, &info
))
125 /* Give 30 seconds to the app to come up, if desired. Probably only needed
126 when starting app immediately before making a DDE connection. */
128 if (WaitForInputIdle( info
.hProcess
, 30000 ) == -1)
129 WARN("WaitForInputIdle failed: Error %ld\n", GetLastError() );
131 if(sei
->fMask
& SEE_MASK_NOCLOSEPROCESS
)
132 sei
->hProcess
= info
.hProcess
;
134 CloseHandle( info
.hProcess
);
135 CloseHandle( info
.hThread
);
137 else if ((retval
= GetLastError()) >= 32)
139 FIXME("Strange error set by CreateProcess: %d\n", retval
);
140 retval
= ERROR_BAD_FORMAT
;
143 sei
->hInstApp
= (HINSTANCE
)retval
;
147 /*************************************************************************
148 * SHELL_FindExecutable [Internal]
150 * Utility for code sharing between FindExecutable and ShellExecute
152 * lpFile the name of a file
153 * lpOperation the operation on it (open)
155 * lpResult a buffer, big enough :-(, to store the command to do the
156 * operation on the file
157 * key a buffer, big enough, to get the key name to do actually the
158 * command (it'll be used afterwards for more information
161 static UINT
SHELL_FindExecutable(LPCSTR lpPath
, LPCSTR lpFile
, LPCSTR lpOperation
,
162 LPSTR lpResult
, LPSTR key
)
164 char *extension
= NULL
; /* pointer to file extension */
165 char tmpext
[5]; /* local copy to mung as we please */
166 char filetype
[256]; /* registry name for this filetype */
167 LONG filetypelen
= 256; /* length of above */
168 char command
[256]; /* command from registry */
169 LONG commandlen
= 256; /* This is the most DOS can handle :) */
170 char buffer
[256]; /* Used to GetProfileString */
171 UINT retval
= 31; /* default - 'No association was found' */
172 char *tok
; /* token pointer */
173 int i
; /* random counter */
174 char xlpFile
[256] = ""; /* result of SearchPath */
176 TRACE("%s\n", (lpFile
!= NULL
) ? lpFile
: "-");
178 lpResult
[0] = '\0'; /* Start off with an empty return string */
180 /* trap NULL parameters on entry */
181 if ((lpFile
== NULL
) || (lpResult
== NULL
) || (lpOperation
== NULL
))
183 WARN("(lpFile=%s,lpResult=%s,lpOperation=%s): NULL parameter\n",
184 lpFile
, lpOperation
, lpResult
);
185 return 2; /* File not found. Close enough, I guess. */
188 if (SearchPathA(lpPath
, lpFile
, ".exe", sizeof(xlpFile
), xlpFile
, NULL
))
190 TRACE("SearchPathA returned non-zero\n");
194 /* First thing we need is the file's extension */
195 extension
= strrchr(xlpFile
, '.'); /* Assume last "." is the one; */
196 /* File->Run in progman uses */
198 TRACE("xlpFile=%s,extension=%s\n", xlpFile
, extension
);
200 if ((extension
== NULL
) || (extension
== &xlpFile
[strlen(xlpFile
)]))
202 WARN("Returning 31 - No association\n");
203 return 31; /* no association */
206 /* Make local copy & lowercase it for reg & 'programs=' lookup */
207 lstrcpynA(tmpext
, extension
, 5);
209 TRACE("%s file\n", tmpext
);
211 /* Three places to check: */
212 /* 1. win.ini, [windows], programs (NB no leading '.') */
213 /* 2. Registry, HKEY_CLASS_ROOT\<filetype>\shell\open\command */
214 /* 3. win.ini, [extensions], extension (NB no leading '.' */
215 /* All I know of the order is that registry is checked before */
216 /* extensions; however, it'd make sense to check the programs */
217 /* section first, so that's what happens here. */
219 if (key
) *key
= '\0';
221 /* See if it's a program - if GetProfileString fails, we skip this
222 * section. Actually, if GetProfileString fails, we've probably
223 * got a lot more to worry about than running a program... */
224 if (GetProfileStringA("windows", "programs", "exe pif bat com",
225 buffer
, sizeof(buffer
)) > 0)
227 for (i
= 0;i
<strlen(buffer
); i
++) buffer
[i
] = tolower(buffer
[i
]);
229 tok
= strtok(buffer
, " \t"); /* ? */
232 if (strcmp(tok
, &tmpext
[1]) == 0) /* have to skip the leading "." */
234 strcpy(lpResult
, xlpFile
);
235 /* Need to perhaps check that the file has a path
237 TRACE("found %s\n", lpResult
);
240 /* Greater than 32 to indicate success FIXME According to the
241 * docs, I should be returning a handle for the
242 * executable. Does this mean I'm supposed to open the
243 * executable file or something? More RTFM, I guess... */
245 tok
= strtok(NULL
, " \t");
250 if (RegQueryValueA(HKEY_CLASSES_ROOT
, tmpext
, filetype
,
251 &filetypelen
) == ERROR_SUCCESS
)
253 filetype
[filetypelen
] = '\0';
254 TRACE("File type: %s\n", filetype
);
256 /* Looking for ...buffer\shell\lpOperation\command */
257 strcat(filetype
, "\\shell\\");
258 strcat(filetype
, lpOperation
);
259 strcat(filetype
, "\\command");
261 if (RegQueryValueA(HKEY_CLASSES_ROOT
, filetype
, command
,
262 &commandlen
) == ERROR_SUCCESS
)
264 if (key
) strcpy(key
, filetype
);
270 /* FIXME: it seems all Windows version don't behave the same here.
271 * the doc states that this ddeexec information can be found after
273 * on Win98, it doesn't appear, but I think it does on Win2k
275 /* Get the parameters needed by the application
276 from the associated ddeexec key */
277 tmp
= strstr(filetype
, "command");
279 strcat(filetype
, "ddeexec");
281 if (RegQueryValueA(HKEY_CLASSES_ROOT
, filetype
, param
, ¶mlen
) == ERROR_SUCCESS
)
283 strcat(command
, " ");
284 strcat(command
, param
);
285 commandlen
+= paramlen
;
288 command
[commandlen
] = '\0';
289 argify(lpResult
, sizeof(lpResult
), command
, xlpFile
);
290 retval
= 33; /* FIXME see above */
293 else /* Check win.ini */
295 /* Toss the leading dot */
297 if (GetProfileStringA("extensions", extension
, "", command
,
298 sizeof(command
)) > 0)
300 if (strlen(command
) != 0)
302 strcpy(lpResult
, command
);
303 tok
= strstr(lpResult
, "^"); /* should be ^.extension? */
307 strcat(lpResult
, xlpFile
); /* what if no dir in xlpFile? */
308 tok
= strstr(command
, "^"); /* see above */
309 if ((tok
!= NULL
) && (strlen(tok
)>5))
311 strcat(lpResult
, &tok
[5]);
314 retval
= 33; /* FIXME - see above */
319 TRACE("returning %s\n", lpResult
);
323 /******************************************************************
326 * callback for the DDE connection. not really usefull
328 static HDDEDATA CALLBACK
dde_cb(UINT uType
, UINT uFmt
, HCONV hConv
,
330 HDDEDATA hData
, DWORD dwData1
, DWORD dwData2
)
335 /******************************************************************
338 * ShellExecute helper. Used to do an operation with a DDE connection
340 * Handles both the direct connection (try #1), and if it fails,
341 * launching an application and trying (#2) to connect to it
344 static unsigned dde_connect(char* key
, char* start
, char* ddeexec
,
346 LPSHELLEXECUTEINFOA sei
, SHELL_ExecuteA1632 execfunc
)
348 char* endkey
= key
+ strlen(key
);
349 char app
[256], topic
[256], ifexec
[256], res
[256];
350 LONG applen
, topiclen
, ifexeclen
;
354 HSZ hszApp
, hszTopic
;
358 strcpy(endkey
, "\\application");
359 applen
= sizeof(app
);
360 if (RegQueryValueA(HKEY_CLASSES_ROOT
, key
, app
, &applen
) != ERROR_SUCCESS
)
362 FIXME("default app name NIY %s\n", key
);
366 strcpy(endkey
, "\\topic");
367 topiclen
= sizeof(topic
);
368 if (RegQueryValueA(HKEY_CLASSES_ROOT
, key
, topic
, &topiclen
) != ERROR_SUCCESS
)
370 strcpy(topic
, "System");
373 if (DdeInitializeA(&ddeInst
, dde_cb
, APPCMD_CLIENTONLY
, 0L) != DMLERR_NO_ERROR
)
378 hszApp
= DdeCreateStringHandleA(ddeInst
, app
, CP_WINANSI
);
379 hszTopic
= DdeCreateStringHandleA(ddeInst
, topic
, CP_WINANSI
);
381 hConv
= DdeConnect(ddeInst
, hszApp
, hszTopic
, NULL
);
385 TRACE("Launching '%s'\n", start
);
386 ret
= execfunc(start
, sei
, TRUE
);
389 TRACE("Couldn't launch\n");
392 hConv
= DdeConnect(ddeInst
, hszApp
, hszTopic
, NULL
);
395 TRACE("Couldn't connect. ret=%d\n", ret
);
396 ret
= 30; /* whatever */
399 strcpy(endkey
, "\\ifexec");
400 ifexeclen
= sizeof(ifexec
);
401 if (RegQueryValueA(HKEY_CLASSES_ROOT
, key
, ifexec
, &ifexeclen
) == ERROR_SUCCESS
)
407 argify(res
, sizeof(res
), exec
, lpFile
);
408 TRACE("%s %s => %s\n", exec
, lpFile
, res
);
410 ret
= (DdeClientTransaction(res
, strlen(res
) + 1, hConv
, 0L, 0,
411 XTYP_EXECUTE
, 10000, &tid
) != DMLERR_NO_ERROR
) ? 31 : 33;
412 DdeDisconnect(hConv
);
414 DdeUninitialize(ddeInst
);
418 /*************************************************************************
419 * execute_from_key [Internal]
421 static UINT
execute_from_key(LPSTR key
, LPCSTR lpFile
, LPSHELLEXECUTEINFOA sei
, SHELL_ExecuteA1632 execfunc
)
424 LONG cmdlen
= sizeof(cmd
);
427 /* Get the application for the registry */
428 if (RegQueryValueA(HKEY_CLASSES_ROOT
, key
, cmd
, &cmdlen
) == ERROR_SUCCESS
)
431 char param
[256] = "";
434 /* Get the parameters needed by the application
435 from the associated ddeexec key */
436 tmp
= strstr(key
, "command");
438 strcpy(tmp
, "ddeexec");
440 if (RegQueryValueA(HKEY_CLASSES_ROOT
, key
, param
, ¶mlen
) == ERROR_SUCCESS
)
442 TRACE("Got ddeexec %s => %s\n", key
, param
);
443 retval
= dde_connect(key
, cmd
, param
, lpFile
, sei
, execfunc
);
447 /* Is there a replace() function anywhere? */
449 argify(param
, sizeof(param
), cmd
, lpFile
);
450 retval
= execfunc(param
, sei
, FALSE
);
453 else TRACE("ooch\n");
458 /*************************************************************************
459 * FindExecutableA [SHELL32.@]
461 HINSTANCE WINAPI
FindExecutableA(LPCSTR lpFile
, LPCSTR lpDirectory
, LPSTR lpResult
)
463 UINT retval
= 31; /* default - 'No association was found' */
466 TRACE("File %s, Dir %s\n",
467 (lpFile
!= NULL
? lpFile
: "-"), (lpDirectory
!= NULL
? lpDirectory
: "-"));
469 lpResult
[0] = '\0'; /* Start off with an empty return string */
471 /* trap NULL parameters on entry */
472 if ((lpFile
== NULL
) || (lpResult
== NULL
))
474 /* FIXME - should throw a warning, perhaps! */
475 return (HINSTANCE
)2; /* File not found. Close enough, I guess. */
480 GetCurrentDirectoryA(sizeof(old_dir
), old_dir
);
481 SetCurrentDirectoryA(lpDirectory
);
484 retval
= SHELL_FindExecutable(lpDirectory
, lpFile
, "open", lpResult
, NULL
);
486 TRACE("returning %s\n", lpResult
);
488 SetCurrentDirectoryA(old_dir
);
489 return (HINSTANCE
)retval
;
492 /*************************************************************************
493 * FindExecutableW [SHELL32.@]
495 HINSTANCE WINAPI
FindExecutableW(LPCWSTR lpFile
, LPCWSTR lpDirectory
, LPWSTR lpResult
)
497 FIXME("(%p,%p,%p): stub\n", lpFile
, lpDirectory
, lpResult
);
498 return (HINSTANCE
)31; /* default - 'No association was found' */
501 /*************************************************************************
502 * ShellExecuteExA32 [Internal]
504 BOOL WINAPI
ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei
, SHELL_ExecuteA1632 execfunc
)
506 CHAR szApplicationName
[MAX_PATH
],szCommandline
[MAX_PATH
],szPidl
[20],fileName
[MAX_PATH
];
509 char lpstrProtocol
[256];
510 LPCSTR lpFile
,lpOperation
;
515 TRACE("mask=0x%08lx hwnd=%p verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s\n",
516 sei
->fMask
, sei
->hwnd
, debugstr_a(sei
->lpVerb
),
517 debugstr_a(sei
->lpFile
), debugstr_a(sei
->lpParameters
),
518 debugstr_a(sei
->lpDirectory
), sei
->nShow
,
519 (sei
->fMask
& SEE_MASK_CLASSNAME
) ? debugstr_a(sei
->lpClass
) : "not used");
521 sei
->hProcess
= (HANDLE
)NULL
;
522 ZeroMemory(szApplicationName
,MAX_PATH
);
524 strcpy(szApplicationName
, sei
->lpFile
);
526 ZeroMemory(szCommandline
,MAX_PATH
);
527 if (sei
->lpParameters
)
528 strcpy(szCommandline
, sei
->lpParameters
);
530 if (sei
->fMask
& ((SEE_MASK_CLASSKEY
& ~SEE_MASK_CLASSNAME
) |
531 SEE_MASK_INVOKEIDLIST
| SEE_MASK_ICON
| SEE_MASK_HOTKEY
|
532 SEE_MASK_CONNECTNETDRV
| SEE_MASK_FLAG_DDEWAIT
|
533 SEE_MASK_DOENVSUBST
| SEE_MASK_FLAG_NO_UI
| SEE_MASK_UNICODE
|
534 SEE_MASK_NO_CONSOLE
| SEE_MASK_ASYNCOK
| SEE_MASK_HMONITOR
))
536 FIXME("flags ignored: 0x%08lx\n", sei
->fMask
);
539 /* process the IDList */
540 if ( (sei
->fMask
& SEE_MASK_INVOKEIDLIST
) == SEE_MASK_INVOKEIDLIST
) /*0x0c*/
542 SHGetPathFromIDListA (sei
->lpIDList
,szApplicationName
);
543 TRACE("-- idlist=%p (%s)\n", sei
->lpIDList
, szApplicationName
);
547 if (sei
->fMask
& SEE_MASK_IDLIST
)
549 pos
= strstr(szCommandline
, "%I");
553 HGLOBAL hmem
= SHAllocShared ( sei
->lpIDList
, ILGetSize(sei
->lpIDList
), 0);
554 pv
= SHLockShared(hmem
,0);
555 sprintf(szPidl
,":%p",pv
);
558 gap
= strlen(szPidl
);
560 memmove(pos
+gap
,pos
+2,len
);
561 memcpy(pos
,szPidl
,gap
);
566 if (sei
->fMask
& SEE_MASK_CLASSNAME
)
568 /* launch a document by fileclass like 'WordPad.Document.1' */
569 /* the Commandline contains 'c:\Path\wordpad.exe "%1"' */
570 /* FIXME: szCommandline should not be of a fixed size. Plus MAX_PATH is way too short! */
571 HCR_GetExecuteCommand(sei
->lpClass
, (sei
->lpVerb
) ? sei
->lpVerb
: "open", szCommandline
, sizeof(szCommandline
));
572 /* FIXME: get the extension of lpFile, check if it fits to the lpClass */
573 TRACE("SEE_MASK_CLASSNAME->'%s', doc->'%s'\n", szCommandline
, szApplicationName
);
576 done
= argify(cmd
, sizeof(cmd
), szCommandline
, szApplicationName
);
577 if (!done
&& szApplicationName
[0])
580 strcat(cmd
, szApplicationName
);
582 retval
= execfunc(cmd
, sei
, FALSE
);
589 /* We set the default to open, and that should generally work.
590 But that is not really the way the MS docs say to do it. */
591 if (sei
->lpVerb
== NULL
)
592 lpOperation
= "open";
594 lpOperation
= sei
->lpVerb
;
596 /* Else, try to execute the filename */
597 TRACE("execute:'%s','%s'\n",szApplicationName
, szCommandline
);
599 strcpy(fileName
, szApplicationName
);
601 if (szCommandline
[0]) {
602 strcat(szApplicationName
, " ");
603 strcat(szApplicationName
, szCommandline
);
606 retval
= execfunc(szApplicationName
, sei
, FALSE
);
610 /* Else, try to find the executable */
612 retval
= SHELL_FindExecutable(sei
->lpDirectory
, lpFile
, lpOperation
, cmd
, lpstrProtocol
);
613 if (retval
> 32) /* Found */
615 if (szCommandline
[0]) {
617 strcat(cmd
, szCommandline
);
619 TRACE("%s/%s => %s/%s\n", szApplicationName
, lpOperation
, cmd
, lpstrProtocol
);
621 retval
= execute_from_key(lpstrProtocol
, szApplicationName
, sei
, execfunc
);
623 retval
= execfunc(cmd
, sei
, FALSE
);
625 else if (PathIsURLA((LPSTR
)lpFile
)) /* File not found, check for URL */
630 lpstrRes
= strchr(lpFile
, ':');
632 iSize
= lpstrRes
- lpFile
;
634 iSize
= strlen(lpFile
);
636 TRACE("Got URL: %s\n", lpFile
);
637 /* Looking for ...protocol\shell\lpOperation\command */
638 strncpy(lpstrProtocol
, lpFile
, iSize
);
639 lpstrProtocol
[iSize
] = '\0';
640 strcat(lpstrProtocol
, "\\shell\\");
641 strcat(lpstrProtocol
, lpOperation
);
642 strcat(lpstrProtocol
, "\\command");
644 /* Remove File Protocol from lpFile */
645 /* In the case file://path/file */
646 if (!strncasecmp(lpFile
, "file", iSize
))
649 while (*lpFile
== ':') lpFile
++;
651 retval
= execute_from_key(lpstrProtocol
, lpFile
, sei
, execfunc
);
653 /* Check if file specified is in the form www.??????.*** */
654 else if (!strncasecmp(lpFile
, "www", 3))
656 /* if so, append lpFile http:// and call ShellExecute */
657 char lpstrTmpFile
[256] = "http://" ;
658 strcat(lpstrTmpFile
, lpFile
);
659 retval
= (UINT
)ShellExecuteA(sei
->hwnd
, lpOperation
, lpstrTmpFile
, NULL
, NULL
, 0);
664 sei
->hInstApp
= (HINSTANCE
)retval
;
668 sei
->hInstApp
= (HINSTANCE
)33;
672 /*************************************************************************
673 * ShellExecuteA [SHELL32.290]
675 HINSTANCE WINAPI
ShellExecuteA(HWND hWnd
, LPCSTR lpOperation
,LPCSTR lpFile
,
676 LPCSTR lpParameters
,LPCSTR lpDirectory
, INT iShowCmd
)
678 SHELLEXECUTEINFOA sei
;
682 sei
.cbSize
= sizeof(sei
);
685 sei
.lpVerb
= lpOperation
;
687 sei
.lpParameters
= lpParameters
;
688 sei
.lpDirectory
= lpDirectory
;
689 sei
.nShow
= iShowCmd
;
694 sei
.hProcess
= hProcess
;
696 ShellExecuteExA32 (&sei
, SHELL_ExecuteA
);
700 /*************************************************************************
701 * ShellExecuteEx [SHELL32.291]
704 BOOL WINAPI
ShellExecuteExAW (LPVOID sei
)
706 if (SHELL_OsIsUnicode())
707 return ShellExecuteExW (sei
);
708 return ShellExecuteExA32 (sei
, SHELL_ExecuteA
);
711 /*************************************************************************
712 * ShellExecuteExA [SHELL32.292]
715 BOOL WINAPI
ShellExecuteExA (LPSHELLEXECUTEINFOA sei
)
717 return ShellExecuteExA32 (sei
, SHELL_ExecuteA
);
720 /*************************************************************************
721 * ShellExecuteExW [SHELL32.293]
724 BOOL WINAPI
ShellExecuteExW (LPSHELLEXECUTEINFOW sei
)
726 SHELLEXECUTEINFOA seiA
;
731 memcpy(&seiA
, sei
, sizeof(SHELLEXECUTEINFOA
));
734 seiA
.lpVerb
= HEAP_strdupWtoA( GetProcessHeap(), 0, sei
->lpVerb
);
737 seiA
.lpFile
= HEAP_strdupWtoA( GetProcessHeap(), 0, sei
->lpFile
);
739 if (sei
->lpParameters
)
740 seiA
.lpParameters
= HEAP_strdupWtoA( GetProcessHeap(), 0, sei
->lpParameters
);
742 if (sei
->lpDirectory
)
743 seiA
.lpDirectory
= HEAP_strdupWtoA( GetProcessHeap(), 0, sei
->lpDirectory
);
745 if ((sei
->fMask
& SEE_MASK_CLASSNAME
) && sei
->lpClass
)
746 seiA
.lpClass
= HEAP_strdupWtoA( GetProcessHeap(), 0, sei
->lpClass
);
750 ret
= ShellExecuteExA(&seiA
);
752 if (seiA
.lpVerb
) HeapFree( GetProcessHeap(), 0, (LPSTR
) seiA
.lpVerb
);
753 if (seiA
.lpFile
) HeapFree( GetProcessHeap(), 0, (LPSTR
) seiA
.lpFile
);
754 if (seiA
.lpParameters
) HeapFree( GetProcessHeap(), 0, (LPSTR
) seiA
.lpParameters
);
755 if (seiA
.lpDirectory
) HeapFree( GetProcessHeap(), 0, (LPSTR
) seiA
.lpDirectory
);
756 if (seiA
.lpClass
) HeapFree( GetProcessHeap(), 0, (LPSTR
) seiA
.lpClass
);
761 /*************************************************************************
762 * ShellExecuteW [SHELL32.294]
764 * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation,
765 * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
767 HINSTANCE WINAPI
ShellExecuteW(HWND hwnd
, LPCWSTR lpOperation
, LPCWSTR lpFile
,
768 LPCWSTR lpParameters
, LPCWSTR lpDirectory
, INT nShowCmd
)
770 SHELLEXECUTEINFOW sei
;
774 sei
.cbSize
= sizeof(sei
);
777 sei
.lpVerb
= lpOperation
;
779 sei
.lpParameters
= lpParameters
;
780 sei
.lpDirectory
= lpDirectory
;
781 sei
.nShow
= nShowCmd
;
786 sei
.hProcess
= hProcess
;
788 ShellExecuteExW (&sei
);