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

Last change on this file since 4265 was 4121, checked in by sandervl, 25 years ago

complete merge with shell32 from wine 20000801

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