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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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%08lx,%p,%ld) 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%08lx,%p,%ld) 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, %ld, %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%08lx 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%08lx)\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%08lx):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
, pszTemp
;
355 va_start(args
, uType
);
356 /* wvsprintfA(buf,fmt, args); */
358 TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
359 (DWORD
)hInstance
,(DWORD
)hWnd
,lpText
,lpCaption
,uType
);
361 if (!HIWORD(lpCaption
))
362 LoadStringW(hInstance
, (DWORD
)lpCaption
, szTitle
, sizeof(szTitle
)/sizeof(szTitle
[0]));
364 pszTitle
= lpCaption
;
367 LoadStringW(hInstance
, (DWORD
)lpText
, szText
, sizeof(szText
)/sizeof(szText
[0]));
371 FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_STRING
,
372 pszText
, 0, 0, (LPWSTR
)&pszTemp
, 0, &args
);
376 ret
= MessageBoxW(hWnd
,pszTemp
,pszTitle
,uType
);
377 LocalFree((HLOCAL
)pszTemp
);
381 /*************************************************************************
382 * ShellMessageBoxA [SHELL32.183]
384 * Format and output an error message.
387 * hInstance [I] Instance handle of message creator
388 * hWnd [I] Window handle of message creator
389 * lpText [I] Resource Id of title or LPSTR
390 * lpCaption [I] Resource Id of title or LPSTR
391 * uType [I] Type of error message
394 * A return value from MessageBoxA().
397 * Exported by ordinal
399 int WINAPIV
ShellMessageBoxA(
407 char szText
[100],szTitle
[100];
408 LPCSTR pszText
= szText
, pszTitle
= szTitle
, pszTemp
;
412 va_start(args
, uType
);
413 /* wvsprintfA(buf,fmt, args); */
415 TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
416 (DWORD
)hInstance
,(DWORD
)hWnd
,lpText
,lpCaption
,uType
);
418 if (!HIWORD(lpCaption
))
419 LoadStringA(hInstance
, (DWORD
)lpCaption
, szTitle
, sizeof(szTitle
));
421 pszTitle
= lpCaption
;
424 LoadStringA(hInstance
, (DWORD
)lpText
, szText
, sizeof(szText
));
428 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_STRING
,
429 pszText
, 0, 0, (LPSTR
)&pszTemp
, 0, &args
);
433 ret
= MessageBoxA(hWnd
,pszTemp
,pszTitle
,uType
);
434 LocalFree((HLOCAL
)pszTemp
);
438 /*************************************************************************
439 * SHRegisterDragDrop [SHELL32.86]
442 * exported by ordinal
444 HRESULT WINAPI
SHRegisterDragDrop(
446 LPDROPTARGET pDropTarget
)
448 FIXME("(%p,%p):stub.\n", hWnd
, pDropTarget
);
449 return RegisterDragDrop(hWnd
, pDropTarget
);
452 /*************************************************************************
453 * SHRevokeDragDrop [SHELL32.87]
456 * exported by ordinal
458 HRESULT WINAPI
SHRevokeDragDrop(HWND hWnd
)
460 FIXME("(%p):stub.\n",hWnd
);
461 return RevokeDragDrop(hWnd
);
464 /*************************************************************************
465 * SHDoDragDrop [SHELL32.88]
468 * exported by ordinal
470 HRESULT WINAPI
SHDoDragDrop(
472 LPDATAOBJECT lpDataObject
,
473 LPDROPSOURCE lpDropSource
,
477 FIXME("(%p %p %p 0x%08lx %p):stub.\n",
478 hWnd
, lpDataObject
, lpDropSource
, dwOKEffect
, pdwEffect
);
479 return DoDragDrop(lpDataObject
, lpDropSource
, dwOKEffect
, pdwEffect
);
482 /*************************************************************************
483 * ArrangeWindows [SHELL32.184]
486 WORD WINAPI
ArrangeWindows(
493 FIXME("(%p 0x%08lx %p 0x%04x %p):stub.\n",
494 hwndParent
, dwReserved
, lpRect
, cKids
, lpKids
);
498 /*************************************************************************
499 * SignalFileOpen [SHELL32.103]
502 * exported by ordinal
505 SignalFileOpen (DWORD dwParam1
)
507 FIXME("(0x%08lx):stub.\n", dwParam1
);
512 /*************************************************************************
513 * SHADD_get_policy - helper function for SHAddToRecentDocs
516 * policy [IN] policy name (null termed string) to find
517 * type [OUT] ptr to DWORD to receive type
518 * buffer [OUT] ptr to area to hold data retrieved
519 * len [IN/OUT] ptr to DWORD holding size of buffer and getting
523 * result of the SHQueryValueEx call
525 static INT
SHADD_get_policy(LPSTR policy
, LPDWORD type
, LPVOID buffer
, LPDWORD len
)
530 /* Get the key for the policies location in the registry
532 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
533 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
534 0, KEY_READ
, &Policy_basekey
)) {
536 if (RegOpenKeyExA(HKEY_CURRENT_USER
,
537 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
538 0, KEY_READ
, &Policy_basekey
)) {
539 TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
542 return ERROR_FILE_NOT_FOUND
;
546 /* Retrieve the data if it exists
548 ret
= SHQueryValueExA(Policy_basekey
, policy
, 0, type
, buffer
, len
);
549 RegCloseKey(Policy_basekey
);
554 /*************************************************************************
555 * SHADD_compare_mru - helper function for SHAddToRecentDocs
558 * data1 [IN] data being looked for
559 * data2 [IN] data in MRU
560 * cbdata [IN] length from FindMRUData call (not used)
563 * position within MRU list that data was added.
565 static INT CALLBACK
SHADD_compare_mru(LPCVOID data1
, LPCVOID data2
, DWORD cbData
)
567 return lstrcmpiA(data1
, data2
);
570 /*************************************************************************
571 * SHADD_create_add_mru_data - helper function for SHAddToRecentDocs
574 * mruhandle [IN] handle for created MRU list
575 * doc_name [IN] null termed pure doc name
576 * new_lnk_name [IN] null termed path and file name for .lnk file
577 * buffer [IN/OUT] 2048 byte area to construct MRU data
578 * len [OUT] ptr to int to receive space used in buffer
581 * position within MRU list that data was added.
583 static INT
SHADD_create_add_mru_data(HANDLE mruhandle
, LPSTR doc_name
, LPSTR new_lnk_name
,
584 LPSTR buffer
, INT
*len
)
590 * RecentDocs MRU data structure seems to be:
591 * +0h document file name w/ terminating 0h
592 * +nh short int w/ size of remaining
593 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
594 * +n+4h 10 bytes zeros - unknown
595 * +n+eh shortcut file name w/ terminating 0h
596 * +n+e+nh 3 zero bytes - unknown
599 /* Create the MRU data structure for "RecentDocs"
602 lstrcpyA(ptr
, doc_name
);
603 ptr
+= (lstrlenA(buffer
) + 1);
604 wlen
= lstrlenA(new_lnk_name
) + 1 + 12;
605 *((short int*)ptr
) = wlen
;
606 ptr
+= 2; /* step past the length */
607 *(ptr
++) = 0x30; /* unknown reason */
608 *(ptr
++) = 0; /* unknown, but can be 0x00, 0x01, 0x02 */
611 lstrcpyA(ptr
, new_lnk_name
);
612 ptr
+= (lstrlenA(new_lnk_name
) + 1);
617 /* Add the new entry into the MRU list
619 return AddMRUData(mruhandle
, (LPCVOID
)buffer
, *len
);
622 /*************************************************************************
623 * SHAddToRecentDocs [SHELL32.@]
626 * uFlags [IN] SHARD_PATH or SHARD_PIDL
627 * pv [IN] string or pidl, NULL clears the list
632 void WINAPI
SHAddToRecentDocs (UINT uFlags
,LPCVOID pv
)
634 /* If list is a string list lpfnCompare has the following prototype
635 * int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
636 * for binary lists the prototype is
637 * int CALLBACK MRUCompareBinary(LPCVOID data1, LPCVOID data2, DWORD cbData)
638 * where cbData is the no. of bytes to compare.
639 * Need to check what return value means identical - 0?
645 CHAR doc_name
[MAX_PATH
];
646 CHAR link_dir
[MAX_PATH
];
647 CHAR new_lnk_filepath
[MAX_PATH
];
648 CHAR new_lnk_name
[MAX_PATH
];
651 HWND hwnd
= 0; /* FIXME: get real window handle */
653 DWORD data
[64], datalen
, type
;
656 * RecentDocs MRU data structure seems to be:
657 * +0h document file name w/ terminating 0h
658 * +nh short int w/ size of remaining
659 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
660 * +n+4h 10 bytes zeros - unknown
661 * +n+eh shortcut file name w/ terminating 0h
662 * +n+e+nh 3 zero bytes - unknown
665 /* See if we need to do anything.
668 ret
=SHADD_get_policy( "NoRecentDocsHistory", &type
, &data
, &datalen
);
669 if ((ret
> 0) && (ret
!= ERROR_FILE_NOT_FOUND
)) {
670 ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret
);
673 if (ret
== ERROR_SUCCESS
) {
674 if (!( (type
== REG_DWORD
) ||
675 ((type
== REG_BINARY
) && (datalen
== 4)) )) {
676 ERR("Error policy data for \"NoRecentDocsHistory\" not formatted correctly, type=%ld, len=%ld\n",
681 TRACE("policy value for NoRecentDocsHistory = %08lx\n", data
[0]);
682 /* now test the actual policy value */
687 /* Open key to where the necessary info is
689 /* FIXME: This should be done during DLL PROCESS_ATTACH (or THREAD_ATTACH)
690 * and the close should be done during the _DETACH. The resulting
691 * key is stored in the DLL global data.
693 if (RegCreateKeyExA(HKEY_CURRENT_USER
,
694 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
695 0, 0, 0, KEY_READ
, 0, &HCUbasekey
, 0)) {
696 ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
700 /* Get path to user's "Recent" directory
702 if(SUCCEEDED(SHGetMalloc(&ppM
))) {
703 if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd
, CSIDL_RECENT
,
705 SHGetPathFromIDListA(pidl
, link_dir
);
706 IMalloc_Free(ppM
, pidl
);
711 ERR("serious issues 1\n");
713 IMalloc_Release(ppM
);
718 ERR("serious issues 2\n");
720 TRACE("Users Recent dir %s\n", link_dir
);
722 /* If no input, then go clear the lists */
724 /* clear user's Recent dir
727 /* FIXME: delete all files in "link_dir"
729 * while( more files ) {
730 * lstrcpyA(old_lnk_name, link_dir);
731 * PathAppendA(old_lnk_name, filenam);
732 * DeleteFileA(old_lnk_name);
735 FIXME("should delete all files in %s\\ \n", link_dir
);
739 /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
740 * HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
741 * and naturally it fails w/ rc=2. It should do it against
742 * HKEY_CURRENT_USER which is where it is stored, and where
743 * the MRU routines expect it!!!!
745 RegDeleteKeyA(HCUbasekey
, "RecentDocs");
746 RegCloseKey(HCUbasekey
);
750 /* Have data to add, the jobs to be done:
751 * 1. Add document to MRU list in registry "HKCU\Software\
752 * Microsoft\Windows\CurrentVersion\Explorer\RecentDocs".
753 * 2. Add shortcut to document in the user's Recent directory
755 * 3. Add shortcut to Start menu's Documents submenu.
758 /* Get the pure document name from the input
760 if (uFlags
& SHARD_PIDL
) {
761 SHGetPathFromIDListA((LPCITEMIDLIST
) pv
, doc_name
);
764 lstrcpyA(doc_name
, (LPCSTR
) pv
);
766 TRACE("full document name %s\n", doc_name
);
767 PathStripPathA(doc_name
);
768 TRACE("stripped document name %s\n", doc_name
);
771 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
774 * doc_name - pure file-spec, no path
775 * link_dir - path to the user's Recent directory
776 * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node
778 * new_lnk_name- pure file-spec, no path for new .lnk file
780 * - path and file name of new .lnk file
782 CREATEMRULISTA mymru
;
784 INT len
, pos
, bufused
, err
;
789 CHAR old_lnk_name
[MAX_PATH
];
792 mymru
.cbSize
= sizeof(CREATEMRULISTA
);
793 mymru
.nMaxItems
= 15;
794 mymru
.dwFlags
= MRUF_BINARY_LIST
| MRUF_DELAYED_SAVE
;
795 mymru
.hKey
= HCUbasekey
;
796 mymru
.lpszSubKey
= "RecentDocs";
797 mymru
.lpfnCompare
= &SHADD_compare_mru
;
798 mruhandle
= CreateMRUListA(&mymru
);
801 ERR("MRU processing failed, handle zero\n");
802 RegCloseKey(HCUbasekey
);
805 len
= lstrlenA(doc_name
);
806 pos
= FindMRUData(mruhandle
, doc_name
, len
, 0);
808 /* Now get the MRU entry that will be replaced
809 * and delete the .lnk file for it
811 if ((bufused
= EnumMRUListA(mruhandle
, (pos
== -1) ? 14 : pos
,
812 buffer
, 2048)) != -1) {
814 ptr
+= (lstrlenA(buffer
) + 1);
815 slen
= *((short int*)ptr
);
816 ptr
+= 2; /* skip the length area */
817 if (bufused
>= slen
+ (ptr
-buffer
)) {
818 /* buffer size looks good */
819 ptr
+= 12; /* get to string */
820 len
= bufused
- (ptr
-buffer
); /* get length of buf remaining */
821 if ((lstrlenA(ptr
) > 0) && (lstrlenA(ptr
) <= len
-1)) {
822 /* appears to be good string */
823 lstrcpyA(old_lnk_name
, link_dir
);
824 PathAppendA(old_lnk_name
, ptr
);
825 if (!DeleteFileA(old_lnk_name
)) {
826 if ((attr
= GetFileAttributesA(old_lnk_name
)) == INVALID_FILE_ATTRIBUTES
) {
827 if ((err
= GetLastError()) != ERROR_FILE_NOT_FOUND
) {
828 ERR("Delete for %s failed, err=%d, attr=%08lx\n",
829 old_lnk_name
, err
, attr
);
832 TRACE("old .lnk file %s did not exist\n",
837 ERR("Delete for %s failed, attr=%08lx\n",
842 TRACE("deleted old .lnk file %s\n", old_lnk_name
);
848 /* Create usable .lnk file name for the "Recent" directory
850 wsprintfA(new_lnk_name
, "%s.lnk", doc_name
);
851 lstrcpyA(new_lnk_filepath
, link_dir
);
852 PathAppendA(new_lnk_filepath
, new_lnk_name
);
854 olderrormode
= SetErrorMode(SEM_FAILCRITICALERRORS
);
855 while (GetFileAttributesA(new_lnk_filepath
) != INVALID_FILE_ATTRIBUTES
) {
857 wsprintfA(new_lnk_name
, "%s (%u).lnk", doc_name
, i
);
858 lstrcpyA(new_lnk_filepath
, link_dir
);
859 PathAppendA(new_lnk_filepath
, new_lnk_name
);
861 SetErrorMode(olderrormode
);
862 TRACE("new shortcut will be %s\n", new_lnk_filepath
);
864 /* Now add the new MRU entry and data
866 pos
= SHADD_create_add_mru_data(mruhandle
, doc_name
, new_lnk_name
,
868 FreeMRUList(mruhandle
);
869 TRACE("Updated MRU list, new doc is position %d\n", pos
);
872 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
875 * doc_name - pure file-spec, no path
877 * - path and file name of new .lnk file
878 * uFlags[in] - flags on call to SHAddToRecentDocs
879 * pv[in] - document path/pidl on call to SHAddToRecentDocs
881 IShellLinkA
*psl
= NULL
;
882 IPersistFile
*pPf
= NULL
;
885 WCHAR widelink
[MAX_PATH
];
889 hres
= CoCreateInstance( &CLSID_ShellLink
,
891 CLSCTX_INPROC_SERVER
,
894 if(SUCCEEDED(hres
)) {
896 hres
= IShellLinkA_QueryInterface(psl
, &IID_IPersistFile
,
900 ERR("failed QueryInterface for IPersistFile %08lx\n", hres
);
904 /* Set the document path or pidl */
905 if (uFlags
& SHARD_PIDL
) {
906 hres
= IShellLinkA_SetIDList(psl
, (LPCITEMIDLIST
) pv
);
908 hres
= IShellLinkA_SetPath(psl
, (LPCSTR
) pv
);
912 ERR("failed Set{IDList|Path} %08lx\n", hres
);
916 lstrcpyA(desc
, "Shortcut to ");
917 lstrcatA(desc
, doc_name
);
918 hres
= IShellLinkA_SetDescription(psl
, desc
);
921 ERR("failed SetDescription %08lx\n", hres
);
925 MultiByteToWideChar(CP_ACP
, 0, new_lnk_filepath
, -1,
927 /* create the short cut */
928 hres
= IPersistFile_Save(pPf
, widelink
, TRUE
);
931 ERR("failed IPersistFile::Save %08lx\n", hres
);
932 IPersistFile_Release(pPf
);
933 IShellLinkA_Release(psl
);
936 hres
= IPersistFile_SaveCompleted(pPf
, widelink
);
937 IPersistFile_Release(pPf
);
938 IShellLinkA_Release(psl
);
939 TRACE("shortcut %s has been created, result=%08lx\n",
940 new_lnk_filepath
, hres
);
943 ERR("CoCreateInstance failed, hres=%08lx\n", hres
);
951 RegCloseKey(HCUbasekey
);
955 /*************************************************************************
956 * SHCreateShellFolderViewEx [SHELL32.174]
959 * see IShellFolder::CreateViewObject
961 HRESULT WINAPI
SHCreateShellFolderViewEx(
962 LPCSFV psvcbi
, /* [in] shelltemplate struct */
963 IShellView
**ppv
) /* [out] IShellView pointer */
968 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
969 psvcbi
->pshf
, psvcbi
->pidl
, psvcbi
->pfnCallback
,
970 psvcbi
->fvm
, psvcbi
->psvOuter
);
972 psf
= IShellView_Constructor(psvcbi
->pshf
);
975 return E_OUTOFMEMORY
;
977 IShellView_AddRef(psf
);
978 hRes
= IShellView_QueryInterface(psf
, &IID_IShellView
, (LPVOID
*)ppv
);
979 IShellView_Release(psf
);
983 /*************************************************************************
984 * SHWinHelp [SHELL32.127]
987 HRESULT WINAPI
SHWinHelp (DWORD v
, DWORD w
, DWORD x
, DWORD z
)
988 { FIXME("0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v
,w
,x
,z
);
991 /*************************************************************************
992 * SHRunControlPanel [SHELL32.161]
995 HRESULT WINAPI
SHRunControlPanel (DWORD x
, DWORD z
)
996 { FIXME("0x%08lx 0x%08lx stub\n",x
,z
);
1000 static LPUNKNOWN SHELL32_IExplorerInterface
=0;
1001 /*************************************************************************
1002 * SHSetInstanceExplorer [SHELL32.176]
1005 * Sets the interface
1007 HRESULT WINAPI
SHSetInstanceExplorer (LPUNKNOWN lpUnknown
)
1008 { TRACE("%p\n", lpUnknown
);
1009 SHELL32_IExplorerInterface
= lpUnknown
;
1010 return (HRESULT
) lpUnknown
;
1012 /*************************************************************************
1013 * SHGetInstanceExplorer [SHELL32.@]
1016 * gets the interface pointer of the explorer and a reference
1018 HRESULT WINAPI
SHGetInstanceExplorer (LPUNKNOWN
* lpUnknown
)
1019 { TRACE("%p\n", lpUnknown
);
1021 *lpUnknown
= SHELL32_IExplorerInterface
;
1023 if (!SHELL32_IExplorerInterface
)
1026 IUnknown_AddRef(SHELL32_IExplorerInterface
);
1029 /*************************************************************************
1030 * SHFreeUnusedLibraries [SHELL32.123]
1035 void WINAPI
SHFreeUnusedLibraries (void)
1039 /*************************************************************************
1040 * DAD_AutoScroll [SHELL32.129]
1043 BOOL WINAPI
DAD_AutoScroll(HWND hwnd
, AUTO_SCROLL_DATA
*samples
, LPPOINT pt
)
1045 FIXME("hwnd = %p %p %p\n",hwnd
,samples
,pt
);
1048 /*************************************************************************
1049 * DAD_DragEnter [SHELL32.130]
1052 BOOL WINAPI
DAD_DragEnter(HWND hwnd
)
1054 FIXME("hwnd = %p\n",hwnd
);
1057 /*************************************************************************
1058 * DAD_DragEnterEx [SHELL32.131]
1061 BOOL WINAPI
DAD_DragEnterEx(HWND hwnd
, POINT p
)
1063 FIXME("hwnd = %p (%ld,%ld)\n",hwnd
,p
.x
,p
.y
);
1066 /*************************************************************************
1067 * DAD_DragMove [SHELL32.134]
1070 BOOL WINAPI
DAD_DragMove(POINT p
)
1072 FIXME("(%ld,%ld)\n",p
.x
,p
.y
);
1075 /*************************************************************************
1076 * DAD_DragLeave [SHELL32.132]
1079 BOOL WINAPI
DAD_DragLeave(VOID
)
1084 /*************************************************************************
1085 * DAD_SetDragImage [SHELL32.136]
1090 BOOL WINAPI
DAD_SetDragImage(
1091 HIMAGELIST himlTrack
,
1094 FIXME("%p %p stub\n",himlTrack
, lppt
);
1097 /*************************************************************************
1098 * DAD_ShowDragImage [SHELL32.137]
1103 BOOL WINAPI
DAD_ShowDragImage(BOOL bShow
)
1105 FIXME("0x%08x stub\n",bShow
);
1109 static const WCHAR szwCabLocation
[] = {
1110 'S','o','f','t','w','a','r','e','\\',
1111 'M','i','c','r','o','s','o','f','t','\\',
1112 'W','i','n','d','o','w','s','\\',
1113 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
1114 'E','x','p','l','o','r','e','r','\\',
1115 'C','a','b','i','n','e','t','S','t','a','t','e',0
1118 static const WCHAR szwSettings
[] = { 'S','e','t','t','i','n','g','s',0 };
1120 /*************************************************************************
1121 * ReadCabinetState [SHELL32.651] NT 4.0
1124 BOOL WINAPI
ReadCabinetState(CABINETSTATE
*cs
, int length
)
1129 TRACE("%p %d \n",cs
,length
);
1131 if( (cs
== NULL
) || (length
< (int)sizeof(*cs
)) )
1134 r
= RegOpenKeyW( HKEY_CURRENT_USER
, szwCabLocation
, &hkey
);
1135 if( r
== ERROR_SUCCESS
)
1138 r
= RegQueryValueExW( hkey
, szwSettings
,
1139 NULL
, &type
, (LPBYTE
)cs
, (LPDWORD
)&length
);
1140 RegCloseKey( hkey
);
1144 /* if we can't read from the registry, create default values */
1145 if ( (r
!= ERROR_SUCCESS
) || (cs
->cLength
< sizeof(*cs
)) ||
1146 (cs
->cLength
!= length
) )
1148 ERR("Initializing shell cabinet settings\n");
1149 memset(cs
, 0, sizeof(*cs
));
1150 cs
->cLength
= sizeof(*cs
);
1152 cs
->fFullPathTitle
= FALSE
;
1153 cs
->fSaveLocalView
= TRUE
;
1154 cs
->fNotShell
= FALSE
;
1155 cs
->fSimpleDefault
= TRUE
;
1156 cs
->fDontShowDescBar
= FALSE
;
1157 cs
->fNewWindowMode
= FALSE
;
1158 cs
->fShowCompColor
= FALSE
;
1159 cs
->fDontPrettyNames
= FALSE
;
1160 cs
->fAdminsCreateCommonGroups
= TRUE
;
1161 cs
->fMenuEnumFilter
= 96;
1167 /*************************************************************************
1168 * WriteCabinetState [SHELL32.652] NT 4.0
1171 BOOL WINAPI
WriteCabinetState(CABINETSTATE
*cs
)
1181 r
= RegCreateKeyExW( HKEY_CURRENT_USER
, szwCabLocation
, 0,
1182 NULL
, 0, KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
1183 if( r
== ERROR_SUCCESS
)
1185 r
= RegSetValueExW( hkey
, szwSettings
, 0,
1186 REG_BINARY
, (LPBYTE
) cs
, cs
->cLength
);
1188 RegCloseKey( hkey
);
1191 return (r
==ERROR_SUCCESS
);
1194 /*************************************************************************
1195 * FileIconInit [SHELL32.660]
1198 BOOL WINAPI
FileIconInit(BOOL bFullInit
)
1199 { FIXME("(%s)\n", bFullInit
? "true" : "false");
1202 /*************************************************************************
1203 * IsUserAdmin [SHELL32.680] NT 4.0
1206 HRESULT WINAPI
IsUserAdmin(void)
1211 /*************************************************************************
1212 * SHAllocShared [SHELL32.520]
1214 * See shlwapi.SHAllocShared
1216 HANDLE WINAPI
SHAllocShared(LPVOID lpvData
, DWORD dwSize
, DWORD dwProcId
)
1218 GET_FUNC(pSHAllocShared
, shlwapi
, (char*)7, NULL
);
1219 return pSHAllocShared(lpvData
, dwSize
, dwProcId
);
1222 /*************************************************************************
1223 * SHLockShared [SHELL32.521]
1225 * See shlwapi.SHLockShared
1227 LPVOID WINAPI
SHLockShared(HANDLE hShared
, DWORD dwProcId
)
1229 GET_FUNC(pSHLockShared
, shlwapi
, (char*)8, NULL
);
1230 return pSHLockShared(hShared
, dwProcId
);
1233 /*************************************************************************
1234 * SHUnlockShared [SHELL32.522]
1236 * See shlwapi.SHUnlockShared
1238 BOOL WINAPI
SHUnlockShared(LPVOID lpView
)
1240 GET_FUNC(pSHUnlockShared
, shlwapi
, (char*)9, FALSE
);
1241 return pSHUnlockShared(lpView
);
1244 /*************************************************************************
1245 * SHFreeShared [SHELL32.523]
1247 * See shlwapi.SHFreeShared
1249 BOOL WINAPI
SHFreeShared(HANDLE hShared
, DWORD dwProcId
)
1251 GET_FUNC(pSHFreeShared
, shlwapi
, (char*)10, FALSE
);
1252 return pSHFreeShared(hShared
, dwProcId
);
1255 /*************************************************************************
1256 * SetAppStartingCursor [SHELL32.99]
1258 HRESULT WINAPI
SetAppStartingCursor(HWND u
, DWORD v
)
1259 { FIXME("hwnd=%p 0x%04lx stub\n",u
,v
);
1262 /*************************************************************************
1263 * SHLoadOLE [SHELL32.151]
1266 HRESULT WINAPI
SHLoadOLE(LPARAM lParam
)
1267 { FIXME("0x%04lx stub\n",lParam
);
1270 /*************************************************************************
1271 * DriveType [SHELL32.64]
1274 HRESULT WINAPI
DriveType(DWORD u
)
1275 { FIXME("0x%04lx stub\n",u
);
1278 /*************************************************************************
1279 * SHAbortInvokeCommand [SHELL32.198]
1282 HRESULT WINAPI
SHAbortInvokeCommand(void)
1286 /*************************************************************************
1287 * SHOutOfMemoryMessageBox [SHELL32.126]
1290 int WINAPI
SHOutOfMemoryMessageBox(
1295 FIXME("%p %s 0x%08x stub\n",hwndOwner
, lpCaption
, uType
);
1298 /*************************************************************************
1299 * SHFlushClipboard [SHELL32.121]
1302 HRESULT WINAPI
SHFlushClipboard(void)
1307 /*************************************************************************
1308 * SHWaitForFileToOpen [SHELL32.97]
1311 BOOL WINAPI
SHWaitForFileToOpen(
1316 FIXME("%p 0x%08lx 0x%08lx stub\n", pidl
, dwFlags
, dwTimeout
);
1320 /************************************************************************
1323 * NOTES: first parameter seems to be a pointer (same as passed to WriteCabinetState)
1324 * second one could be a size (0x0c). The size is the same as the structure saved to
1325 * HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState
1326 * I'm (js) guessing: this one is just ReadCabinetState ;-)
1328 HRESULT WINAPI
shell32_654 (CABINETSTATE
*cs
, int length
)
1330 TRACE("%p %d\n",cs
,length
);
1331 return ReadCabinetState(cs
,length
);
1334 /************************************************************************
1335 * RLBuildListOfPaths [SHELL32.146]
1340 DWORD WINAPI
RLBuildListOfPaths (void)
1344 /************************************************************************
1345 * SHValidateUNC [SHELL32.173]
1348 HRESULT WINAPI
SHValidateUNC (DWORD x
, DWORD y
, DWORD z
)
1350 FIXME("0x%08lx 0x%08lx 0x%08lx stub\n",x
,y
,z
);
1354 /************************************************************************
1355 * DoEnvironmentSubstA [SHELL32.@]
1357 * Replace %KEYWORD% in the str with the value of variable KEYWORD
1358 * from environment. If it is not found the %KEYWORD% is left
1359 * intact. If the buffer is too small, str is not modified.
1361 * pszString [I] '\0' terminated string with %keyword%.
1362 * [O] '\0' terminated string with %keyword% substituted.
1363 * cchString [I] size of str.
1366 * cchString length in the HIWORD;
1367 * TRUE in LOWORD if subst was successful and FALSE in other case
1369 DWORD WINAPI
DoEnvironmentSubstA(LPSTR pszString
, UINT cchString
)
1373 FIXME("(%s, %d) stub\n", debugstr_a(pszString
), cchString
);
1374 if (pszString
== NULL
) /* Really return 0? */
1376 if ((dst
= HeapAlloc(GetProcessHeap(), 0, cchString
* sizeof(CHAR
))))
1378 DWORD num
= ExpandEnvironmentStringsA(pszString
, dst
, cchString
);
1379 if (num
&& num
< cchString
) /* dest buffer is too small */
1382 memcpy(pszString
, dst
, num
);
1384 HeapFree(GetProcessHeap(), 0, dst
);
1386 return MAKELONG(res
,cchString
); /* Always cchString? */
1389 /************************************************************************
1390 * DoEnvironmentSubstW [SHELL32.@]
1393 DWORD WINAPI
DoEnvironmentSubstW(LPWSTR pszString
, UINT cchString
)
1395 FIXME("(%s, %d): stub\n", debugstr_w(pszString
), cchString
);
1396 return MAKELONG(FALSE
,cchString
);
1399 /************************************************************************
1400 * DoEnvironmentSubst [SHELL32.53]
1403 DWORD WINAPI
DoEnvironmentSubstAW(LPVOID x
, UINT y
)
1405 if (SHELL_OsIsUnicode())
1406 return DoEnvironmentSubstW(x
, y
);
1407 return DoEnvironmentSubstA(x
, y
);
1410 /*************************************************************************
1413 * Win98+ by-ordinal routine. In Win98 this routine returns zero and
1414 * does nothing else. Possibly this does something in NT or SHELL32 5.0?
1418 BOOL WINAPI
shell32_243(DWORD a
, DWORD b
)
1423 /*************************************************************************
1426 DWORD WINAPI
SHELL32_714(LPVOID x
)
1428 FIXME("(%s)stub\n", debugstr_w(x
));
1432 /*************************************************************************
1433 * SHAddFromPropSheetExtArray [SHELL32.167]
1435 DWORD WINAPI
SHAddFromPropSheetExtArray(DWORD a
, DWORD b
, DWORD c
)
1437 FIXME("(%08lx,%08lx,%08lx)stub\n", a
, b
, c
);
1441 /*************************************************************************
1442 * SHCreatePropSheetExtArray [SHELL32.168]
1444 DWORD WINAPI
SHCreatePropSheetExtArray(DWORD a
, LPCSTR b
, DWORD c
)
1446 FIXME("(%08lx,%s,%08lx)stub\n", a
, debugstr_a(b
), c
);
1450 /*************************************************************************
1451 * SHReplaceFromPropSheetExtArray [SHELL32.170]
1453 DWORD WINAPI
SHReplaceFromPropSheetExtArray(DWORD a
, DWORD b
, DWORD c
, DWORD d
)
1455 FIXME("(%08lx,%08lx,%08lx,%08lx)stub\n", a
, b
, c
, d
);
1459 /*************************************************************************
1460 * SHDestroyPropSheetExtArray [SHELL32.169]
1462 DWORD WINAPI
SHDestroyPropSheetExtArray(DWORD a
)
1464 FIXME("(%08lx)stub\n", a
);
1468 /*************************************************************************
1469 * CIDLData_CreateFromIDArray [SHELL32.83]
1471 * Create IDataObject from PIDLs??
1473 HRESULT WINAPI
CIDLData_CreateFromIDArray(
1474 LPCITEMIDLIST pidlFolder
,
1476 LPCITEMIDLIST
*lppidlFiles
,
1477 LPDATAOBJECT
*ppdataObject
)
1480 HWND hwnd
= 0; /*FIXME: who should be hwnd of owner? set to desktop */
1482 TRACE("(%p, %ld, %p, %p)\n", pidlFolder
, cpidlFiles
, lppidlFiles
, ppdataObject
);
1486 for (i
=0; i
<cpidlFiles
; i
++) pdump (lppidlFiles
[i
]);
1488 *ppdataObject
= IDataObject_Constructor( hwnd
, pidlFolder
,
1489 lppidlFiles
, cpidlFiles
);
1490 if (*ppdataObject
) return S_OK
;
1491 return E_OUTOFMEMORY
;
1494 /*************************************************************************
1495 * SHCreateStdEnumFmtEtc [SHELL32.74]
1500 HRESULT WINAPI
SHCreateStdEnumFmtEtc(
1502 const FORMATETC
*lpFormats
,
1503 LPENUMFORMATETC
*ppenumFormatetc
)
1505 IEnumFORMATETC
*pef
;
1507 TRACE("cf=%ld fe=%p pef=%p\n", cFormats
, lpFormats
, ppenumFormatetc
);
1509 pef
= IEnumFORMATETC_Constructor(cFormats
, lpFormats
);
1511 return E_OUTOFMEMORY
;
1513 IEnumFORMATETC_AddRef(pef
);
1514 hRes
= IEnumFORMATETC_QueryInterface(pef
, &IID_IEnumFORMATETC
, (LPVOID
*)ppenumFormatetc
);
1515 IEnumFORMATETC_Release(pef
);
1521 /*************************************************************************
1522 * SHELL32_256 (SHELL32.256)
1524 HRESULT WINAPI
SHELL32_256(LPDWORD lpdw0
, LPDWORD lpdw1
)
1528 FIXME("stub %p 0x%08lx %p\n", lpdw0
, lpdw0
? *lpdw0
: 0, lpdw1
);
1530 if (!lpdw0
|| *lpdw0
!= 0x10)
1534 LPVOID lpdata
= 0;/*LocalAlloc(LMEM_ZEROINIT, 0x4E4);*/
1537 ret
= E_OUTOFMEMORY
;
1540 /* Initialize and return unknown lpdata structure */
1547 /*************************************************************************
1548 * SHFindFiles (SHELL32.90)
1550 BOOL WINAPI
SHFindFiles( LPCITEMIDLIST pidlFolder
, LPCITEMIDLIST pidlSaveFile
)
1552 FIXME("%p %p\n", pidlFolder
, pidlSaveFile
);
1556 /*************************************************************************
1557 * SHUpdateImageW (SHELL32.192)
1559 * Notifies the shell that an icon in the system image list has been changed.
1562 * pszHashItem [I] Path to file that contains the icon.
1563 * iIndex [I] Zero-based index of the icon in the file.
1564 * uFlags [I] Flags determining the icon attributes. See notes.
1565 * iImageIndex [I] Index of the icon in the system image list.
1568 * uFlags can be one or more of the following flags:
1569 * GIL_NOTFILENAME - pszHashItem is not a file name.
1570 * GIL_SIMULATEDOC - Create a document icon using the specified icon.
1572 void WINAPI
SHUpdateImageW(LPCWSTR pszHashItem
, int iIndex
, UINT uFlags
, int iImageIndex
)
1574 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_w(pszHashItem
), iIndex
, uFlags
, iImageIndex
);
1577 VOID WINAPI
SHUpdateImageA(LPCSTR pszHashItem
, INT iIndex
, UINT uFlags
, INT iImageIndex
)
1579 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem
), iIndex
, uFlags
, iImageIndex
);
1582 INT WINAPI
SHHandleUpdateImage(LPCITEMIDLIST pidlExtra
)
1584 FIXME("%p - stub\n", pidlExtra
);
1589 BOOL WINAPI
SHObjectProperties(HWND hwnd
, DWORD dwType
, LPCWSTR szObject
, LPCWSTR szPage
)
1591 FIXME("%p, 0x%08lx, %s, %s - stub\n", hwnd
, dwType
, debugstr_w(szObject
), debugstr_w(szPage
));
1596 BOOL WINAPI
SHGetNewLinkInfoA(LPCSTR pszLinkTo
, LPCSTR pszDir
, LPSTR pszName
, BOOL
*pfMustCopy
,
1599 FIXME("%s, %s, %p, %p, 0x%08x - stub\n", debugstr_a(pszLinkTo
), debugstr_a(pszDir
),
1600 pszName
, pfMustCopy
, uFlags
);
1605 BOOL WINAPI
SHGetNewLinkInfoW(LPCWSTR pszLinkTo
, LPCWSTR pszDir
, LPWSTR pszName
, BOOL
*pfMustCopy
,
1608 FIXME("%s, %s, %p, %p, 0x%08x - stub\n", debugstr_w(pszLinkTo
), debugstr_w(pszDir
),
1609 pszName
, pfMustCopy
, uFlags
);
1614 HRESULT WINAPI
SHStartNetConnectionDialog(HWND hwnd
, LPCSTR pszRemoteName
, DWORD dwType
)
1616 FIXME("%p, %s, 0x%08lx - stub\n", hwnd
, debugstr_a(pszRemoteName
), dwType
);
1621 HRESULT WINAPI
SHEmptyRecycleBinA(HWND hwnd
, LPCSTR pszRootPath
, DWORD dwFlags
)
1623 FIXME("%p, %s, 0x%08lx - stub\n", hwnd
, debugstr_a(pszRootPath
), dwFlags
);
1628 HRESULT WINAPI
SHEmptyRecycleBinW(HWND hwnd
, LPCWSTR pszRootPath
, DWORD dwFlags
)
1630 FIXME("%p, %s, 0x%08lx - stub\n", hwnd
, debugstr_w(pszRootPath
), dwFlags
);
1635 DWORD WINAPI
SHFormatDrive(HWND hwnd
, UINT drive
, UINT fmtID
, UINT options
)
1637 FIXME("%p, 0x%08x, 0x%08x, 0x%08x - stub\n", hwnd
, drive
, fmtID
, options
);
1639 return SHFMT_NOFORMAT
;
1642 HRESULT WINAPI
SHQueryRecycleBinA(LPCSTR pszRootPath
, LPSHQUERYRBINFO pSHQueryRBInfo
)
1644 FIXME("%s, %p - stub\n", debugstr_a(pszRootPath
), pSHQueryRBInfo
);
1646 pSHQueryRBInfo
->i64Size
= 0;
1647 pSHQueryRBInfo
->i64NumItems
= 0;
1652 HRESULT WINAPI
SHQueryRecycleBinW(LPCWSTR pszRootPath
, LPSHQUERYRBINFO pSHQueryRBInfo
)
1654 FIXME("%s, %p - stub\n", debugstr_w(pszRootPath
), pSHQueryRBInfo
);
1656 pSHQueryRBInfo
->i64Size
= 0;
1657 pSHQueryRBInfo
->i64NumItems
= 0;