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

Last change on this file since 6823 was 6810, checked in by sandervl, 24 years ago

wine update

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