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

Last change on this file since 7029 was 7014, checked in by phaller, 24 years ago

.

File size: 39.6 KB
Line 
1/*
2 * The parameters of many functions changes between different OS versions
3 * (NT uses Unicode strings, 95 uses ASCII strings)
4 *
5 * Copyright 1997 Marcus Meissner
6 * 1998 Jürgen Schmied
7 */
8
9/****************************************************************************
10 * includes
11 ****************************************************************************/
12
13#include <odin.h>
14#include <os2sel.h>
15#include <odinwrap.h>
16
17ODINDEBUGCHANNEL(SHELL32-SHELLORD)
18
19
20#include <string.h>
21#include <stdio.h>
22#include "winerror.h"
23#include "winreg.h"
24#include "debugtools.h"
25#include "winnls.h"
26#include "heap.h"
27
28#include "shlwapi.h"
29#include "shellapi.h"
30#include "shlguid.h"
31#include "shlobj.h"
32#include "shell32_main.h"
33#ifdef __WIN32OS2__
34#include "wine\undocshell.h"
35#else
36#include "undocshell.h"
37#endif
38
39DEFAULT_DEBUG_CHANNEL(shell);
40
41/*************************************************************************
42 * ParseFieldA [internal]
43 *
44 * copys a field from a ',' delimited string
45 *
46 * first field is nField = 1
47 */
48DWORD WINAPI ParseFieldA(
49 LPCSTR src,
50 DWORD nField,
51 LPSTR dst,
52 DWORD len)
53{
54 WARN("('%s',0x%08lx,%p,%ld) semi-stub.\n",src,nField,dst,len);
55
56 if (!src || !src[0] || !dst || !len)
57 return 0;
58
59 /* skip n fields delimited by ',' */
60 while (nField > 1)
61 {
62 if (*src=='\0') return FALSE;
63 if (*(src++)==',') nField--;
64 }
65
66 /* copy part till the next ',' to dst */
67 while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
68
69 /* finalize the string */
70 *dst=0x0;
71
72 return TRUE;
73}
74
75/*************************************************************************
76 * ParseFieldW [internal]
77 *
78 * copys a field from a ',' delimited string
79 *
80 * first field is nField = 1
81 */
82DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
83{
84 FIXME("(%s,0x%08lx,%p,%ld) stub\n",
85 debugstr_w(src), nField, dst, len);
86 return FALSE;
87}
88
89/*************************************************************************
90 * ParseField [SHELL32.58]
91 */
92DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
93{
94 if (SHELL_OsIsUnicode())
95 return ParseFieldW(src, nField, dst, len);
96 return ParseFieldA(src, nField, dst, len);
97}
98
99/*************************************************************************
100 * GetFileNameFromBrowse [SHELL32.63]
101 *
102 */
103ODINFUNCTION7(BOOL, GetFileNameFromBrowse,
104 HWND, hwndOwner,
105 LPSTR, lpstrFile,
106 DWORD, nMaxFile,
107 LPCSTR, lpstrInitialDir,
108 LPCSTR, lpstrDefExt,
109 LPCSTR, lpstrFilter,
110 LPCSTR, lpstrTitle)
111{
112 FIXME("(%04x,%s,%ld,%s,%s,%s,%s):stub.\n",
113 hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt,
114 lpstrFilter, lpstrTitle);
115
116 /* puts up a Open Dialog and requests input into targetbuf */
117 /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
118 strcpy(lpstrFile,"x:\\dummy.exe");
119 return 1;
120}
121
122/*************************************************************************
123 * SHGetSetSettings [SHELL32.68]
124 */
125VOID WINAPI SHGetSetSettings(DWORD x, DWORD y, DWORD z)
126{
127 FIXME("0x%08lx 0x%08lx 0x%08lx\n", x, y, z);
128}
129
130/*************************************************************************
131 * SHGetSettings [SHELL32.@]
132 *
133 * NOTES
134 * the registry path are for win98 (tested)
135 * and possibly are the same in nt40
136 *
137 */
138VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
139{
140 HKEY hKey;
141 DWORD dwData;
142 DWORD dwDataSize = sizeof (DWORD);
143
144 TRACE("(%p 0x%08lx)\n",lpsfs,dwMask);
145
146 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
147 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
148 return;
149
150 if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
151 lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
152
153 if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
154 lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
155
156 if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
157 lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
158
159 if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
160 lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
161
162 if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
163 lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
164
165 if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
166 lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
167
168 if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
169 { if (dwData == 0)
170 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
171 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
172 }
173 else if (dwData == 1)
174 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
175 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
176 }
177 else if (dwData == 2)
178 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
179 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
180 }
181 }
182 RegCloseKey (hKey);
183
184 TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
185}
186
187/*************************************************************************
188 * SHShellFolderView_Message [SHELL32.73]
189 *
190 * PARAMETERS
191 * hwndCabinet defines the explorer cabinet window that contains the
192 * shellview you need to communicate with
193 * uMsg identifying the SFVM enum to perform
194 * lParam
195 *
196 * NOTES
197 * Message SFVM_REARRANGE = 1
198 * This message gets sent when a column gets clicked to instruct the
199 * shell view to re-sort the item list. lParam identifies the column
200 * that was clicked.
201 */
202int WINAPI SHShellFolderView_Message(
203 HWND hwndCabinet,
204 DWORD dwMessage,
205 DWORD dwParam)
206{
207 FIXME("%04x %08lx %08lx stub\n",hwndCabinet, dwMessage, dwParam);
208 return 0;
209}
210
211/*************************************************************************
212 * RegisterShellHook [SHELL32.181]
213 *
214 * PARAMS
215 * hwnd [I] window handle
216 * y [I] flag ????
217 *
218 * NOTES
219 * exported by ordinal
220 */
221BOOL WINAPI RegisterShellHook(
222 HWND hWnd,
223 DWORD dwType)
224{
225 FIXME("(0x%08x,0x%08lx):stub.\n",hWnd, dwType);
226 return TRUE;
227}
228/*************************************************************************
229 * ShellMessageBoxW [SHELL32.182]
230 *
231 * Format and output errormessage.
232 *
233 * idText resource ID of title or LPSTR
234 * idTitle resource ID of title or LPSTR
235 *
236 * NOTES
237 * exported by ordinal
238 */
239int WINAPIV ShellMessageBoxW(
240 HINSTANCE hInstance,
241 HWND hWnd,
242 LPCWSTR lpText,
243 LPCWSTR lpCaption,
244 UINT uType,
245 ...)
246{
247 WCHAR szText[100],szTitle[100];
248 LPCWSTR pszText = szText, pszTitle = szTitle, pszTemp;
249 va_list args;
250 int ret;
251
252 va_start(args, uType);
253 /* wvsprintfA(buf,fmt, args); */
254
255 TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
256 (DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
257
258 if (!HIWORD(lpCaption))
259 LoadStringW(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
260 else
261 pszTitle = lpCaption;
262
263 if (!HIWORD(lpText))
264 LoadStringW(hInstance, (DWORD)lpText, szText, sizeof(szText)/sizeof(szText[0]));
265 else
266 pszText = lpText;
267
268 FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
269 pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
270
271 va_end(args);
272
273 ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
274 LocalFree((HLOCAL)pszTemp);
275 return ret;
276}
277
278/*************************************************************************
279 * ShellMessageBoxA [SHELL32.183]
280 */
281int WINAPIV ShellMessageBoxA(
282 HINSTANCE hInstance,
283 HWND hWnd,
284 LPCSTR lpText,
285 LPCSTR lpCaption,
286 UINT uType,
287 ...)
288{
289 char szText[100],szTitle[100];
290 LPCSTR pszText = szText, pszTitle = szTitle, pszTemp;
291 va_list args;
292 int ret;
293
294 va_start(args, uType);
295 /* wvsprintfA(buf,fmt, args); */
296
297 TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
298 (DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
299
300 if (!HIWORD(lpCaption))
301 LoadStringA(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle));
302 else
303 pszTitle = lpCaption;
304
305 if (!HIWORD(lpText))
306 LoadStringA(hInstance, (DWORD)lpText, szText, sizeof(szText));
307 else
308 pszText = lpText;
309
310 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
311 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
312
313 va_end(args);
314
315 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
316 LocalFree((HLOCAL)pszTemp);
317 return ret;
318}
319
320/*************************************************************************
321 * SHFree [SHELL32.195]
322 *
323 * NOTES
324 * free_ptr() - frees memory using IMalloc
325 * exported by ordinal
326 */
327#define MEM_DEBUG 0
328
329ODINPROCEDURE1(SHFree,
330 LPVOID, x)
331{
332#if MEM_DEBUG
333 WORD len = *(LPWORD)((LPBYTE)x-2);
334
335 if ( *(LPWORD)((LPBYTE)x+len) != 0x7384)
336 ERR("MAGIC2!\n");
337
338 if ( (*(LPWORD)((LPBYTE)x-4)) != 0x8271)
339 ERR("MAGIC1!\n");
340 else
341 memset((LPBYTE)x-4, 0xde, len+6);
342
343 TRACE("%p len=%u\n",x, len);
344
345 x = (LPBYTE) x - 4;
346#else
347 TRACE("%p\n",x);
348#endif
349 HeapFree(GetProcessHeap(), 0, x);
350}
351
352/*************************************************************************
353 * SHAlloc [SHELL32.196]
354 *
355 * NOTES
356 * void *task_alloc(DWORD len), uses SHMalloc allocator
357 * exported by ordinal
358 */
359ODINFUNCTION1(LPVOID, SHAlloc,
360 DWORD, len)
361{
362 LPBYTE ret;
363
364#if MEM_DEBUG
365 ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len+6);
366#else
367 ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len);
368#endif
369
370#if MEM_DEBUG
371 *(LPWORD)(ret) = 0x8271;
372 *(LPWORD)(ret+2) = (WORD)len;
373 *(LPWORD)(ret+4+len) = 0x7384;
374 ret += 4;
375 memset(ret, 0xdf, len);
376#endif
377 TRACE("%lu bytes at %p\n",len, ret);
378 return (LPVOID)ret;
379}
380
381/*************************************************************************
382 * SHRegisterDragDrop [SHELL32.86]
383 *
384 * NOTES
385 * exported by ordinal
386 */
387HRESULT WINAPI SHRegisterDragDrop(
388 HWND hWnd,
389 LPDROPTARGET pDropTarget)
390{
391 FIXME("(0x%08x,%p):stub.\n", hWnd, pDropTarget);
392 if (GetShellOle()) return pRegisterDragDrop(hWnd, pDropTarget);
393 return 0;
394}
395
396/*************************************************************************
397 * SHRevokeDragDrop [SHELL32.87]
398 *
399 * NOTES
400 * exported by ordinal
401 */
402HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
403{
404 FIXME("(0x%08x):stub.\n",hWnd);
405 return 0;
406}
407
408/*************************************************************************
409 * SHDoDragDrop [SHELL32.88]
410 *
411 * NOTES
412 * exported by ordinal
413 */
414HRESULT WINAPI SHDoDragDrop(
415 HWND hWnd,
416 LPDATAOBJECT lpDataObject,
417 LPDROPSOURCE lpDropSource,
418 DWORD dwOKEffect,
419 LPDWORD pdwEffect)
420{
421 FIXME("(0x%04x %p %p 0x%08lx %p):stub.\n",
422 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
423 return 0;
424}
425
426/*************************************************************************
427 * ArrangeWindows [SHELL32.184]
428 *
429 */
430WORD WINAPI ArrangeWindows(
431 HWND hwndParent,
432 DWORD dwReserved,
433 LPCRECT lpRect,
434 WORD cKids,
435 CONST HWND * lpKids)
436{
437 FIXME("(0x%08x 0x%08lx %p 0x%04x %p):stub.\n",
438 hwndParent, dwReserved, lpRect, cKids, lpKids);
439 return 0;
440}
441
442/*************************************************************************
443 * SignalFileOpen [SHELL32.103]
444 *
445 * NOTES
446 * exported by ordinal
447 */
448DWORD WINAPI
449SignalFileOpen (DWORD dwParam1)
450{
451 FIXME("(0x%08lx):stub.\n", dwParam1);
452
453 return 0;
454}
455
456/*************************************************************************
457 * SHADD_get_policy - helper function for SHAddToRecentDocs
458 *
459 * PARAMETERS
460 * policy [IN] policy name (null termed string) to find
461 * type [OUT] ptr to DWORD to receive type
462 * buffer [OUT] ptr to area to hold data retrieved
463 * len [IN/OUT] ptr to DWORD holding size of buffer and getting
464 * length filled
465 *
466 * RETURNS
467 * result of the SHQueryValueEx call
468 */
469static INT SHADD_get_policy(LPSTR policy, LPDWORD type, LPVOID buffer, LPDWORD len)
470{
471 HKEY Policy_basekey;
472 INT ret;
473
474 /* Get the key for the policies location in the registry
475 */
476 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
477 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
478 0, KEY_READ, &Policy_basekey)) {
479
480 if (RegOpenKeyExA(HKEY_CURRENT_USER,
481 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
482 0, KEY_READ, &Policy_basekey)) {
483 ERR("No Explorer Policies location\n");
484 *len = 0;
485 return ERROR_FILE_NOT_FOUND;
486 }
487 }
488
489 /* Retrieve the data if it exists
490 */
491 ret = SHQueryValueExA(Policy_basekey, policy, 0, type, buffer, len);
492 RegCloseKey(Policy_basekey);
493 return ret;
494}
495
496
497/*************************************************************************
498 * SHADD_compare_mru - helper function for SHAddToRecentDocs
499 *
500 * PARAMETERS
501 * data1 [IN] data being looked for
502 * data2 [IN] data in MRU
503 * cbdata [IN] length from FindMRUData call (not used)
504 *
505 * RETURNS
506 * position within MRU list that data was added.
507 */
508static INT CALLBACK SHADD_compare_mru(LPCVOID data1, LPCVOID data2, DWORD cbData)
509{
510 return lstrcmpiA(data1, data2);
511}
512
513/*************************************************************************
514 * SHADD_create_add_mru_data - helper function for SHAddToRecentDocs
515 *
516 * PARAMETERS
517 * mruhandle [IN] handle for created MRU list
518 * doc_name [IN] null termed pure doc name
519 * new_lnk_name [IN] null termed path and file name for .lnk file
520 * buffer [IN/OUT] 2048 byte area to consturct MRU data
521 * len [OUT] ptr to int to receive space used in buffer
522 *
523 * RETURNS
524 * position within MRU list that data was added.
525 */
526static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPSTR doc_name, LPSTR new_lnk_name,
527 LPSTR buffer, INT *len)
528{
529 LPSTR ptr;
530 INT wlen;
531
532 /*FIXME: Document:
533 * RecentDocs MRU data structure seems to be:
534 * +0h document file name w/ terminating 0h
535 * +nh short int w/ size of remaining
536 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
537 * +n+4h 10 bytes zeros - unknown
538 * +n+eh shortcut file name w/ terminating 0h
539 * +n+e+nh 3 zero bytes - unknown
540 */
541
542 /* Create the MRU data structure for "RecentDocs"
543 */
544 ptr = buffer;
545 lstrcpyA(ptr, doc_name);
546 ptr += (lstrlenA(buffer) + 1);
547 wlen= lstrlenA(new_lnk_name) + 1 + 12;
548 *((short int*)ptr) = wlen;
549 ptr += 2; /* step past the length */
550 *(ptr++) = 0x30; /* unknown reason */
551 *(ptr++) = 0; /* unknown, but can be 0x00, 0x01, 0x02 */
552 memset(ptr, 0, 10);
553 ptr += 10;
554 lstrcpyA(ptr, new_lnk_name);
555 ptr += (lstrlenA(new_lnk_name) + 1);
556 memset(ptr, 0, 3);
557 ptr += 3;
558 *len = ptr - buffer;
559
560 /* Add the new entry into the MRU list
561 */
562 return pAddMRUData(mruhandle, (LPCVOID)buffer, *len);
563}
564
565/*************************************************************************
566 * SHAddToRecentDocs [SHELL32.@]
567 *
568 * PARAMETERS
569 * uFlags [IN] SHARD_PATH or SHARD_PIDL
570 * pv [IN] string or pidl, NULL clears the list
571 *
572 * NOTES
573 * exported by name
574 *
575 * FIXME: ?? MSDN shows this as a VOID
576 */
577DWORD WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
578{
579
580#ifndef __WIN32OS2__
581/* FIXME: !!! move CREATEMRULIST and flags to header file !!! */
582/* !!! it is in both here and comctl32undoc.c !!! */
583typedef struct tagCREATEMRULIST
584{
585 DWORD cbSize; /* size of struct */
586 DWORD nMaxItems; /* max no. of items in list */
587 DWORD dwFlags; /* see below */
588 HKEY hKey; /* root reg. key under which list is saved */
589 LPCSTR lpszSubKey; /* reg. subkey */
590 PROC lpfnCompare; /* item compare proc */
591} CREATEMRULIST, *LPCREATEMRULIST;
592
593/* dwFlags */
594#define MRUF_STRING_LIST 0 /* list will contain strings */
595#define MRUF_BINARY_LIST 1 /* list will contain binary data */
596#define MRUF_DELAYED_SAVE 2 /* only save list order to reg. is FreeMRUList */
597
598/* If list is a string list lpfnCompare has the following prototype
599 * int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
600 * for binary lists the prototype is
601 * int CALLBACK MRUCompareBinary(LPCVOID data1, LPCVOID data2, DWORD cbData)
602 * where cbData is the no. of bytes to compare.
603 * Need to check what return value means identical - 0?
604 */
605#endif
606
607 UINT olderrormode;
608 HKEY HCUbasekey;
609 CHAR doc_name[MAX_PATH];
610 CHAR link_dir[MAX_PATH];
611 CHAR new_lnk_filepath[MAX_PATH];
612 CHAR new_lnk_name[MAX_PATH];
613 IMalloc *ppM;
614 LPITEMIDLIST pidl;
615 HWND hwnd = 0; /* FIXME: get real window handle */
616 INT ret;
617 DWORD data[64], datalen, type;
618
619 /*FIXME: Document:
620 * RecentDocs MRU data structure seems to be:
621 * +0h document file name w/ terminating 0h
622 * +nh short int w/ size of remaining
623 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
624 * +n+4h 10 bytes zeros - unknown
625 * +n+eh shortcut file name w/ terminating 0h
626 * +n+e+nh 3 zero bytes - unknown
627 */
628
629 /* See if we need to do anything.
630 */
631 datalen = 64;
632 ret=SHADD_get_policy( "NoRecentDocsHistory", &type, &data, &datalen);
633 if ((ret > 0) && (ret != ERROR_FILE_NOT_FOUND)) {
634 ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
635 return 0;
636 }
637 if (ret == ERROR_SUCCESS) {
638 if (!( (type == REG_DWORD) ||
639 ((type == REG_BINARY) && (datalen == 4)) )) {
640 ERR("Error policy data for \"NoRecentDocsHistory\" not formated correctly, type=%ld, len=%ld\n",
641 type, datalen);
642 return 0;
643 }
644
645 TRACE("policy value for NoRecentDocsHistory = %08lx\n", data[0]);
646 /* now test the actual policy value */
647 if ( data[0] != 0)
648 return 0;
649 }
650
651 /* Open key to where the necessary info is
652 */
653 /* FIXME: This should be done during DLL PROCESS_ATTACH (or THREAD_ATTACH)
654 * and the close should be done during the _DETACH. The resulting
655 * key is stored in the DLL global data.
656 */
657 RegOpenKeyExA(HKEY_CURRENT_USER,
658 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
659 0,
660 KEY_READ,
661 &HCUbasekey);
662
663 /* Get path to user's "Recent" directory
664 */
665 if(SUCCEEDED(SHGetMalloc(&ppM))) {
666 if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT,
667 &pidl))) {
668 SHGetPathFromIDListA(pidl, link_dir);
669 IMalloc_Free(ppM, pidl);
670 }
671 IMalloc_Release(ppM);
672 }
673 else {
674 /* serious issues */
675 link_dir[0] = 0;
676 ERR("serious issues\n");
677 }
678 TRACE("Users Recent dir %s\n", link_dir);
679
680 /* If no input, then go clear the lists */
681 if (!pv) {
682 /* clear user's Recent dir
683 */
684
685 /* FIXME: delete all files in "link_dir"
686 *
687 * while( more files ) {
688 * lstrcpyA(old_lnk_name, link_dir);
689 * PathAppendA(old_lnk_name, filenam);
690 * DeleteFileA(old_lnk_name);
691 * }
692 */
693 FIXME("should delete all files in %s\\ \n", link_dir);
694
695 /* clear MRU list
696 */
697 /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
698 * HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
699 * and naturally it fails w/ rc=2. It should do it against
700 * HKEY_CURRENT_USER which is where it is stored, and where
701 * the MRU routines expect it!!!!
702 */
703 RegDeleteKeyA(HCUbasekey, "RecentDocs");
704 RegCloseKey(HCUbasekey);
705 return 0;
706 }
707
708 /* Have data to add, the jobs to be done:
709 * 1. Add document to MRU list in registry "HKCU\Software\
710 * Microsoft\Windows\CurrentVersion\Explorer\RecentDocs".
711 * 2. Add shortcut to document in the user's Recent directory
712 * (CSIDL_RECENT).
713 * 3. Add shortcut to Start menu's Documents submenu.
714 */
715
716 /* Get the pure document name from the input
717 */
718 if (uFlags & SHARD_PIDL) {
719 SHGetPathFromIDListA((LPCITEMIDLIST) pv, doc_name);
720 }
721 else {
722 lstrcpyA(doc_name, (LPSTR) pv);
723 }
724 TRACE("full document name %s\n", doc_name);
725 PathStripPathA(doc_name);;
726 TRACE("stripped document name %s\n", doc_name);
727
728
729 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
730
731 { /* on input needs:
732 * doc_name - pure file-spec, no path
733 * link_dir - path to the user's Recent directory
734 * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node
735 * creates:
736 * new_lnk_name- pure file-spec, no path for new .lnk file
737 * new_lnk_filepath
738 * - path and file name of new .lnk file
739 */
740 CREATEMRULIST mymru;
741 HANDLE mruhandle;
742 INT len, pos, bufused, err;
743 INT i;
744 DWORD attr;
745 CHAR buffer[2048];
746 CHAR *ptr;
747 CHAR old_lnk_name[MAX_PATH];
748 short int slen;
749
750 mymru.cbSize = sizeof(CREATEMRULIST);
751 mymru.nMaxItems = 15;
752 mymru.dwFlags = MRUF_BINARY_LIST | MRUF_DELAYED_SAVE;
753 mymru.hKey = HCUbasekey;
754 mymru.lpszSubKey = "RecentDocs";
755 mymru.lpfnCompare = &SHADD_compare_mru;
756 mruhandle = pCreateMRUListA(&mymru);
757 if (!mruhandle) {
758 /* MRU failed */
759 ERR("MRU processing failed, handle zero\n");
760 RegCloseKey(HCUbasekey);
761 return 0;
762 }
763 len = lstrlenA(doc_name);
764 pos = pFindMRUData(mruhandle, doc_name, len, 0);
765
766 /* Now get the MRU entry that will be replaced
767 * and delete the .lnk file for it
768 */
769 if ((bufused = pEnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
770 buffer, 2048)) != -1) {
771 ptr = buffer;
772 ptr += (lstrlenA(buffer) + 1);
773 slen = *((short int*)ptr);
774 ptr += 2; /* skip the length area */
775 if (bufused >= slen + (ptr-buffer)) {
776 /* buffer size looks good */
777 ptr += 12; /* get to string */
778 len = bufused - (ptr-buffer); /* get length of buf remaining */
779 if ((lstrlenA(ptr) > 0) && (lstrlenA(ptr) <= len-1)) {
780 /* appears to be good string */
781 lstrcpyA(old_lnk_name, link_dir);
782 PathAppendA(old_lnk_name, ptr);
783 if (!DeleteFileA(old_lnk_name)) {
784 if ((attr = GetFileAttributesA(old_lnk_name)) == -1) {
785 if ((err = GetLastError()) != ERROR_FILE_NOT_FOUND) {
786 ERR("Delete for %s failed, err=%d, attr=%08lx\n",
787 old_lnk_name, err, attr);
788 }
789 else {
790 TRACE("old .lnk file %s did not exist\n",
791 old_lnk_name);
792 }
793 }
794 else {
795 ERR("Delete for %s failed, attr=%08lx\n",
796 old_lnk_name, attr);
797 }
798 }
799 else {
800 TRACE("deleted old .lnk file %s\n", old_lnk_name);
801 }
802 }
803 }
804 }
805
806 /* Create usable .lnk file name for the "Recent" directory
807 */
808 wsprintfA(new_lnk_name, "%s.lnk", doc_name);
809 lstrcpyA(new_lnk_filepath, link_dir);
810 PathAppendA(new_lnk_filepath, new_lnk_name);
811 i = 1;
812 olderrormode = SetErrorMode(SEM_FAILCRITICALERRORS);
813 while (GetFileAttributesA(new_lnk_filepath) != -1) {
814 i++;
815 wsprintfA(new_lnk_name, "%s (%u).lnk", doc_name, i);
816 lstrcpyA(new_lnk_filepath, link_dir);
817 PathAppendA(new_lnk_filepath, new_lnk_name);
818 }
819 SetErrorMode(olderrormode);
820 TRACE("new shortcut will be %s\n", new_lnk_filepath);
821
822 /* Now add the new MRU entry and data
823 */
824 pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
825 buffer, &len);
826 pFreeMRUListA(mruhandle);
827 TRACE("Updated MRU list, new doc is position %d\n", pos);
828 }
829
830 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
831
832 { /* on input needs:
833 * doc_name - pure file-spec, no path
834 * new_lnk_filepath
835 * - path and file name of new .lnk file
836 * uFlags[in] - flags on call to SHAddToRecentDocs
837 * pv[in] - document path/pidl on call to SHAddToRecentDocs
838 */
839 IShellLinkA *psl = NULL;
840 IPersistFile *pPf = NULL;
841 HRESULT hres;
842 CHAR desc[MAX_PATH];
843 WCHAR widelink[MAX_PATH];
844
845 CoInitialize(0);
846
847 hres = CoCreateInstance( &CLSID_ShellLink,
848 NULL,
849 CLSCTX_INPROC_SERVER,
850 &IID_IShellLinkA,
851 (LPVOID )&psl);
852 if(SUCCEEDED(hres)) {
853
854 hres = IShellLinkA_QueryInterface(psl, &IID_IPersistFile,
855 (LPVOID *)&pPf);
856 if(FAILED(hres)) {
857 /* bombed */
858 ERR("failed QueryInterface for IPersistFile %08lx\n", hres);
859 goto fail;
860 }
861
862 /* Set the document path or pidl */
863 if (uFlags & SHARD_PIDL) {
864 hres = IShellLinkA_SetIDList(psl, (LPCITEMIDLIST) pv);
865 } else {
866 hres = IShellLinkA_SetPath(psl, (LPCSTR) pv);
867 }
868 if(FAILED(hres)) {
869 /* bombed */
870 ERR("failed Set{IDList|Path} %08lx\n", hres);
871 goto fail;
872 }
873
874 lstrcpyA(desc, "Shortcut to ");
875 lstrcatA(desc, doc_name);
876 hres = IShellLinkA_SetDescription(psl, desc);
877 if(FAILED(hres)) {
878 /* bombed */
879 ERR("failed SetDescription %08lx\n", hres);
880 goto fail;
881 }
882
883 MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1,
884 widelink, MAX_PATH);
885 /* create the short cut */
886 hres = IPersistFile_Save(pPf, widelink, TRUE);
887 if(FAILED(hres)) {
888 /* bombed */
889 ERR("failed IPersistFile::Save %08lx\n", hres);
890 IPersistFile_Release(pPf);
891 IShellLinkA_Release(psl);
892 goto fail;
893 }
894 hres = IPersistFile_SaveCompleted(pPf, widelink);
895 IPersistFile_Release(pPf);
896 IShellLinkA_Release(psl);
897 TRACE("shortcut %s has been created, result=%08lx\n",
898 new_lnk_filepath, hres);
899 }
900 else {
901 ERR("CoCreateInstance failed, hres=%08lx\n", hres);
902 }
903 }
904
905 fail:
906 CoUninitialize();
907
908 /* all done */
909 RegCloseKey(HCUbasekey);
910 return 0;
911}
912
913/*************************************************************************
914 * SHCreateShellFolderViewEx [SHELL32.174]
915 *
916 * NOTES
917 * see IShellFolder::CreateViewObject
918 */
919HRESULT WINAPI SHCreateShellFolderViewEx(
920 LPCSHELLFOLDERVIEWINFO psvcbi, /* [in] shelltemplate struct */
921 LPSHELLVIEW* ppv) /* [out] IShellView pointer */
922{
923 IShellView * psf;
924 HRESULT hRes;
925
926 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=0x%08lx\n",
927 psvcbi->pshf, psvcbi->pidlFolder, psvcbi->lpfnCallback,
928 psvcbi->uViewMode, psvcbi->dwUser);
929
930 psf = IShellView_Constructor(psvcbi->pshf);
931
932 if (!psf)
933 return E_OUTOFMEMORY;
934
935 IShellView_AddRef(psf);
936 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
937 IShellView_Release(psf);
938
939 return hRes;
940}
941/*************************************************************************
942 * SHWinHelp [SHELL32.127]
943 *
944 */
945HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
946{ FIXME("0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
947 return 0;
948}
949/*************************************************************************
950 * SHRunControlPanel [SHELL32.161]
951 *
952 */
953HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
954{ FIXME("0x%08lx 0x%08lx stub\n",x,z);
955 return 0;
956}
957/*************************************************************************
958 * ShellExecuteEx [SHELL32.291]
959 *
960 */
961BOOL WINAPI ShellExecuteExAW (LPVOID sei)
962{ if (SHELL_OsIsUnicode())
963 return ShellExecuteExW (sei);
964 return ShellExecuteExA (sei);
965}
966/*************************************************************************
967 * ShellExecuteExA [SHELL32.292]
968 *
969 * placeholder in the commandline:
970 * %1 file
971 * %2 printer
972 * %3 driver
973 * %4 port
974 * %I adress of a global item ID (explorer switch /idlist)
975 * %L ??? path/url/current file ???
976 * %S ???
977 * %* all following parameters (see batfile)
978 */
979BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
980{ CHAR szApplicationName[MAX_PATH],szCommandline[MAX_PATH],szPidl[20];
981 LPSTR pos;
982 int gap, len;
983 STARTUPINFOA startup;
984 PROCESS_INFORMATION info;
985
986 WARN("mask=0x%08lx hwnd=0x%04x verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s incomplete\n",
987 sei->fMask, sei->hwnd, sei->lpVerb, sei->lpFile,
988 sei->lpParameters, sei->lpDirectory, sei->nShow,
989 (sei->fMask & SEE_MASK_CLASSNAME) ? sei->lpClass : "not used");
990
991 ZeroMemory(szApplicationName,MAX_PATH);
992 if (sei->lpFile)
993 strcpy(szApplicationName, sei->lpFile);
994
995 ZeroMemory(szCommandline,MAX_PATH);
996 if (sei->lpParameters)
997 strcpy(szCommandline, sei->lpParameters);
998
999 if (sei->fMask & (SEE_MASK_CLASSKEY | SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
1000 SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT |
1001 SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE |
1002 SEE_MASK_NO_CONSOLE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR ))
1003 {
1004 FIXME("flags ignored: 0x%08lx\n", sei->fMask);
1005 }
1006
1007 /* launch a document by fileclass like 'Wordpad.Document.1' */
1008 if (sei->fMask & SEE_MASK_CLASSNAME)
1009 {
1010 /* the commandline contains 'c:\Path\wordpad.exe "%1"' */
1011 HCR_GetExecuteCommand(sei->lpClass, (sei->lpVerb) ? sei->lpVerb : "open", szCommandline, 256);
1012 /* fixme: get the extension of lpFile, check if it fits to the lpClass */
1013 TRACE("SEE_MASK_CLASSNAME->'%s'\n", szCommandline);
1014 }
1015
1016 /* process the IDList */
1017 if ( (sei->fMask & SEE_MASK_INVOKEIDLIST) == SEE_MASK_INVOKEIDLIST) /*0x0c*/
1018 {
1019 SHGetPathFromIDListA (sei->lpIDList,szApplicationName);
1020 TRACE("-- idlist=%p (%s)\n", sei->lpIDList, szApplicationName);
1021 }
1022 else
1023 {
1024 if (sei->fMask & SEE_MASK_IDLIST )
1025 {
1026 pos = strstr(szCommandline, "%I");
1027 if (pos)
1028 {
1029 LPVOID pv;
1030 HGLOBAL hmem = SHAllocShared ( sei->lpIDList, ILGetSize(sei->lpIDList), 0);
1031 pv = SHLockShared(hmem,0);
1032 sprintf(szPidl,":%p",pv );
1033 SHUnlockShared(pv);
1034
1035 gap = strlen(szPidl);
1036 len = strlen(pos)-2;
1037 memmove(pos+gap,pos+2,len);
1038 memcpy(pos,szPidl,gap);
1039
1040 }
1041 }
1042 }
1043
1044 TRACE("execute:'%s','%s'\n",szApplicationName, szCommandline);
1045
1046 strcat(szApplicationName, " ");
1047 strcat(szApplicationName, szCommandline);
1048
1049 ZeroMemory(&startup,sizeof(STARTUPINFOA));
1050 startup.cb = sizeof(STARTUPINFOA);
1051
1052 if (! CreateProcessA(NULL, szApplicationName,
1053 NULL, NULL, FALSE, 0,
1054 NULL, NULL, &startup, &info))
1055 {
1056 sei->hInstApp = GetLastError();
1057 return FALSE;
1058 }
1059
1060 sei->hInstApp = 33;
1061
1062 /* Give 30 seconds to the app to come up */
1063 if ( WaitForInputIdle ( info.hProcess, 30000 ) == 0xFFFFFFFF )
1064 ERR("WaitForInputIdle failed: Error %ld\n", GetLastError() );
1065
1066 if(sei->fMask & SEE_MASK_NOCLOSEPROCESS)
1067 sei->hProcess = info.hProcess;
1068 else
1069 CloseHandle( info.hProcess );
1070 CloseHandle( info.hThread );
1071 return TRUE;
1072}
1073/*************************************************************************
1074 * ShellExecuteExW [SHELL32.293]
1075 *
1076 */
1077BOOL WINAPI ShellExecuteExW (LPSHELLEXECUTEINFOW sei)
1078{ SHELLEXECUTEINFOA seiA;
1079 DWORD ret;
1080
1081 TRACE("%p\n", sei);
1082
1083 memcpy(&seiA, sei, sizeof(SHELLEXECUTEINFOA));
1084
1085 if (sei->lpVerb)
1086 seiA.lpVerb = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpVerb);
1087
1088 if (sei->lpFile)
1089 seiA.lpFile = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpFile);
1090
1091 if (sei->lpParameters)
1092 seiA.lpParameters = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpParameters);
1093
1094 if (sei->lpDirectory)
1095 seiA.lpDirectory = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpDirectory);
1096
1097 if ((sei->fMask & SEE_MASK_CLASSNAME) && sei->lpClass)
1098 seiA.lpClass = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpClass);
1099 else
1100 seiA.lpClass = NULL;
1101
1102 ret = ShellExecuteExA(&seiA);
1103
1104 if (seiA.lpVerb) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpVerb );
1105 if (seiA.lpFile) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpFile );
1106 if (seiA.lpParameters) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpParameters );
1107 if (seiA.lpDirectory) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpDirectory );
1108 if (seiA.lpClass) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpClass );
1109
1110 return ret;
1111}
1112
1113static LPUNKNOWN SHELL32_IExplorerInterface=0;
1114/*************************************************************************
1115 * SHSetInstanceExplorer [SHELL32.176]
1116 *
1117 * NOTES
1118 * Sets the interface
1119 */
1120HRESULT WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
1121{ TRACE("%p\n", lpUnknown);
1122 SHELL32_IExplorerInterface = lpUnknown;
1123 return (HRESULT) lpUnknown;
1124}
1125/*************************************************************************
1126 * SHGetInstanceExplorer [SHELL32.@]
1127 *
1128 * NOTES
1129 * gets the interface pointer of the explorer and a reference
1130 */
1131HRESULT WINAPI SHGetInstanceExplorer (LPUNKNOWN * lpUnknown)
1132{ TRACE("%p\n", lpUnknown);
1133
1134 *lpUnknown = SHELL32_IExplorerInterface;
1135
1136 if (!SHELL32_IExplorerInterface)
1137 return E_FAIL;
1138
1139 IUnknown_AddRef(SHELL32_IExplorerInterface);
1140 return NOERROR;
1141}
1142/*************************************************************************
1143 * SHFreeUnusedLibraries [SHELL32.123]
1144 *
1145 * NOTES
1146 * exported by name
1147 */
1148void WINAPI SHFreeUnusedLibraries (void)
1149{
1150 FIXME("stub\n");
1151}
1152/*************************************************************************
1153 * DAD_SetDragImage [SHELL32.136]
1154 *
1155 * NOTES
1156 * exported by name
1157 */
1158BOOL WINAPI DAD_SetDragImage(
1159 HIMAGELIST himlTrack,
1160 LPPOINT lppt)
1161{
1162 FIXME("%p %p stub\n",himlTrack, lppt);
1163 return 0;
1164}
1165/*************************************************************************
1166 * DAD_ShowDragImage [SHELL32.137]
1167 *
1168 * NOTES
1169 * exported by name
1170 */
1171BOOL WINAPI DAD_ShowDragImage(BOOL bShow)
1172{
1173 FIXME("0x%08x stub\n",bShow);
1174 return 0;
1175}
1176/*************************************************************************
1177 * ReadCabinetState [SHELL32.651] NT 4.0
1178 *
1179 */
1180HRESULT WINAPI ReadCabinetState(DWORD u, DWORD v)
1181{ FIXME("0x%04lx 0x%04lx stub\n",u,v);
1182 return 0;
1183}
1184/*************************************************************************
1185 * WriteCabinetState [SHELL32.652] NT 4.0
1186 *
1187 */
1188HRESULT WINAPI WriteCabinetState(DWORD u)
1189{ FIXME("0x%04lx stub\n",u);
1190 return 0;
1191}
1192/*************************************************************************
1193 * FileIconInit [SHELL32.660]
1194 *
1195 */
1196BOOL WINAPI FileIconInit(BOOL bFullInit)
1197{ FIXME("(%s)\n", bFullInit ? "true" : "false");
1198 return 0;
1199}
1200/*************************************************************************
1201 * IsUserAdmin [SHELL32.680] NT 4.0
1202 *
1203 */
1204HRESULT WINAPI IsUserAdmin(void)
1205{ FIXME("stub\n");
1206 return TRUE;
1207}
1208
1209/*************************************************************************
1210 * SHAllocShared [SHELL32.520]
1211 *
1212 * NOTES
1213 * parameter1 is return value from HeapAlloc
1214 * parameter2 is equal to the size allocated with HeapAlloc
1215 * parameter3 is return value from GetCurrentProcessId
1216 *
1217 * the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
1218 * WM_USER+2 could be the undocumented CWM_SETPATH
1219 * the allocated memory contains a pidl
1220 */
1221HGLOBAL WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
1222{ HGLOBAL hmem;
1223 LPVOID pmem;
1224
1225 TRACE("ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID);
1226 hmem = GlobalAlloc(GMEM_FIXED, size);
1227 if (!hmem)
1228 return 0;
1229
1230 pmem = GlobalLock (hmem);
1231
1232 if (! pmem)
1233 return 0;
1234
1235 memcpy (pmem, psrc, size);
1236 GlobalUnlock(hmem);
1237 return hmem;
1238}
1239/*************************************************************************
1240 * SHLockShared [SHELL32.521]
1241 *
1242 * NOTES
1243 * parameter1 is return value from SHAllocShared
1244 * parameter2 is return value from GetCurrentProcessId
1245 * the receiver of (WM_USER+2) trys to lock the HANDLE (?)
1246 * the returnvalue seems to be a memoryadress
1247 */
1248LPVOID WINAPI SHLockShared(HANDLE hmem, DWORD procID)
1249{ TRACE("handle=0x%04x procID=0x%04lx\n",hmem,procID);
1250 return GlobalLock(hmem);
1251}
1252/*************************************************************************
1253 * SHUnlockShared [SHELL32.522]
1254 *
1255 * NOTES
1256 * parameter1 is return value from SHLockShared
1257 */
1258BOOL WINAPI SHUnlockShared(LPVOID pv)
1259{
1260 TRACE("%p\n",pv);
1261 return GlobalUnlock((HANDLE)pv);
1262}
1263/*************************************************************************
1264 * SHFreeShared [SHELL32.523]
1265 *
1266 * NOTES
1267 * parameter1 is return value from SHAllocShared
1268 * parameter2 is return value from GetCurrentProcessId
1269 */
1270BOOL WINAPI SHFreeShared(
1271 HANDLE hMem,
1272 DWORD pid)
1273{
1274 TRACE("handle=0x%04x 0x%04lx\n",hMem,pid);
1275 return GlobalFree(hMem);
1276}
1277
1278/*************************************************************************
1279 * SetAppStartingCursor [SHELL32.99]
1280 */
1281HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
1282{ FIXME("hwnd=0x%04x 0x%04lx stub\n",u,v );
1283 return 0;
1284}
1285/*************************************************************************
1286 * SHLoadOLE [SHELL32.151]
1287 *
1288 */
1289HRESULT WINAPI SHLoadOLE(DWORD u)
1290{ FIXME("0x%04lx stub\n",u);
1291 return S_OK;
1292}
1293/*************************************************************************
1294 * DriveType [SHELL32.64]
1295 *
1296 */
1297HRESULT WINAPI DriveType(DWORD u)
1298{ FIXME("0x%04lx stub\n",u);
1299 return 0;
1300}
1301/*************************************************************************
1302 * SHAbortInvokeCommand [SHELL32.198]
1303 *
1304 */
1305HRESULT WINAPI SHAbortInvokeCommand(void)
1306{ FIXME("stub\n");
1307 return 1;
1308}
1309/*************************************************************************
1310 * SHOutOfMemoryMessageBox [SHELL32.126]
1311 *
1312 */
1313int WINAPI SHOutOfMemoryMessageBox(
1314 HWND hwndOwner,
1315 LPCSTR lpCaption,
1316 UINT uType)
1317{
1318 FIXME("0x%04x %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
1319 return 0;
1320}
1321/*************************************************************************
1322 * SHFlushClipboard [SHELL32.121]
1323 *
1324 */
1325HRESULT WINAPI SHFlushClipboard(void)
1326{ FIXME("stub\n");
1327 return 1;
1328}
1329
1330/*************************************************************************
1331 * SHWaitForFileToOpen [SHELL32.97]
1332 *
1333 */
1334BOOL WINAPI SHWaitForFileToOpen(
1335 LPCITEMIDLIST pidl,
1336 DWORD dwFlags,
1337 DWORD dwTimeout)
1338{
1339 FIXME("%p 0x%08lx 0x%08lx stub\n", pidl, dwFlags, dwTimeout);
1340 return 0;
1341}
1342
1343/************************************************************************
1344 * @ [SHELL32.654]
1345 *
1346 * NOTES: first parameter seems to be a pointer (same as passed to WriteCabinetState)
1347 * second one could be a size (0x0c). The size is the same as the structure saved to
1348 * HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState
1349 * I'm (js) guessing: this one is just ReadCabinetState ;-)
1350 */
1351HRESULT WINAPI shell32_654 (DWORD x, DWORD y)
1352{ FIXME("0x%08lx 0x%08lx stub\n",x,y);
1353 return 0;
1354}
1355
1356/************************************************************************
1357 * RLBuildListOfPaths [SHELL32.146]
1358 *
1359 * NOTES
1360 * builds a DPA
1361 */
1362DWORD WINAPI RLBuildListOfPaths (void)
1363{ FIXME("stub\n");
1364 return 0;
1365}
1366/************************************************************************
1367 * SHValidateUNC [SHELL32.173]
1368 *
1369 */
1370HRESULT WINAPI SHValidateUNC (DWORD x, DWORD y, DWORD z)
1371{
1372 FIXME("0x%08lx 0x%08lx 0x%08lx stub\n",x,y,z);
1373 return 0;
1374}
1375
1376/************************************************************************
1377 * DoEnvironmentSubstA [SHELL32.@]
1378 *
1379 */
1380HRESULT WINAPI DoEnvironmentSubstA(LPSTR x, LPSTR y)
1381{
1382 FIXME("(%s, %s) stub\n", debugstr_a(x), debugstr_a(y));
1383 return 0;
1384}
1385
1386/************************************************************************
1387 * DoEnvironmentSubstW [SHELL32.@]
1388 *
1389 */
1390HRESULT WINAPI DoEnvironmentSubstW(LPWSTR x, LPWSTR y)
1391{
1392 FIXME("(%s, %s): stub\n", debugstr_w(x), debugstr_w(y));
1393 return 0;
1394}
1395
1396/************************************************************************
1397 * DoEnvironmentSubst [SHELL32.53]
1398 *
1399 */
1400HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y)
1401{
1402 if (SHELL_OsIsUnicode())
1403 return DoEnvironmentSubstW(x, y);
1404 return DoEnvironmentSubstA(x, y);
1405}
1406
1407/*************************************************************************
1408 * @ [SHELL32.243]
1409 *
1410 * Win98+ by-ordinal routine. In Win98 this routine returns zero and
1411 * does nothing else. Possibly this does something in NT or SHELL32 5.0?
1412 *
1413 */
1414
1415BOOL WINAPI shell32_243(DWORD a, DWORD b)
1416{
1417 return FALSE;
1418}
1419
1420/*************************************************************************
1421 * @ [SHELL32.714]
1422 */
1423DWORD WINAPI SHELL32_714(LPVOID x)
1424{
1425 FIXME("(%s)stub\n", debugstr_w(x));
1426 return 0;
1427}
1428
1429/*************************************************************************
1430 * SHAddFromPropSheetExtArray [SHELL32.167]
1431 */
1432DWORD WINAPI SHAddFromPropSheetExtArray(DWORD a, DWORD b, DWORD c)
1433{
1434 FIXME("(%08lx,%08lx,%08lx)stub\n", a, b, c);
1435 return 0;
1436}
1437
1438/*************************************************************************
1439 * SHCreatePropSheetExtArray [SHELL32.168]
1440 */
1441DWORD WINAPI SHCreatePropSheetExtArray(DWORD a, LPCSTR b, DWORD c)
1442{
1443 FIXME("(%08lx,%s,%08lx)stub\n", a, debugstr_a(b), c);
1444 return 0;
1445}
1446
1447/*************************************************************************
1448 * SHReplaceFromPropSheetExtArray [SHELL32.170]
1449 */
1450DWORD WINAPI SHReplaceFromPropSheetExtArray(DWORD a, DWORD b, DWORD c, DWORD d)
1451{
1452 FIXME("(%08lx,%08lx,%08lx,%08lx)stub\n", a, b, c, d);
1453 return 0;
1454}
1455
1456/*************************************************************************
1457 * SHDestroyPropSheetExtArray [SHELL32.169]
1458 */
1459DWORD WINAPI SHDestroyPropSheetExtArray(DWORD a)
1460{
1461 FIXME("(%08lx)stub\n", a);
1462 return 0;
1463}
Note: See TracBrowser for help on using the repository browser.