2 * The parameters of many functions changes between different OS versions
3 * (NT uses Unicode strings, 95 uses ASCII strings)
5 * Copyright 1997 Marcus Meissner
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
34 #include "wine/debug.h"
43 #include "shell32_main.h"
44 #include "undocshell.h"
49 WINE_DEFAULT_DEBUG_CHANNEL(shell);
50 WINE_DECLARE_DEBUG_CHANNEL(pidl);
52 /* FIXME: !!! move CREATEMRULIST and flags to header file !!! */
53 /* !!! it is in both here and comctl32undoc.c !!! */
54 typedef struct tagCREATEMRULIST
56 DWORD cbSize; /* size of struct */
57 DWORD nMaxItems; /* max no. of items in list */
58 DWORD dwFlags; /* see below */
59 HKEY hKey; /* root reg. key under which list is saved */
60 LPCSTR lpszSubKey; /* reg. subkey */
61 PROC lpfnCompare; /* item compare proc */
62 } CREATEMRULISTA, *LPCREATEMRULISTA;
65 #define MRUF_STRING_LIST 0 /* list will contain strings */
66 #define MRUF_BINARY_LIST 1 /* list will contain binary data */
67 #define MRUF_DELAYED_SAVE 2 /* only save list order to reg. is FreeMRUList */
69 extern HANDLE WINAPI CreateMRUListA(LPCREATEMRULISTA lpcml);
70 extern DWORD WINAPI FreeMRUList(HANDLE hMRUList);
71 extern INT WINAPI AddMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData);
72 extern INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum);
73 extern INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize);
76 /* Get a function pointer from a DLL handle */
77 #define GET_FUNC(func, module, name, fail) \
80 if (!SHELL32_h##module && !(SHELL32_h##module = LoadLibraryA(#module ".dll"))) return fail; \
81 func = (void*)GetProcAddress(SHELL32_h##module, name); \
82 if (!func) return fail; \
86 /* Function pointers for GET_FUNC macro */
87 static HMODULE SHELL32_hshlwapi=NULL;
88 static HANDLE (WINAPI *pSHAllocShared)(LPCVOID,DWORD,DWORD);
89 static LPVOID (WINAPI *pSHLockShared)(HANDLE,DWORD);
90 static BOOL (WINAPI *pSHUnlockShared)(LPVOID);
91 static BOOL (WINAPI *pSHFreeShared)(HANDLE,DWORD);
94 /*************************************************************************
95 * ParseFieldA [internal]
97 * copies a field from a ',' delimited string
99 * first field is nField = 1
101 DWORD WINAPI ParseFieldA(
107 WARN("(%s,0x%08x,%p,%d) semi-stub.\n",debugstr_a(src),nField,dst,len);
109 if (!src || !src[0] || !dst || !len)
112 /* skip n fields delimited by ',' */
115 if (*src=='\0') return FALSE;
116 if (*(src++)==',') nField--;
119 /* copy part till the next ',' to dst */
120 while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
122 /* finalize the string */
128 /*************************************************************************
129 * ParseFieldW [internal]
131 * copies a field from a ',' delimited string
133 * first field is nField = 1
135 DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
137 WARN("(%s,0x%08x,%p,%d) semi-stub.\n", debugstr_w(src), nField, dst, len);
139 if (!src || !src[0] || !dst || !len)
142 /* skip n fields delimited by ',' */
145 if (*src == 0x0) return FALSE;
146 if (*src++ == ',') nField--;
149 /* copy part till the next ',' to dst */
150 while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++) = *(src++);
152 /* finalize the string */
158 /*************************************************************************
159 * ParseField [SHELL32.58]
161 DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
163 if (SHELL_OsIsUnicode())
164 return ParseFieldW(src, nField, dst, len);
165 return ParseFieldA(src, nField, dst, len);
168 /*************************************************************************
169 * GetFileNameFromBrowse [SHELL32.63]
172 BOOL WINAPI GetFileNameFromBrowse(
176 LPCSTR lpstrInitialDir,
182 FARPROC pGetOpenFileNameA;
186 TRACE("%p, %s, %d, %s, %s, %s, %s)\n",
187 hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt,
188 lpstrFilter, lpstrTitle);
190 hmodule = LoadLibraryA("comdlg32.dll");
191 if(!hmodule) return FALSE;
192 pGetOpenFileNameA = GetProcAddress(hmodule, "GetOpenFileNameA");
193 if(!pGetOpenFileNameA)
195 FreeLibrary(hmodule);
199 memset(&ofn, 0, sizeof(ofn));
201 ofn.lStructSize = sizeof(ofn);
202 ofn.hwndOwner = hwndOwner;
203 ofn.lpstrFilter = lpstrFilter;
204 ofn.lpstrFile = lpstrFile;
205 ofn.nMaxFile = nMaxFile;
206 ofn.lpstrInitialDir = lpstrInitialDir;
207 ofn.lpstrTitle = lpstrTitle;
208 ofn.lpstrDefExt = lpstrDefExt;
209 ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST;
210 ret = pGetOpenFileNameA(&ofn);
212 FreeLibrary(hmodule);
216 /*************************************************************************
217 * SHGetSetSettings [SHELL32.68]
219 VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet)
223 FIXME("%p 0x%08x TRUE\n", lpss, dwMask);
227 SHGetSettings((LPSHELLFLAGSTATE)lpss,dwMask);
231 /*************************************************************************
232 * SHGetSettings [SHELL32.@]
235 * the registry path are for win98 (tested)
236 * and possibly are the same in nt40
239 VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
243 DWORD dwDataSize = sizeof (DWORD);
245 TRACE("(%p 0x%08x)\n",lpsfs,dwMask);
247 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
248 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
251 if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
252 lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
254 if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
255 lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
257 if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
258 lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
260 if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
261 lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
263 if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
264 lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
266 if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
267 lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
269 if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
271 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
272 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
274 else if (dwData == 1)
275 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
276 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
278 else if (dwData == 2)
279 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
280 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
285 TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
288 /*************************************************************************
289 * SHShellFolderView_Message [SHELL32.73]
291 * Send a message to an explorer cabinet window.
294 * hwndCabinet [I] The window containing the shellview to communicate with
295 * dwMessage [I] The SFVM message to send
296 * dwParam [I] Message parameter
302 * Message SFVM_REARRANGE = 1
304 * This message gets sent when a column gets clicked to instruct the
305 * shell view to re-sort the item list. dwParam identifies the column
308 LRESULT WINAPI SHShellFolderView_Message(
313 FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
317 /*************************************************************************
318 * RegisterShellHook [SHELL32.181]
320 * Register a shell hook.
323 * hwnd [I] Window handle
324 * dwType [I] Type of hook.
327 * Exported by ordinal
329 BOOL WINAPI RegisterShellHook(
333 FIXME("(%p,0x%08x):stub.\n",hWnd, dwType);
337 /*************************************************************************
338 * ShellMessageBoxW [SHELL32.182]
340 * See ShellMessageBoxA.
342 int WINAPIV ShellMessageBoxW(
350 WCHAR szText[100],szTitle[100];
351 LPCWSTR pszText = szText, pszTitle = szTitle;
356 va_start(args, uType);
357 /* wvsprintfA(buf,fmt, args); */
359 TRACE("(%p,%p,%p,%p,%08x)\n",
360 hInstance,hWnd,lpText,lpCaption,uType);
362 if (IS_INTRESOURCE(lpCaption))
363 LoadStringW(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
365 pszTitle = lpCaption;
367 if (IS_INTRESOURCE(lpText))
368 LoadStringW(hInstance, LOWORD(lpText), szText, sizeof(szText)/sizeof(szText[0]));
372 FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
373 pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
377 ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
378 LocalFree((HLOCAL)pszTemp);
382 /*************************************************************************
383 * ShellMessageBoxA [SHELL32.183]
385 * Format and output an error message.
388 * hInstance [I] Instance handle of message creator
389 * hWnd [I] Window handle of message creator
390 * lpText [I] Resource Id of title or LPSTR
391 * lpCaption [I] Resource Id of title or LPSTR
392 * uType [I] Type of error message
395 * A return value from MessageBoxA().
398 * Exported by ordinal
400 int WINAPIV ShellMessageBoxA(
408 char szText[100],szTitle[100];
409 LPCSTR pszText = szText, pszTitle = szTitle;
414 va_start(args, uType);
415 /* wvsprintfA(buf,fmt, args); */
417 TRACE("(%p,%p,%p,%p,%08x)\n",
418 hInstance,hWnd,lpText,lpCaption,uType);
420 if (IS_INTRESOURCE(lpCaption))
421 LoadStringA(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle));
423 pszTitle = lpCaption;
425 if (IS_INTRESOURCE(lpText))
426 LoadStringA(hInstance, LOWORD(lpText), szText, sizeof(szText));
430 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
431 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
435 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
436 LocalFree((HLOCAL)pszTemp);
440 /*************************************************************************
441 * SHRegisterDragDrop [SHELL32.86]
443 * Probably equivalent to RegisterDragDrop but under Windows 9x it could use the
444 * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
448 * exported by ordinal
451 * RegisterDragDrop, SHLoadOLE
453 HRESULT WINAPI SHRegisterDragDrop(
455 LPDROPTARGET pDropTarget)
457 FIXME("(%p,%p):stub.\n", hWnd, pDropTarget);
458 return RegisterDragDrop(hWnd, pDropTarget);
461 /*************************************************************************
462 * SHRevokeDragDrop [SHELL32.87]
464 * Probably equivalent to RevokeDragDrop but under Windows 9x it could use the
465 * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
469 * exported by ordinal
472 * RevokeDragDrop, SHLoadOLE
474 HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
476 FIXME("(%p):stub.\n",hWnd);
477 return RevokeDragDrop(hWnd);
480 /*************************************************************************
481 * SHDoDragDrop [SHELL32.88]
483 * Probably equivalent to DoDragDrop but under Windows 9x it could use the
484 * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
488 * exported by ordinal
491 * DoDragDrop, SHLoadOLE
493 HRESULT WINAPI SHDoDragDrop(
495 LPDATAOBJECT lpDataObject,
496 LPDROPSOURCE lpDropSource,
500 FIXME("(%p %p %p 0x%08x %p):stub.\n",
501 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
502 return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
505 /*************************************************************************
506 * ArrangeWindows [SHELL32.184]
509 WORD WINAPI ArrangeWindows(
516 FIXME("(%p 0x%08x %p 0x%04x %p):stub.\n",
517 hwndParent, dwReserved, lpRect, cKids, lpKids);
521 /*************************************************************************
522 * SignalFileOpen [SHELL32.103]
525 * exported by ordinal
528 SignalFileOpen (DWORD dwParam1)
530 FIXME("(0x%08x):stub.\n", dwParam1);
535 /*************************************************************************
536 * SHADD_get_policy - helper function for SHAddToRecentDocs
539 * policy [IN] policy name (null termed string) to find
540 * type [OUT] ptr to DWORD to receive type
541 * buffer [OUT] ptr to area to hold data retrieved
542 * len [IN/OUT] ptr to DWORD holding size of buffer and getting
546 * result of the SHQueryValueEx call
548 static INT SHADD_get_policy(LPCSTR policy, LPDWORD type, LPVOID buffer, LPDWORD len)
553 /* Get the key for the policies location in the registry
555 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
556 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
557 0, KEY_READ, &Policy_basekey)) {
559 if (RegOpenKeyExA(HKEY_CURRENT_USER,
560 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
561 0, KEY_READ, &Policy_basekey)) {
562 TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
565 return ERROR_FILE_NOT_FOUND;
569 /* Retrieve the data if it exists
571 ret = SHQueryValueExA(Policy_basekey, policy, 0, type, buffer, len);
572 RegCloseKey(Policy_basekey);
577 /*************************************************************************
578 * SHADD_compare_mru - helper function for SHAddToRecentDocs
581 * data1 [IN] data being looked for
582 * data2 [IN] data in MRU
583 * cbdata [IN] length from FindMRUData call (not used)
586 * position within MRU list that data was added.
588 static INT CALLBACK SHADD_compare_mru(LPCVOID data1, LPCVOID data2, DWORD cbData)
590 return lstrcmpiA(data1, data2);
593 /*************************************************************************
594 * SHADD_create_add_mru_data - helper function for SHAddToRecentDocs
597 * mruhandle [IN] handle for created MRU list
598 * doc_name [IN] null termed pure doc name
599 * new_lnk_name [IN] null termed path and file name for .lnk file
600 * buffer [IN/OUT] 2048 byte area to construct MRU data
601 * len [OUT] ptr to int to receive space used in buffer
604 * position within MRU list that data was added.
606 static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPSTR doc_name, LPSTR new_lnk_name,
607 LPSTR buffer, INT *len)
613 * RecentDocs MRU data structure seems to be:
614 * +0h document file name w/ terminating 0h
615 * +nh short int w/ size of remaining
616 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
617 * +n+4h 10 bytes zeros - unknown
618 * +n+eh shortcut file name w/ terminating 0h
619 * +n+e+nh 3 zero bytes - unknown
622 /* Create the MRU data structure for "RecentDocs"
625 lstrcpyA(ptr, doc_name);
626 ptr += (lstrlenA(buffer) + 1);
627 wlen= lstrlenA(new_lnk_name) + 1 + 12;
628 *((short int*)ptr) = wlen;
629 ptr += 2; /* step past the length */
630 *(ptr++) = 0x30; /* unknown reason */
631 *(ptr++) = 0; /* unknown, but can be 0x00, 0x01, 0x02 */
634 lstrcpyA(ptr, new_lnk_name);
635 ptr += (lstrlenA(new_lnk_name) + 1);
640 /* Add the new entry into the MRU list
642 return AddMRUData(mruhandle, (LPCVOID)buffer, *len);
645 /*************************************************************************
646 * SHAddToRecentDocs [SHELL32.@]
648 * Modify (add/clear) Shell's list of recently used documents.
651 * uFlags [IN] SHARD_PATHA, SHARD_PATHW or SHARD_PIDL
652 * pv [IN] string or pidl, NULL clears the list
660 void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
662 /* If list is a string list lpfnCompare has the following prototype
663 * int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
664 * for binary lists the prototype is
665 * int CALLBACK MRUCompareBinary(LPCVOID data1, LPCVOID data2, DWORD cbData)
666 * where cbData is the no. of bytes to compare.
667 * Need to check what return value means identical - 0?
673 CHAR doc_name[MAX_PATH];
674 CHAR link_dir[MAX_PATH];
675 CHAR new_lnk_filepath[MAX_PATH];
676 CHAR new_lnk_name[MAX_PATH];
679 HWND hwnd = 0; /* FIXME: get real window handle */
681 DWORD data[64], datalen, type;
683 TRACE("%04x %p\n", uFlags, pv);
686 * RecentDocs MRU data structure seems to be:
687 * +0h document file name w/ terminating 0h
688 * +nh short int w/ size of remaining
689 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
690 * +n+4h 10 bytes zeros - unknown
691 * +n+eh shortcut file name w/ terminating 0h
692 * +n+e+nh 3 zero bytes - unknown
695 /* See if we need to do anything.
698 ret=SHADD_get_policy( "NoRecentDocsHistory", &type, &data, &datalen);
699 if ((ret > 0) && (ret != ERROR_FILE_NOT_FOUND)) {
700 ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
703 if (ret == ERROR_SUCCESS) {
704 if (!( (type == REG_DWORD) ||
705 ((type == REG_BINARY) && (datalen == 4)) )) {
706 ERR("Error policy data for \"NoRecentDocsHistory\" not formatted correctly, type=%d, len=%d\n",
711 TRACE("policy value for NoRecentDocsHistory = %08x\n", data[0]);
712 /* now test the actual policy value */
717 /* Open key to where the necessary info is
719 /* FIXME: This should be done during DLL PROCESS_ATTACH (or THREAD_ATTACH)
720 * and the close should be done during the _DETACH. The resulting
721 * key is stored in the DLL global data.
723 if (RegCreateKeyExA(HKEY_CURRENT_USER,
724 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
725 0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
726 ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
730 /* Get path to user's "Recent" directory
732 if(SUCCEEDED(SHGetMalloc(&ppM))) {
733 if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT,
735 SHGetPathFromIDListA(pidl, link_dir);
736 IMalloc_Free(ppM, pidl);
741 ERR("serious issues 1\n");
743 IMalloc_Release(ppM);
748 ERR("serious issues 2\n");
750 TRACE("Users Recent dir %s\n", link_dir);
752 /* If no input, then go clear the lists */
754 /* clear user's Recent dir
757 /* FIXME: delete all files in "link_dir"
759 * while( more files ) {
760 * lstrcpyA(old_lnk_name, link_dir);
761 * PathAppendA(old_lnk_name, filenam);
762 * DeleteFileA(old_lnk_name);
765 FIXME("should delete all files in %s\\\n", link_dir);
769 /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
770 * HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
771 * and naturally it fails w/ rc=2. It should do it against
772 * HKEY_CURRENT_USER which is where it is stored, and where
773 * the MRU routines expect it!!!!
775 RegDeleteKeyA(HCUbasekey, "RecentDocs");
776 RegCloseKey(HCUbasekey);
780 /* Have data to add, the jobs to be done:
781 * 1. Add document to MRU list in registry "HKCU\Software\
782 * Microsoft\Windows\CurrentVersion\Explorer\RecentDocs".
783 * 2. Add shortcut to document in the user's Recent directory
785 * 3. Add shortcut to Start menu's Documents submenu.
788 /* Get the pure document name from the input
793 SHGetPathFromIDListA((LPCITEMIDLIST) pv, doc_name);
797 lstrcpynA(doc_name, (LPCSTR)pv, MAX_PATH);
801 WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)pv, -1, doc_name, MAX_PATH, NULL, NULL);
805 FIXME("Unsupported flags: %u\n", uFlags);
809 TRACE("full document name %s\n", debugstr_a(doc_name));
810 PathStripPathA(doc_name);
811 TRACE("stripped document name %s\n", debugstr_a(doc_name));
814 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
817 * doc_name - pure file-spec, no path
818 * link_dir - path to the user's Recent directory
819 * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node
821 * new_lnk_name- pure file-spec, no path for new .lnk file
823 * - path and file name of new .lnk file
825 CREATEMRULISTA mymru;
827 INT len, pos, bufused, err;
832 CHAR old_lnk_name[MAX_PATH];
835 mymru.cbSize = sizeof(CREATEMRULISTA);
836 mymru.nMaxItems = 15;
837 mymru.dwFlags = MRUF_BINARY_LIST | MRUF_DELAYED_SAVE;
838 mymru.hKey = HCUbasekey;
839 mymru.lpszSubKey = "RecentDocs";
840 mymru.lpfnCompare = &SHADD_compare_mru;
841 mruhandle = CreateMRUListA(&mymru);
844 ERR("MRU processing failed, handle zero\n");
845 RegCloseKey(HCUbasekey);
848 len = lstrlenA(doc_name);
849 pos = FindMRUData(mruhandle, doc_name, len, 0);
851 /* Now get the MRU entry that will be replaced
852 * and delete the .lnk file for it
854 if ((bufused = EnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
855 buffer, 2048)) != -1) {
857 ptr += (lstrlenA(buffer) + 1);
858 slen = *((short int*)ptr);
859 ptr += 2; /* skip the length area */
860 if (bufused >= slen + (ptr-buffer)) {
861 /* buffer size looks good */
862 ptr += 12; /* get to string */
863 len = bufused - (ptr-buffer); /* get length of buf remaining */
864 if ((lstrlenA(ptr) > 0) && (lstrlenA(ptr) <= len-1)) {
865 /* appears to be good string */
866 lstrcpyA(old_lnk_name, link_dir);
867 PathAppendA(old_lnk_name, ptr);
868 if (!DeleteFileA(old_lnk_name)) {
869 if ((attr = GetFileAttributesA(old_lnk_name)) == INVALID_FILE_ATTRIBUTES) {
870 if ((err = GetLastError()) != ERROR_FILE_NOT_FOUND) {
871 ERR("Delete for %s failed, err=%d, attr=%08x\n",
872 old_lnk_name, err, attr);
875 TRACE("old .lnk file %s did not exist\n",
880 ERR("Delete for %s failed, attr=%08x\n",
885 TRACE("deleted old .lnk file %s\n", old_lnk_name);
891 /* Create usable .lnk file name for the "Recent" directory
893 wsprintfA(new_lnk_name, "%s.lnk", doc_name);
894 lstrcpyA(new_lnk_filepath, link_dir);
895 PathAppendA(new_lnk_filepath, new_lnk_name);
897 olderrormode = SetErrorMode(SEM_FAILCRITICALERRORS);
898 while (GetFileAttributesA(new_lnk_filepath) != INVALID_FILE_ATTRIBUTES) {
900 wsprintfA(new_lnk_name, "%s (%u).lnk", doc_name, i);
901 lstrcpyA(new_lnk_filepath, link_dir);
902 PathAppendA(new_lnk_filepath, new_lnk_name);
904 SetErrorMode(olderrormode);
905 TRACE("new shortcut will be %s\n", new_lnk_filepath);
907 /* Now add the new MRU entry and data
909 pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
911 FreeMRUList(mruhandle);
912 TRACE("Updated MRU list, new doc is position %d\n", pos);
915 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
918 * doc_name - pure file-spec, no path
920 * - path and file name of new .lnk file
921 * uFlags[in] - flags on call to SHAddToRecentDocs
922 * pv[in] - document path/pidl on call to SHAddToRecentDocs
924 IShellLinkA *psl = NULL;
925 IPersistFile *pPf = NULL;
928 WCHAR widelink[MAX_PATH];
932 hres = CoCreateInstance( &CLSID_ShellLink,
934 CLSCTX_INPROC_SERVER,
937 if(SUCCEEDED(hres)) {
939 hres = IShellLinkA_QueryInterface(psl, &IID_IPersistFile,
943 ERR("failed QueryInterface for IPersistFile %08x\n", hres);
947 /* Set the document path or pidl */
948 if (uFlags == SHARD_PIDL) {
949 hres = IShellLinkA_SetIDList(psl, (LPCITEMIDLIST) pv);
951 hres = IShellLinkA_SetPath(psl, (LPCSTR) pv);
955 ERR("failed Set{IDList|Path} %08x\n", hres);
959 lstrcpyA(desc, "Shortcut to ");
960 lstrcatA(desc, doc_name);
961 hres = IShellLinkA_SetDescription(psl, desc);
964 ERR("failed SetDescription %08x\n", hres);
968 MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1,
970 /* create the short cut */
971 hres = IPersistFile_Save(pPf, widelink, TRUE);
974 ERR("failed IPersistFile::Save %08x\n", hres);
975 IPersistFile_Release(pPf);
976 IShellLinkA_Release(psl);
979 hres = IPersistFile_SaveCompleted(pPf, widelink);
980 IPersistFile_Release(pPf);
981 IShellLinkA_Release(psl);
982 TRACE("shortcut %s has been created, result=%08x\n",
983 new_lnk_filepath, hres);
986 ERR("CoCreateInstance failed, hres=%08x\n", hres);
994 RegCloseKey(HCUbasekey);
998 /*************************************************************************
999 * SHCreateShellFolderViewEx [SHELL32.174]
1001 * Create a new instance of the default Shell folder view object.
1005 * Failure: error value
1008 * see IShellFolder::CreateViewObject
1010 HRESULT WINAPI SHCreateShellFolderViewEx(
1011 LPCSFV psvcbi, /* [in] shelltemplate struct */
1012 IShellView **ppv) /* [out] IShellView pointer */
1017 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
1018 psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
1019 psvcbi->fvm, psvcbi->psvOuter);
1021 psf = IShellView_Constructor(psvcbi->pshf);
1024 return E_OUTOFMEMORY;
1026 IShellView_AddRef(psf);
1027 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
1028 IShellView_Release(psf);
1032 /*************************************************************************
1033 * SHWinHelp [SHELL32.127]
1036 HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
1037 { FIXME("0x%08x 0x%08x 0x%08x 0x%08x stub\n",v,w,x,z);
1040 /*************************************************************************
1041 * SHRunControlPanel [SHELL32.161]
1044 HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
1045 { FIXME("0x%08x 0x%08x stub\n",x,z);
1049 static LPUNKNOWN SHELL32_IExplorerInterface=0;
1050 /*************************************************************************
1051 * SHSetInstanceExplorer [SHELL32.176]
1054 * Sets the interface
1056 VOID WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
1057 { TRACE("%p\n", lpUnknown);
1058 SHELL32_IExplorerInterface = lpUnknown;
1060 /*************************************************************************
1061 * SHGetInstanceExplorer [SHELL32.@]
1064 * gets the interface pointer of the explorer and a reference
1066 HRESULT WINAPI SHGetInstanceExplorer (LPUNKNOWN * lpUnknown)
1067 { TRACE("%p\n", lpUnknown);
1069 *lpUnknown = SHELL32_IExplorerInterface;
1071 if (!SHELL32_IExplorerInterface)
1074 IUnknown_AddRef(SHELL32_IExplorerInterface);
1077 /*************************************************************************
1078 * SHFreeUnusedLibraries [SHELL32.123]
1080 * Probably equivalent to CoFreeUnusedLibraries but under Windows 9x it could use
1081 * the shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
1085 * exported by ordinal
1088 * CoFreeUnusedLibraries, SHLoadOLE
1090 void WINAPI SHFreeUnusedLibraries (void)
1093 CoFreeUnusedLibraries();
1095 /*************************************************************************
1096 * DAD_AutoScroll [SHELL32.129]
1099 BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *samples, LPPOINT pt)
1101 FIXME("hwnd = %p %p %p\n",hwnd,samples,pt);
1104 /*************************************************************************
1105 * DAD_DragEnter [SHELL32.130]
1108 BOOL WINAPI DAD_DragEnter(HWND hwnd)
1110 FIXME("hwnd = %p\n",hwnd);
1113 /*************************************************************************
1114 * DAD_DragEnterEx [SHELL32.131]
1117 BOOL WINAPI DAD_DragEnterEx(HWND hwnd, POINT p)
1119 FIXME("hwnd = %p (%d,%d)\n",hwnd,p.x,p.y);
1122 /*************************************************************************
1123 * DAD_DragMove [SHELL32.134]
1126 BOOL WINAPI DAD_DragMove(POINT p)
1128 FIXME("(%d,%d)\n",p.x,p.y);
1131 /*************************************************************************
1132 * DAD_DragLeave [SHELL32.132]
1135 BOOL WINAPI DAD_DragLeave(VOID)
1140 /*************************************************************************
1141 * DAD_SetDragImage [SHELL32.136]
1146 BOOL WINAPI DAD_SetDragImage(
1147 HIMAGELIST himlTrack,
1150 FIXME("%p %p stub\n",himlTrack, lppt);
1153 /*************************************************************************
1154 * DAD_ShowDragImage [SHELL32.137]
1159 BOOL WINAPI DAD_ShowDragImage(BOOL bShow)
1161 FIXME("0x%08x stub\n",bShow);
1165 static const WCHAR szwCabLocation[] = {
1166 'S','o','f','t','w','a','r','e','\\',
1167 'M','i','c','r','o','s','o','f','t','\\',
1168 'W','i','n','d','o','w','s','\\',
1169 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
1170 'E','x','p','l','o','r','e','r','\\',
1171 'C','a','b','i','n','e','t','S','t','a','t','e',0
1174 static const WCHAR szwSettings[] = { 'S','e','t','t','i','n','g','s',0 };
1176 /*************************************************************************
1177 * ReadCabinetState [SHELL32.651] NT 4.0
1180 BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length)
1185 TRACE("%p %d\n", cs, length);
1187 if( (cs == NULL) || (length < (int)sizeof(*cs)) )
1190 r = RegOpenKeyW( HKEY_CURRENT_USER, szwCabLocation, &hkey );
1191 if( r == ERROR_SUCCESS )
1194 r = RegQueryValueExW( hkey, szwSettings,
1195 NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
1196 RegCloseKey( hkey );
1200 /* if we can't read from the registry, create default values */
1201 if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
1202 (cs->cLength != length) )
1204 ERR("Initializing shell cabinet settings\n");
1205 memset(cs, 0, sizeof(*cs));
1206 cs->cLength = sizeof(*cs);
1208 cs->fFullPathTitle = FALSE;
1209 cs->fSaveLocalView = TRUE;
1210 cs->fNotShell = FALSE;
1211 cs->fSimpleDefault = TRUE;
1212 cs->fDontShowDescBar = FALSE;
1213 cs->fNewWindowMode = FALSE;
1214 cs->fShowCompColor = FALSE;
1215 cs->fDontPrettyNames = FALSE;
1216 cs->fAdminsCreateCommonGroups = TRUE;
1217 cs->fMenuEnumFilter = 96;
1223 /*************************************************************************
1224 * WriteCabinetState [SHELL32.652] NT 4.0
1227 BOOL WINAPI WriteCabinetState(CABINETSTATE *cs)
1237 r = RegCreateKeyExW( HKEY_CURRENT_USER, szwCabLocation, 0,
1238 NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
1239 if( r == ERROR_SUCCESS )
1241 r = RegSetValueExW( hkey, szwSettings, 0,
1242 REG_BINARY, (LPBYTE) cs, cs->cLength);
1244 RegCloseKey( hkey );
1247 return (r==ERROR_SUCCESS);
1250 /*************************************************************************
1251 * FileIconInit [SHELL32.660]
1254 BOOL WINAPI FileIconInit(BOOL bFullInit)
1255 { FIXME("(%s)\n", bFullInit ? "true" : "false");
1258 /*************************************************************************
1259 * IsUserAdmin [SHELL32.680] NT 4.0
1262 HRESULT WINAPI IsUserAdmin(void)
1267 /*************************************************************************
1268 * SHAllocShared [SHELL32.520]
1270 * See shlwapi.SHAllocShared
1272 HANDLE WINAPI SHAllocShared(LPVOID lpvData, DWORD dwSize, DWORD dwProcId)
1274 GET_FUNC(pSHAllocShared, shlwapi, (char*)7, NULL);
1275 return pSHAllocShared(lpvData, dwSize, dwProcId);
1278 /*************************************************************************
1279 * SHLockShared [SHELL32.521]
1281 * See shlwapi.SHLockShared
1283 LPVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId)
1285 GET_FUNC(pSHLockShared, shlwapi, (char*)8, NULL);
1286 return pSHLockShared(hShared, dwProcId);
1289 /*************************************************************************
1290 * SHUnlockShared [SHELL32.522]
1292 * See shlwapi.SHUnlockShared
1294 BOOL WINAPI SHUnlockShared(LPVOID lpView)
1296 GET_FUNC(pSHUnlockShared, shlwapi, (char*)9, FALSE);
1297 return pSHUnlockShared(lpView);
1300 /*************************************************************************
1301 * SHFreeShared [SHELL32.523]
1303 * See shlwapi.SHFreeShared
1305 BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId)
1307 GET_FUNC(pSHFreeShared, shlwapi, (char*)10, FALSE);
1308 return pSHFreeShared(hShared, dwProcId);
1311 /*************************************************************************
1312 * SetAppStartingCursor [SHELL32.99]
1314 HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
1315 { FIXME("hwnd=%p 0x%04x stub\n",u,v );
1319 /*************************************************************************
1320 * SHLoadOLE [SHELL32.151]
1322 * To reduce the memory usage of Windows 95 it's shell32 contained an
1323 * internal implementation of a part of COM (see e.g. SHGetMalloc, SHCoCreateInstance,
1324 * SHRegisterDragDrop etc.) that allowed to use in-process STA objects without
1325 * the need to load OLE32.DLL. If OLE32.DLL was already loaded, the SH* function
1326 * would just call the Co* functions.
1328 * The SHLoadOLE was called when OLE32.DLL was being loaded to transfer all the
1329 * informations from the shell32 "mini-COM" to ole32.dll.
1331 * See http://blogs.msdn.com/oldnewthing/archive/2004/07/05/173226.aspx for a
1332 * detailed description.
1334 * Under wine ole32.dll is always loaded as it is imported by shlwapi.dll which is
1335 * imported by shell32 and no "mini-COM" is used (except for the "LoadWithoutCOM"
1336 * hack in SHCoCreateInstance)
1338 HRESULT WINAPI SHLoadOLE(LPARAM lParam)
1339 { FIXME("0x%08lx stub\n",lParam);
1342 /*************************************************************************
1343 * DriveType [SHELL32.64]
1346 HRESULT WINAPI DriveType(DWORD u)
1347 { FIXME("0x%04x stub\n",u);
1350 /*************************************************************************
1351 * InvalidateDriveType [SHELL32.65]
1354 int WINAPI InvalidateDriveType(int u)
1355 { FIXME("0x%08x stub\n",u);
1358 /*************************************************************************
1359 * SHAbortInvokeCommand [SHELL32.198]
1362 HRESULT WINAPI SHAbortInvokeCommand(void)
1366 /*************************************************************************
1367 * SHOutOfMemoryMessageBox [SHELL32.126]
1370 int WINAPI SHOutOfMemoryMessageBox(
1375 FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
1378 /*************************************************************************
1379 * SHFlushClipboard [SHELL32.121]
1382 HRESULT WINAPI SHFlushClipboard(void)
1387 /*************************************************************************
1388 * SHWaitForFileToOpen [SHELL32.97]
1391 BOOL WINAPI SHWaitForFileToOpen(
1396 FIXME("%p 0x%08x 0x%08x stub\n", pidl, dwFlags, dwTimeout);
1400 /************************************************************************
1404 * first parameter seems to be a pointer (same as passed to WriteCabinetState)
1405 * second one could be a size (0x0c). The size is the same as the structure saved to
1406 * HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState
1407 * I'm (js) guessing: this one is just ReadCabinetState ;-)
1409 HRESULT WINAPI shell32_654 (CABINETSTATE *cs, int length)
1411 TRACE("%p %d\n",cs,length);
1412 return ReadCabinetState(cs,length);
1415 /************************************************************************
1416 * RLBuildListOfPaths [SHELL32.146]
1421 DWORD WINAPI RLBuildListOfPaths (void)
1425 /************************************************************************
1426 * SHValidateUNC [SHELL32.173]
1429 HRESULT WINAPI SHValidateUNC (DWORD x, DWORD y, DWORD z)
1431 FIXME("0x%08x 0x%08x 0x%08x stub\n",x,y,z);
1435 /************************************************************************
1436 * DoEnvironmentSubstA [SHELL32.@]
1438 * Replace %KEYWORD% in the str with the value of variable KEYWORD
1439 * from environment. If it is not found the %KEYWORD% is left
1440 * intact. If the buffer is too small, str is not modified.
1443 * pszString [I] '\0' terminated string with %keyword%.
1444 * [O] '\0' terminated string with %keyword% substituted.
1445 * cchString [I] size of str.
1448 * cchString length in the HIWORD;
1449 * TRUE in LOWORD if subst was successful and FALSE in other case
1451 DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
1455 FIXME("(%s, %d) stub\n", debugstr_a(pszString), cchString);
1456 if (pszString == NULL) /* Really return 0? */
1458 if ((dst = HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(CHAR))))
1460 DWORD num = ExpandEnvironmentStringsA(pszString, dst, cchString);
1461 if (num && num < cchString) /* dest buffer is too small */
1464 memcpy(pszString, dst, num);
1466 HeapFree(GetProcessHeap(), 0, dst);
1468 return MAKELONG(res,cchString); /* Always cchString? */
1471 /************************************************************************
1472 * DoEnvironmentSubstW [SHELL32.@]
1474 * See DoEnvironmentSubstA.
1476 DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString)
1478 FIXME("(%s, %d): stub\n", debugstr_w(pszString), cchString);
1479 return MAKELONG(FALSE,cchString);
1482 /************************************************************************
1483 * DoEnvironmentSubst [SHELL32.53]
1485 * See DoEnvironmentSubstA.
1487 DWORD WINAPI DoEnvironmentSubstAW(LPVOID x, UINT y)
1489 if (SHELL_OsIsUnicode())
1490 return DoEnvironmentSubstW(x, y);
1491 return DoEnvironmentSubstA(x, y);
1494 /*************************************************************************
1497 * Win98+ by-ordinal routine. In Win98 this routine returns zero and
1498 * does nothing else. Possibly this does something in NT or SHELL32 5.0?
1502 BOOL WINAPI shell32_243(DWORD a, DWORD b)
1507 /*************************************************************************
1510 DWORD WINAPI SHELL32_714(LPVOID x)
1512 FIXME("(%s)stub\n", debugstr_w(x));
1516 /*************************************************************************
1517 * SHAddFromPropSheetExtArray [SHELL32.167]
1519 DWORD WINAPI SHAddFromPropSheetExtArray(DWORD a, DWORD b, DWORD c)
1521 FIXME("(%08x,%08x,%08x)stub\n", a, b, c);
1525 /*************************************************************************
1526 * SHCreatePropSheetExtArray [SHELL32.168]
1528 DWORD WINAPI SHCreatePropSheetExtArray(DWORD a, LPCSTR b, DWORD c)
1530 FIXME("(%08x,%s,%08x)stub\n", a, debugstr_a(b), c);
1534 /*************************************************************************
1535 * SHReplaceFromPropSheetExtArray [SHELL32.170]
1537 DWORD WINAPI SHReplaceFromPropSheetExtArray(DWORD a, DWORD b, DWORD c, DWORD d)
1539 FIXME("(%08x,%08x,%08x,%08x)stub\n", a, b, c, d);
1543 /*************************************************************************
1544 * SHDestroyPropSheetExtArray [SHELL32.169]
1546 DWORD WINAPI SHDestroyPropSheetExtArray(DWORD a)
1548 FIXME("(%08x)stub\n", a);
1552 /*************************************************************************
1553 * CIDLData_CreateFromIDArray [SHELL32.83]
1555 * Create IDataObject from PIDLs??
1557 HRESULT WINAPI CIDLData_CreateFromIDArray(
1558 LPCITEMIDLIST pidlFolder,
1560 LPCITEMIDLIST *lppidlFiles,
1561 LPDATAOBJECT *ppdataObject)
1564 HWND hwnd = 0; /*FIXME: who should be hwnd of owner? set to desktop */
1566 TRACE("(%p, %d, %p, %p)\n", pidlFolder, cpidlFiles, lppidlFiles, ppdataObject);
1570 for (i=0; i<cpidlFiles; i++) pdump (lppidlFiles[i]);
1572 *ppdataObject = IDataObject_Constructor( hwnd, pidlFolder,
1573 lppidlFiles, cpidlFiles);
1574 if (*ppdataObject) return S_OK;
1575 return E_OUTOFMEMORY;
1578 /*************************************************************************
1579 * SHCreateStdEnumFmtEtc [SHELL32.74]
1584 HRESULT WINAPI SHCreateStdEnumFmtEtc(
1586 const FORMATETC *lpFormats,
1587 LPENUMFORMATETC *ppenumFormatetc)
1589 IEnumFORMATETC *pef;
1591 TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
1593 pef = IEnumFORMATETC_Constructor(cFormats, lpFormats);
1595 return E_OUTOFMEMORY;
1597 IEnumFORMATETC_AddRef(pef);
1598 hRes = IEnumFORMATETC_QueryInterface(pef, &IID_IEnumFORMATETC, (LPVOID*)ppenumFormatetc);
1599 IEnumFORMATETC_Release(pef);
1605 /*************************************************************************
1606 * SHELL32_256 (SHELL32.256)
1608 HRESULT WINAPI SHELL32_256(LPDWORD lpdw0, LPDWORD lpdw1)
1612 FIXME("stub %p 0x%08x %p\n", lpdw0, lpdw0 ? *lpdw0 : 0, lpdw1);
1614 if (!lpdw0 || *lpdw0 != 0x10)
1618 LPVOID lpdata = 0;/*LocalAlloc(LMEM_ZEROINIT, 0x4E4);*/
1621 ret = E_OUTOFMEMORY;
1624 /* Initialize and return unknown lpdata structure */
1631 /*************************************************************************
1632 * SHFindFiles (SHELL32.90)
1634 BOOL WINAPI SHFindFiles( LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile )
1636 FIXME("%p %p\n", pidlFolder, pidlSaveFile );
1640 /*************************************************************************
1641 * SHUpdateImageW (SHELL32.192)
1643 * Notifies the shell that an icon in the system image list has been changed.
1646 * pszHashItem [I] Path to file that contains the icon.
1647 * iIndex [I] Zero-based index of the icon in the file.
1648 * uFlags [I] Flags determining the icon attributes. See notes.
1649 * iImageIndex [I] Index of the icon in the system image list.
1655 * uFlags can be one or more of the following flags:
1656 * GIL_NOTFILENAME - pszHashItem is not a file name.
1657 * GIL_SIMULATEDOC - Create a document icon using the specified icon.
1659 void WINAPI SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex)
1661 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_w(pszHashItem), iIndex, uFlags, iImageIndex);
1664 /*************************************************************************
1665 * SHUpdateImageA (SHELL32.191)
1667 * See SHUpdateImageW.
1669 VOID WINAPI SHUpdateImageA(LPCSTR pszHashItem, INT iIndex, UINT uFlags, INT iImageIndex)
1671 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem), iIndex, uFlags, iImageIndex);
1674 INT WINAPI SHHandleUpdateImage(LPCITEMIDLIST pidlExtra)
1676 FIXME("%p - stub\n", pidlExtra);
1681 BOOL WINAPI SHObjectProperties(HWND hwnd, DWORD dwType, LPCWSTR szObject, LPCWSTR szPage)
1683 FIXME("%p, 0x%08x, %s, %s - stub\n", hwnd, dwType, debugstr_w(szObject), debugstr_w(szPage));
1688 BOOL WINAPI SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy,
1691 FIXME("%s, %s, %p, %p, 0x%08x - stub\n", debugstr_a(pszLinkTo), debugstr_a(pszDir),
1692 pszName, pfMustCopy, uFlags);
1697 BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy,
1700 FIXME("%s, %s, %p, %p, 0x%08x - stub\n", debugstr_w(pszLinkTo), debugstr_w(pszDir),
1701 pszName, pfMustCopy, uFlags);
1706 HRESULT WINAPI SHStartNetConnectionDialog(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType)
1708 FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
1713 HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags)
1715 FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRootPath), dwFlags);
1720 HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
1722 FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_w(pszRootPath), dwFlags);
1727 DWORD WINAPI SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
1729 FIXME("%p, 0x%08x, 0x%08x, 0x%08x - stub\n", hwnd, drive, fmtID, options);
1731 return SHFMT_NOFORMAT;
1734 HRESULT WINAPI SHQueryRecycleBinA(LPCSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo)
1736 FIXME("%s, %p - stub\n", debugstr_a(pszRootPath), pSHQueryRBInfo);
1738 pSHQueryRBInfo->i64Size = 0;
1739 pSHQueryRBInfo->i64NumItems = 0;
1744 HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo)
1746 FIXME("%s, %p - stub\n", debugstr_w(pszRootPath), pSHQueryRBInfo);
1748 pSHQueryRBInfo->i64Size = 0;
1749 pSHQueryRBInfo->i64NumItems = 0;
1754 /*************************************************************************
1755 * SHSetLocalizedName (SHELL32.@)
1757 HRESULT WINAPI SHSetLocalizedName(LPWSTR pszPath, LPCWSTR pszResModule, int idsRes)
1759 FIXME("%p, %s, %d - stub\n", pszPath, debugstr_w(pszResModule), idsRes);