source: trunk/src/shell32/shellord.c@ 6650

Last change on this file since 6650 was 6650, checked in by bird, 24 years ago

Added $Id:$ keyword.

File size: 27.8 KB
Line 
1/* $Id: shellord.c,v 1.4 2001-09-05 13:46:57 bird Exp $ */
2/*
3 * The parameters of many functions changes between different OS versions
4 * (NT uses Unicode strings, 95 uses ASCII strings)
5 *
6 * Copyright 1997 Marcus Meissner
7 * 1998 Jürgen Schmied
8 */
9#include <string.h>
10#include <stdio.h>
11#include "winerror.h"
12#include "winreg.h"
13#include "debugtools.h"
14#include "winnls.h"
15#include "heap.h"
16
17#include "shellapi.h"
18#include "shlguid.h"
19#include "shlobj.h"
20#include "shell32_main.h"
21#include "wine/undocshell.h"
22
23DEFAULT_DEBUG_CHANNEL(shell);
24
25/*************************************************************************
26 * ParseFieldA [internal]
27 *
28 * copys a field from a ',' delimited string
29 *
30 * first field is nField = 1
31 */
32DWORD WINAPI ParseFieldA(
33 LPCSTR src,
34 DWORD nField,
35 LPSTR dst,
36 DWORD len)
37{
38 WARN("('%s',0x%08lx,%p,%ld) semi-stub.\n",src,nField,dst,len);
39
40 if (!src || !src[0] || !dst || !len)
41 return 0;
42
43 /* skip n fields delimited by ',' */
44 while (nField > 1)
45 {
46 if (*src=='\0') return FALSE;
47 if (*(src++)==',') nField--;
48 }
49
50 /* copy part till the next ',' to dst */
51 while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
52
53 /* finalize the string */
54 *dst=0x0;
55
56 return TRUE;
57}
58
59/*************************************************************************
60 * ParseFieldW [internal]
61 *
62 * copys a field from a ',' delimited string
63 *
64 * first field is nField = 1
65 */
66DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
67{
68 FIXME("('%s',0x%08lx,%p,%ld) stub.\n",
69 debugstr_w(src), nField, dst, len);
70 return FALSE;
71}
72
73/*************************************************************************
74 * ParseFieldAW [SHELL32.58]
75 */
76DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
77{
78 if (SHELL_OsIsUnicode())
79 return ParseFieldW(src, nField, dst, len);
80 return ParseFieldA(src, nField, dst, len);
81}
82
83/*************************************************************************
84 * GetFileNameFromBrowse [SHELL32.63]
85 *
86 */
87BOOL WINAPI GetFileNameFromBrowse(
88 HWND hwndOwner,
89 LPSTR lpstrFile,
90 DWORD nMaxFile,
91 LPCSTR lpstrInitialDir,
92 LPCSTR lpstrDefExt,
93 LPCSTR lpstrFilter,
94 LPCSTR lpstrTitle)
95{
96 FIXME("(%04x,%s,%ld,%s,%s,%s,%s):stub.\n",
97 hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt,
98 lpstrFilter, lpstrTitle);
99
100 /* puts up a Open Dialog and requests input into targetbuf */
101 /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
102 strcpy(lpstrFile,"x:\\dummy.exe");
103 return 1;
104}
105
106/*************************************************************************
107 * SHGetSetSettings [SHELL32.68]
108 */
109VOID WINAPI SHGetSetSettings(DWORD x, DWORD y, DWORD z)
110{
111 FIXME("0x%08lx 0x%08lx 0x%08lx\n", x, y, z);
112}
113
114/*************************************************************************
115 * SHGetSettings [SHELL32.@]
116 *
117 * NOTES
118 * the registry path are for win98 (tested)
119 * and possibly are the same in nt40
120 *
121 */
122VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
123{
124 HKEY hKey;
125 DWORD dwData;
126 DWORD dwDataSize = sizeof (DWORD);
127
128 TRACE("(%p 0x%08lx)\n",lpsfs,dwMask);
129
130 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
131 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
132 return;
133
134 if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
135 lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
136
137 if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
138 lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
139
140 if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
141 lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
142
143 if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
144 lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
145
146 if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
147 lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
148
149 if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
150 lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
151
152 if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
153 { if (dwData == 0)
154 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
155 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
156 }
157 else if (dwData == 1)
158 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
159 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
160 }
161 else if (dwData == 2)
162 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
163 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
164 }
165 }
166 RegCloseKey (hKey);
167
168 TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
169}
170
171/*************************************************************************
172 * SHShellFolderView_Message [SHELL32.73]
173 *
174 * PARAMETERS
175 * hwndCabinet defines the explorer cabinet window that contains the
176 * shellview you need to communicate with
177 * uMsg identifying the SFVM enum to perform
178 * lParam
179 *
180 * NOTES
181 * Message SFVM_REARRANGE = 1
182 * This message gets sent when a column gets clicked to instruct the
183 * shell view to re-sort the item list. lParam identifies the column
184 * that was clicked.
185 */
186int WINAPI SHShellFolderView_Message(
187 HWND hwndCabinet,
188 DWORD dwMessage,
189 DWORD dwParam)
190{
191 FIXME("%04x %08lx %08lx stub\n",hwndCabinet, dwMessage, dwParam);
192 return 0;
193}
194
195/*************************************************************************
196 * RegisterShellHook [SHELL32.181]
197 *
198 * PARAMS
199 * hwnd [I] window handle
200 * y [I] flag ????
201 *
202 * NOTES
203 * exported by ordinal
204 */
205BOOL WINAPI RegisterShellHook(
206 HWND hWnd,
207 DWORD dwType)
208{
209 FIXME("(0x%08x,0x%08lx):stub.\n",hWnd, dwType);
210 return TRUE;
211}
212/*************************************************************************
213 * ShellMessageBoxW [SHELL32.182]
214 *
215 * Format and output errormessage.
216 *
217 * idText resource ID of title or LPSTR
218 * idTitle resource ID of title or LPSTR
219 *
220 * NOTES
221 * exported by ordinal
222 */
223int WINAPIV ShellMessageBoxW(
224 HINSTANCE hInstance,
225 HWND hWnd,
226 LPCWSTR lpText,
227 LPCWSTR lpCaption,
228 UINT uType,
229 ...)
230{
231 WCHAR szText[100],szTitle[100];
232 LPCWSTR pszText = szText, pszTitle = szTitle, pszTemp;
233 va_list args;
234 int ret;
235
236 va_start(args, uType);
237 /* wvsprintfA(buf,fmt, args); */
238
239 TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
240 (DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
241
242 if (!HIWORD(lpCaption))
243 LoadStringW(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
244 else
245 pszTitle = lpCaption;
246
247 if (!HIWORD(lpText))
248 LoadStringW(hInstance, (DWORD)lpText, szText, sizeof(szText)/sizeof(szText[0]));
249 else
250 pszText = lpText;
251
252 FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
253 pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
254
255 va_end(args);
256
257 ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
258 LocalFree((HLOCAL)pszTemp);
259 return ret;
260}
261
262/*************************************************************************
263 * ShellMessageBoxA [SHELL32.183]
264 */
265int WINAPIV ShellMessageBoxA(
266 HINSTANCE hInstance,
267 HWND hWnd,
268 LPCSTR lpText,
269 LPCSTR lpCaption,
270 UINT uType,
271 ...)
272{
273 char szText[100],szTitle[100];
274 LPCSTR pszText = szText, pszTitle = szTitle, pszTemp;
275 va_list args;
276 int ret;
277
278 va_start(args, uType);
279 /* wvsprintfA(buf,fmt, args); */
280
281 TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
282 (DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
283
284 if (!HIWORD(lpCaption))
285 LoadStringA(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle));
286 else
287 pszTitle = lpCaption;
288
289 if (!HIWORD(lpText))
290 LoadStringA(hInstance, (DWORD)lpText, szText, sizeof(szText));
291 else
292 pszText = lpText;
293
294 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
295 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
296
297 va_end(args);
298
299 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
300 LocalFree((HLOCAL)pszTemp);
301 return ret;
302}
303
304/*************************************************************************
305 * SHFree [SHELL32.195]
306 *
307 * NOTES
308 * free_ptr() - frees memory using IMalloc
309 * exported by ordinal
310 */
311#define MEM_DEBUG 0
312void WINAPI SHFree(LPVOID x)
313{
314#if MEM_DEBUG
315 WORD len = *(LPWORD)((LPBYTE)x-2);
316
317 if ( *(LPWORD)((LPBYTE)x+len) != 0x7384)
318 ERR("MAGIC2!\n");
319
320 if ( (*(LPWORD)((LPBYTE)x-4)) != 0x8271)
321 ERR("MAGIC1!\n");
322 else
323 memset((LPBYTE)x-4, 0xde, len+6);
324
325 TRACE("%p len=%u\n",x, len);
326
327 x = (LPBYTE) x - 4;
328#else
329 TRACE("%p\n",x);
330#endif
331 HeapFree(GetProcessHeap(), 0, x);
332}
333
334/*************************************************************************
335 * SHAlloc [SHELL32.196]
336 *
337 * NOTES
338 * void *task_alloc(DWORD len), uses SHMalloc allocator
339 * exported by ordinal
340 */
341LPVOID WINAPI SHAlloc(DWORD len)
342{
343 LPBYTE ret;
344
345#if MEM_DEBUG
346 ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len+6);
347#else
348 ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len);
349#endif
350
351#if MEM_DEBUG
352 *(LPWORD)(ret) = 0x8271;
353 *(LPWORD)(ret+2) = (WORD)len;
354 *(LPWORD)(ret+4+len) = 0x7384;
355 ret += 4;
356 memset(ret, 0xdf, len);
357#endif
358 TRACE("%lu bytes at %p\n",len, ret);
359 return (LPVOID)ret;
360}
361
362/*************************************************************************
363 * SHRegisterDragDrop [SHELL32.86]
364 *
365 * NOTES
366 * exported by ordinal
367 */
368HRESULT WINAPI SHRegisterDragDrop(
369 HWND hWnd,
370 LPDROPTARGET pDropTarget)
371{
372 FIXME("(0x%08x,%p):stub.\n", hWnd, pDropTarget);
373 if (GetShellOle()) return pRegisterDragDrop(hWnd, pDropTarget);
374 return 0;
375}
376
377/*************************************************************************
378 * SHRevokeDragDrop [SHELL32.87]
379 *
380 * NOTES
381 * exported by ordinal
382 */
383HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
384{
385 FIXME("(0x%08x):stub.\n",hWnd);
386 return 0;
387}
388
389/*************************************************************************
390 * SHDoDragDrop [SHELL32.88]
391 *
392 * NOTES
393 * exported by ordinal
394 */
395HRESULT WINAPI SHDoDragDrop(
396 HWND hWnd,
397 LPDATAOBJECT lpDataObject,
398 LPDROPSOURCE lpDropSource,
399 DWORD dwOKEffect,
400 LPDWORD pdwEffect)
401{
402 FIXME("(0x%04x %p %p 0x%08lx %p):stub.\n",
403 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
404 return 0;
405}
406
407/*************************************************************************
408 * ArrangeWindows [SHELL32.184]
409 *
410 */
411WORD WINAPI ArrangeWindows(
412 HWND hwndParent,
413 DWORD dwReserved,
414 LPCRECT lpRect,
415 WORD cKids,
416 CONST HWND * lpKids)
417{
418 FIXME("(0x%08x 0x%08lx %p 0x%04x %p):stub.\n",
419 hwndParent, dwReserved, lpRect, cKids, lpKids);
420 return 0;
421}
422
423/*************************************************************************
424 * SignalFileOpen [SHELL32.103]
425 *
426 * NOTES
427 * exported by ordinal
428 */
429DWORD WINAPI
430SignalFileOpen (DWORD dwParam1)
431{
432 FIXME("(0x%08lx):stub.\n", dwParam1);
433
434 return 0;
435}
436
437/*************************************************************************
438 * SHAddToRecentDocs [SHELL32.234]
439 *
440 * PARAMETERS
441 * uFlags [IN] SHARD_PATH or SHARD_PIDL
442 * pv [IN] string or pidl, NULL clears the list
443 *
444 * NOTES
445 * exported by name
446 */
447DWORD WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
448{ if (SHARD_PIDL==uFlags)
449 { FIXME("(0x%08x,pidl=%p):stub.\n", uFlags,pv);
450 }
451 else
452 { FIXME("(0x%08x,%s):stub.\n", uFlags,(char*)pv);
453 }
454 return 0;
455}
456/*************************************************************************
457 * SHCreateShellFolderViewEx [SHELL32.174]
458 *
459 * NOTES
460 * see IShellFolder::CreateViewObject
461 */
462HRESULT WINAPI SHCreateShellFolderViewEx(
463 LPCSHELLFOLDERVIEWINFO psvcbi, /* [in] shelltemplate struct */
464 LPSHELLVIEW* ppv) /* [out] IShellView pointer */
465{
466 IShellView * psf;
467 HRESULT hRes;
468
469 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=0x%08lx\n",
470 psvcbi->pshf, psvcbi->pidlFolder, psvcbi->lpfnCallback,
471 psvcbi->uViewMode, psvcbi->dwUser);
472
473 psf = IShellView_Constructor(psvcbi->pshf);
474
475 if (!psf)
476 return E_OUTOFMEMORY;
477
478 IShellView_AddRef(psf);
479 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
480 IShellView_Release(psf);
481
482 return hRes;
483}
484/*************************************************************************
485 * SHWinHelp [SHELL32.127]
486 *
487 */
488HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
489{ FIXME("0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
490 return 0;
491}
492/*************************************************************************
493 * SHRunControlPanel [SHELL32.161]
494 *
495 */
496HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
497{ FIXME("0x%08lx 0x%08lx stub\n",x,z);
498 return 0;
499}
500/*************************************************************************
501 * ShellExecuteEx [SHELL32.291]
502 *
503 */
504BOOL WINAPI ShellExecuteExAW (LPVOID sei)
505{ if (SHELL_OsIsUnicode())
506 return ShellExecuteExW (sei);
507 return ShellExecuteExA (sei);
508}
509/*************************************************************************
510 * ShellExecuteExA [SHELL32.292]
511 *
512 * placeholder in the commandline:
513 * %1 file
514 * %2 printer
515 * %3 driver
516 * %4 port
517 * %I adress of a global item ID (explorer switch /idlist)
518 * %L ??? path/url/current file ???
519 * %S ???
520 * %* all following parameters (see batfile)
521 */
522BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
523{ CHAR szApplicationName[MAX_PATH],szCommandline[MAX_PATH],szPidl[20];
524 LPSTR pos;
525 int gap, len;
526 STARTUPINFOA startup;
527 PROCESS_INFORMATION info;
528
529 WARN("mask=0x%08lx hwnd=0x%04x verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s incomplete\n",
530 sei->fMask, sei->hwnd, sei->lpVerb, sei->lpFile,
531 sei->lpParameters, sei->lpDirectory, sei->nShow,
532 (sei->fMask & SEE_MASK_CLASSNAME) ? sei->lpClass : "not used");
533
534 ZeroMemory(szApplicationName,MAX_PATH);
535 if (sei->lpFile)
536 strcpy(szApplicationName, sei->lpFile);
537
538 ZeroMemory(szCommandline,MAX_PATH);
539 if (sei->lpParameters)
540 strcpy(szCommandline, sei->lpParameters);
541
542 if (sei->fMask & (SEE_MASK_CLASSKEY | SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
543 SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT |
544 SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE |
545 SEE_MASK_NO_CONSOLE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR ))
546 {
547 FIXME("flags ignored: 0x%08lx\n", sei->fMask);
548 }
549
550 /* launch a document by fileclass like 'Wordpad.Document.1' */
551 if (sei->fMask & SEE_MASK_CLASSNAME)
552 {
553 /* the commandline contains 'c:\Path\wordpad.exe "%1"' */
554 HCR_GetExecuteCommand(sei->lpClass, (sei->lpVerb) ? sei->lpVerb : "open", szCommandline, 256);
555 /* fixme: get the extension of lpFile, check if it fits to the lpClass */
556 TRACE("SEE_MASK_CLASSNAME->'%s'\n", szCommandline);
557 }
558
559 /* process the IDList */
560 if ( (sei->fMask & SEE_MASK_INVOKEIDLIST) == SEE_MASK_INVOKEIDLIST) /*0x0c*/
561 {
562 SHGetPathFromIDListA (sei->lpIDList,szApplicationName);
563 TRACE("-- idlist=%p (%s)\n", sei->lpIDList, szApplicationName);
564 }
565 else
566 {
567 if (sei->fMask & SEE_MASK_IDLIST )
568 {
569 pos = strstr(szCommandline, "%I");
570 if (pos)
571 {
572 LPVOID pv;
573 HGLOBAL hmem = SHAllocShared ( sei->lpIDList, ILGetSize(sei->lpIDList), 0);
574 pv = SHLockShared(hmem,0);
575 sprintf(szPidl,":%p",pv );
576 SHUnlockShared(pv);
577
578 gap = strlen(szPidl);
579 len = strlen(pos)-2;
580 memmove(pos+gap,pos+2,len);
581 memcpy(pos,szPidl,gap);
582
583 }
584 }
585 }
586
587 TRACE("execute:'%s','%s'\n",szApplicationName, szCommandline);
588
589 strcat(szApplicationName, " ");
590 strcat(szApplicationName, szCommandline);
591
592 ZeroMemory(&startup,sizeof(STARTUPINFOA));
593 startup.cb = sizeof(STARTUPINFOA);
594
595 if (! CreateProcessA(NULL, szApplicationName,
596 NULL, NULL, FALSE, 0,
597 NULL, NULL, &startup, &info))
598 {
599 sei->hInstApp = GetLastError();
600 return FALSE;
601 }
602
603 sei->hInstApp = 33;
604
605 /* Give 30 seconds to the app to come up */
606 if ( WaitForInputIdle ( info.hProcess, 30000 ) == 0xFFFFFFFF )
607 ERR("WaitForInputIdle failed: Error %ld\n", GetLastError() );
608
609 if(sei->fMask & SEE_MASK_NOCLOSEPROCESS)
610 sei->hProcess = info.hProcess;
611 else
612 CloseHandle( info.hProcess );
613 CloseHandle( info.hThread );
614 return TRUE;
615}
616/*************************************************************************
617 * ShellExecuteExW [SHELL32.293]
618 *
619 */
620BOOL WINAPI ShellExecuteExW (LPSHELLEXECUTEINFOW sei)
621{ SHELLEXECUTEINFOA seiA;
622 DWORD ret;
623
624 TRACE("%p\n", sei);
625
626 memcpy(&seiA, sei, sizeof(SHELLEXECUTEINFOA));
627
628 if (sei->lpVerb)
629 seiA.lpVerb = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpVerb);
630
631 if (sei->lpFile)
632 seiA.lpFile = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpFile);
633
634 if (sei->lpParameters)
635 seiA.lpParameters = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpParameters);
636
637 if (sei->lpDirectory)
638 seiA.lpDirectory = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpDirectory);
639
640 if ((sei->fMask & SEE_MASK_CLASSNAME) && sei->lpClass)
641 seiA.lpClass = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpClass);
642 else
643 seiA.lpClass = NULL;
644
645 ret = ShellExecuteExA(&seiA);
646
647 if (seiA.lpVerb) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpVerb );
648 if (seiA.lpFile) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpFile );
649 if (seiA.lpParameters) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpParameters );
650 if (seiA.lpDirectory) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpDirectory );
651 if (seiA.lpClass) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpClass );
652
653 return ret;
654}
655
656static LPUNKNOWN SHELL32_IExplorerInterface=0;
657/*************************************************************************
658 * SHSetInstanceExplorer [SHELL32.176]
659 *
660 * NOTES
661 * Sets the interface
662 */
663HRESULT WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
664{ TRACE("%p\n", lpUnknown);
665 SHELL32_IExplorerInterface = lpUnknown;
666 return (HRESULT) lpUnknown;
667}
668/*************************************************************************
669 * SHGetInstanceExplorer [SHELL32.256]
670 *
671 * NOTES
672 * gets the interface pointer of the explorer and a reference
673 */
674HRESULT WINAPI SHGetInstanceExplorer (LPUNKNOWN * lpUnknown)
675{ TRACE("%p\n", lpUnknown);
676
677 *lpUnknown = SHELL32_IExplorerInterface;
678
679 if (!SHELL32_IExplorerInterface)
680 return E_FAIL;
681
682 IUnknown_AddRef(SHELL32_IExplorerInterface);
683 return NOERROR;
684}
685/*************************************************************************
686 * SHFreeUnusedLibraries [SHELL32.123]
687 *
688 * NOTES
689 * exported by name
690 */
691void WINAPI SHFreeUnusedLibraries (void)
692{
693 FIXME("stub\n");
694}
695/*************************************************************************
696 * DAD_SetDragImage [SHELL32.136]
697 *
698 * NOTES
699 * exported by name
700 */
701BOOL WINAPI DAD_SetDragImage(
702 HIMAGELIST himlTrack,
703 LPPOINT lppt)
704{
705 FIXME("%p %p stub\n",himlTrack, lppt);
706 return 0;
707}
708/*************************************************************************
709 * DAD_ShowDragImage [SHELL32.137]
710 *
711 * NOTES
712 * exported by name
713 */
714BOOL WINAPI DAD_ShowDragImage(BOOL bShow)
715{
716 FIXME("0x%08x stub\n",bShow);
717 return 0;
718}
719/*************************************************************************
720 * ReadCabinetState [NT 4.0:SHELL32.651]
721 *
722 */
723HRESULT WINAPI ReadCabinetState(DWORD u, DWORD v)
724{ FIXME("0x%04lx 0x%04lx stub\n",u,v);
725 return 0;
726}
727/*************************************************************************
728 * WriteCabinetState [NT 4.0:SHELL32.652]
729 *
730 */
731HRESULT WINAPI WriteCabinetState(DWORD u)
732{ FIXME("0x%04lx stub\n",u);
733 return 0;
734}
735/*************************************************************************
736 * FileIconInit [SHELL32.660]
737 *
738 */
739BOOL WINAPI FileIconInit(BOOL bFullInit)
740{ FIXME("(%s)\n", bFullInit ? "true" : "false");
741 return 0;
742}
743/*************************************************************************
744 * IsUserAdmin [NT 4.0:SHELL32.680]
745 *
746 */
747HRESULT WINAPI IsUserAdmin(void)
748{ FIXME("stub\n");
749 return TRUE;
750}
751
752/*************************************************************************
753 * SHAllocShared [SHELL32.520]
754 *
755 * NOTES
756 * parameter1 is return value from HeapAlloc
757 * parameter2 is equal to the size allocated with HeapAlloc
758 * parameter3 is return value from GetCurrentProcessId
759 *
760 * the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
761 * WM_USER+2 could be the undocumented CWM_SETPATH
762 * the allocated memory contains a pidl
763 */
764HGLOBAL WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
765{ HGLOBAL hmem;
766 LPVOID pmem;
767
768 TRACE("ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID);
769 hmem = GlobalAlloc(GMEM_FIXED, size);
770 if (!hmem)
771 return 0;
772
773 pmem = GlobalLock (hmem);
774
775 if (! pmem)
776 return 0;
777
778 memcpy (pmem, psrc, size);
779 GlobalUnlock(hmem);
780 return hmem;
781}
782/*************************************************************************
783 * SHLockShared [SHELL32.521]
784 *
785 * NOTES
786 * parameter1 is return value from SHAllocShared
787 * parameter2 is return value from GetCurrentProcessId
788 * the receiver of (WM_USER+2) trys to lock the HANDLE (?)
789 * the returnvalue seems to be a memoryadress
790 */
791LPVOID WINAPI SHLockShared(HANDLE hmem, DWORD procID)
792{ TRACE("handle=0x%04x procID=0x%04lx\n",hmem,procID);
793 return GlobalLock(hmem);
794}
795/*************************************************************************
796 * SHUnlockShared [SHELL32.522]
797 *
798 * NOTES
799 * parameter1 is return value from SHLockShared
800 */
801BOOL WINAPI SHUnlockShared(LPVOID pv)
802{
803 TRACE("%p\n",pv);
804 return GlobalUnlock((HANDLE)pv);
805}
806/*************************************************************************
807 * SHFreeShared [SHELL32.523]
808 *
809 * NOTES
810 * parameter1 is return value from SHAllocShared
811 * parameter2 is return value from GetCurrentProcessId
812 */
813BOOL WINAPI SHFreeShared(
814 HANDLE hMem,
815 DWORD pid)
816{
817 TRACE("handle=0x%04x 0x%04lx\n",hMem,pid);
818 return GlobalFree(hMem);
819}
820
821/*************************************************************************
822 * SetAppStartingCursor [SHELL32.99]
823 */
824HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
825{ FIXME("hwnd=0x%04x 0x%04lx stub\n",u,v );
826 return 0;
827}
828/*************************************************************************
829 * SHLoadOLE [SHELL32.151]
830 *
831 */
832HRESULT WINAPI SHLoadOLE(DWORD u)
833{ FIXME("0x%04lx stub\n",u);
834 return S_OK;
835}
836/*************************************************************************
837 * DriveType [SHELL32.64]
838 *
839 */
840HRESULT WINAPI DriveType(DWORD u)
841{ FIXME("0x%04lx stub\n",u);
842 return 0;
843}
844/*************************************************************************
845 * SHAbortInvokeCommand [SHELL32.198]
846 *
847 */
848HRESULT WINAPI SHAbortInvokeCommand(void)
849{ FIXME("stub\n");
850 return 1;
851}
852/*************************************************************************
853 * SHOutOfMemoryMessageBox [SHELL32.126]
854 *
855 */
856int WINAPI SHOutOfMemoryMessageBox(
857 HWND hwndOwner,
858 LPCSTR lpCaption,
859 UINT uType)
860{
861 FIXME("0x%04x %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
862 return 0;
863}
864/*************************************************************************
865 * SHFlushClipboard [SHELL32.121]
866 *
867 */
868HRESULT WINAPI SHFlushClipboard(void)
869{ FIXME("stub\n");
870 return 1;
871}
872
873/*************************************************************************
874 * SHWaitForFileToOpen [SHELL32.97]
875 *
876 */
877BOOL WINAPI SHWaitForFileToOpen(
878 LPCITEMIDLIST pidl,
879 DWORD dwFlags,
880 DWORD dwTimeout)
881{
882 FIXME("%p 0x%08lx 0x%08lx stub\n", pidl, dwFlags, dwTimeout);
883 return 0;
884}
885
886/************************************************************************
887 * shell32_654 [SHELL32.654]
888 *
889 * NOTES: first parameter seems to be a pointer (same as passed to WriteCabinetState)
890 * second one could be a size (0x0c). The size is the same as the structure saved to
891 * HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState
892 * I'm (js) guessing: this one is just ReadCabinetState ;-)
893 */
894HRESULT WINAPI shell32_654 (DWORD x, DWORD y)
895{ FIXME("0x%08lx 0x%08lx stub\n",x,y);
896 return 0;
897}
898
899/************************************************************************
900 * RLBuildListOfPaths [SHELL32.146]
901 *
902 * NOTES
903 * builds a DPA
904 */
905DWORD WINAPI RLBuildListOfPaths (void)
906{ FIXME("stub\n");
907 return 0;
908}
909/************************************************************************
910 * SHValidateUNC [SHELL32.173]
911 *
912 */
913HRESULT WINAPI SHValidateUNC (DWORD x, DWORD y, DWORD z)
914{
915 FIXME("0x%08lx 0x%08lx 0x%08lx stub\n",x,y,z);
916 return 0;
917}
918
919/************************************************************************
920 * DoEnvironmentSubstA [SHELL32.1222]
921 *
922 */
923HRESULT WINAPI DoEnvironmentSubstA(LPSTR x, LPSTR y)
924{
925 FIXME("(%s, %s) stub\n", debugstr_a(x), debugstr_a(y));
926 return 0;
927}
928
929/************************************************************************
930 * DoEnvironmentSubstW [SHELL32.1223]
931 *
932 */
933HRESULT WINAPI DoEnvironmentSubstW(LPWSTR x, LPWSTR y)
934{
935 FIXME("(%s, %s): stub\n", debugstr_w(x), debugstr_w(y));
936 return 0;
937}
938
939/************************************************************************
940 * DoEnvironmentSubst [SHELL32.53]
941 *
942 */
943HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y)
944{
945 if (SHELL_OsIsUnicode())
946 return DoEnvironmentSubstW(x, y);
947 return DoEnvironmentSubstA(x, y);
948}
949
950/*************************************************************************
951 * shell32_243 [SHELL32.243]
952 *
953 * Win98+ by-ordinal routine. In Win98 this routine returns zero and
954 * does nothing else. Possibly this does something in NT or SHELL32 5.0?
955 *
956 */
957
958BOOL WINAPI shell32_243(DWORD a, DWORD b)
959{
960 return FALSE;
961}
962
963/*************************************************************************
964 * SHELL32_714 [SHELL32]
965 */
966DWORD WINAPI SHELL32_714(LPVOID x)
967{
968 FIXME("(%s)stub\n", debugstr_w(x));
969 return 0;
970}
971
972/*************************************************************************
973 * SHAddFromPropSheetExtArray [SHELL32]
974 */
975DWORD WINAPI SHAddFromPropSheetExtArray(DWORD a, DWORD b, DWORD c)
976{
977 FIXME("(%08lx,%08lx,%08lx)stub\n", a, b, c);
978 return 0;
979}
980
981/*************************************************************************
982 * SHCreatePropSheetExtArray [SHELL32]
983 */
984DWORD WINAPI SHCreatePropSheetExtArray(DWORD a, LPCSTR b, DWORD c)
985{
986 FIXME("(%08lx,%s,%08lx)stub\n", a, debugstr_a(b), c);
987 return 0;
988}
989
990/*************************************************************************
991 * SHReplaceFromPropSheetExtArray [SHELL]
992 */
993DWORD WINAPI SHReplaceFromPropSheetExtArray(DWORD a, DWORD b, DWORD c, DWORD d)
994{
995 FIXME("(%08lx,%08lx,%08lx,%08lx)stub\n", a, b, c, d);
996 return 0;
997}
998
999/*************************************************************************
1000 * SHDestroyPropSheetExtArray [SHELL32]
1001 */
1002DWORD WINAPI SHDestroyPropSheetExtArray(DWORD a)
1003{
1004 FIXME("(%08lx)stub\n", a);
1005 return 0;
1006}
Note: See TracBrowser for help on using the repository browser.