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
25 WINE_DEFAULT_DEBUG_CHANNEL(shell
);
26 WINE_DECLARE_DEBUG_CHANNEL(pidl
);
28 /* FIXME: !!! move flags to header file !!! */
30 #define MRUF_STRING_LIST 0 /* list will contain strings */
31 #define MRUF_BINARY_LIST 1 /* list will contain binary data */
32 #define MRUF_DELAYED_SAVE 2 /* only save list order to reg. is FreeMRUList */
34 EXTERN_C HANDLE WINAPI
CreateMRUListA(LPCREATEMRULISTA lpcml
);
35 EXTERN_C INT WINAPI
AddMRUData(HANDLE hList
, LPCVOID lpData
, DWORD cbData
);
36 EXTERN_C INT WINAPI
FindMRUData(HANDLE hList
, LPCVOID lpData
, DWORD cbData
, LPINT lpRegNum
);
37 EXTERN_C INT WINAPI
EnumMRUListA(HANDLE hList
, INT nItemPos
, LPVOID lpBuffer
, DWORD nBufferSize
);
40 /* Get a function pointer from a DLL handle */
41 #define GET_FUNC(func, funcType, module, name, fail) \
44 if (!SHELL32_h##module && !(SHELL32_h##module = LoadLibraryA(#module ".dll"))) return fail; \
45 func = (funcType)GetProcAddress(SHELL32_h##module, name); \
46 if (!func) return fail; \
50 /* Function pointers for GET_FUNC macro */
51 static HMODULE SHELL32_hshlwapi
=NULL
;
54 /*************************************************************************
55 * ParseFieldA [internal]
57 * copies a field from a ',' delimited string
59 * first field is nField = 1
61 DWORD WINAPI
ParseFieldA(
67 WARN("(%s,0x%08x,%p,%d) semi-stub.\n",debugstr_a(src
),nField
,dst
,len
);
69 if (!src
|| !src
[0] || !dst
|| !len
)
72 /* skip n fields delimited by ',' */
75 if (*src
=='\0') return FALSE
;
76 if (*(src
++)==',') nField
--;
79 /* copy part till the next ',' to dst */
80 while ( *src
!='\0' && *src
!=',' && (len
--)>0 ) *(dst
++)=*(src
++);
82 /* finalize the string */
88 /*************************************************************************
89 * ParseFieldW [internal]
91 * copies a field from a ',' delimited string
93 * first field is nField = 1
95 DWORD WINAPI
ParseFieldW(LPCWSTR src
, DWORD nField
, LPWSTR dst
, DWORD len
)
97 WARN("(%s,0x%08x,%p,%d) semi-stub.\n", debugstr_w(src
), nField
, dst
, len
);
99 if (!src
|| !src
[0] || !dst
|| !len
)
102 /* skip n fields delimited by ',' */
105 if (*src
== 0x0) return FALSE
;
106 if (*src
++ == ',') nField
--;
109 /* copy part till the next ',' to dst */
110 while ( *src
!= 0x0 && *src
!= ',' && (len
--)>0 ) *(dst
++) = *(src
++);
112 /* finalize the string */
118 /*************************************************************************
119 * ParseField [SHELL32.58]
121 EXTERN_C DWORD WINAPI
ParseFieldAW(LPCVOID src
, DWORD nField
, LPVOID dst
, DWORD len
)
123 if (SHELL_OsIsUnicode())
124 return ParseFieldW((LPCWSTR
)src
, nField
, (LPWSTR
)dst
, len
);
125 return ParseFieldA((LPCSTR
)src
, nField
, (LPSTR
)dst
, len
);
128 /*************************************************************************
129 * GetFileNameFromBrowse [SHELL32.63]
132 BOOL WINAPI
GetFileNameFromBrowse(
136 LPCWSTR lpstrInitialDir
,
141 typedef BOOL (WINAPI
*GetOpenFileNameProc
)(OPENFILENAMEW
*ofn
);
143 GetOpenFileNameProc pGetOpenFileNameW
;
147 TRACE("%p, %s, %d, %s, %s, %s, %s)\n",
148 hwndOwner
, debugstr_w(lpstrFile
), nMaxFile
, lpstrInitialDir
, lpstrDefExt
,
149 lpstrFilter
, lpstrTitle
);
151 hmodule
= LoadLibraryW(L
"comdlg32.dll");
152 if(!hmodule
) return FALSE
;
153 pGetOpenFileNameW
= (GetOpenFileNameProc
)GetProcAddress(hmodule
, "GetOpenFileNameW");
154 if(!pGetOpenFileNameW
)
156 FreeLibrary(hmodule
);
160 memset(&ofn
, 0, sizeof(ofn
));
162 ofn
.lStructSize
= sizeof(ofn
);
163 ofn
.hwndOwner
= hwndOwner
;
164 ofn
.lpstrFilter
= lpstrFilter
;
165 ofn
.lpstrFile
= lpstrFile
;
166 ofn
.nMaxFile
= nMaxFile
;
167 ofn
.lpstrInitialDir
= lpstrInitialDir
;
168 ofn
.lpstrTitle
= lpstrTitle
;
169 ofn
.lpstrDefExt
= lpstrDefExt
;
170 ofn
.Flags
= OFN_EXPLORER
| OFN_HIDEREADONLY
| OFN_FILEMUSTEXIST
;
171 ret
= pGetOpenFileNameW(&ofn
);
173 FreeLibrary(hmodule
);
177 /*************************************************************************
178 * SHGetSetSettings [SHELL32.68]
180 EXTERN_C VOID WINAPI
SHGetSetSettings(LPSHELLSTATE lpss
, DWORD dwMask
, BOOL bSet
)
184 FIXME("%p 0x%08x TRUE\n", lpss
, dwMask
);
188 SHGetSettings((LPSHELLFLAGSTATE
)lpss
,dwMask
);
192 /*************************************************************************
193 * SHGetSettings [SHELL32.@]
196 * the registry path are for win98 (tested)
197 * and possibly are the same in nt40
200 EXTERN_C VOID WINAPI
SHGetSettings(LPSHELLFLAGSTATE lpsfs
, DWORD dwMask
)
204 DWORD dwDataSize
= sizeof (DWORD
);
206 TRACE("(%p 0x%08x)\n",lpsfs
,dwMask
);
208 if (RegCreateKeyExA(HKEY_CURRENT_USER
, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
209 0, 0, 0, KEY_ALL_ACCESS
, 0, &hKey
, 0))
212 if ( (SSF_SHOWEXTENSIONS
& dwMask
) && !RegQueryValueExA(hKey
, "HideFileExt", 0, 0, (LPBYTE
)&dwData
, &dwDataSize
))
213 lpsfs
->fShowExtensions
= ((dwData
== 0) ? 0 : 1);
215 if ( (SSF_SHOWINFOTIP
& dwMask
) && !RegQueryValueExA(hKey
, "ShowInfoTip", 0, 0, (LPBYTE
)&dwData
, &dwDataSize
))
216 lpsfs
->fShowInfoTip
= ((dwData
== 0) ? 0 : 1);
218 if ( (SSF_DONTPRETTYPATH
& dwMask
) && !RegQueryValueExA(hKey
, "DontPrettyPath", 0, 0, (LPBYTE
)&dwData
, &dwDataSize
))
219 lpsfs
->fDontPrettyPath
= ((dwData
== 0) ? 0 : 1);
221 if ( (SSF_HIDEICONS
& dwMask
) && !RegQueryValueExA(hKey
, "HideIcons", 0, 0, (LPBYTE
)&dwData
, &dwDataSize
))
222 lpsfs
->fHideIcons
= ((dwData
== 0) ? 0 : 1);
224 if ( (SSF_MAPNETDRVBUTTON
& dwMask
) && !RegQueryValueExA(hKey
, "MapNetDrvBtn", 0, 0, (LPBYTE
)&dwData
, &dwDataSize
))
225 lpsfs
->fMapNetDrvBtn
= ((dwData
== 0) ? 0 : 1);
227 if ( (SSF_SHOWATTRIBCOL
& dwMask
) && !RegQueryValueExA(hKey
, "ShowAttribCol", 0, 0, (LPBYTE
)&dwData
, &dwDataSize
))
228 lpsfs
->fShowAttribCol
= ((dwData
== 0) ? 0 : 1);
230 if (((SSF_SHOWALLOBJECTS
| SSF_SHOWSYSFILES
) & dwMask
) && !RegQueryValueExA(hKey
, "Hidden", 0, 0, (LPBYTE
)&dwData
, &dwDataSize
))
232 { if (SSF_SHOWALLOBJECTS
& dwMask
) lpsfs
->fShowAllObjects
= 0;
233 if (SSF_SHOWSYSFILES
& dwMask
) lpsfs
->fShowSysFiles
= 0;
235 else if (dwData
== 1)
236 { if (SSF_SHOWALLOBJECTS
& dwMask
) lpsfs
->fShowAllObjects
= 1;
237 if (SSF_SHOWSYSFILES
& dwMask
) lpsfs
->fShowSysFiles
= 0;
239 else if (dwData
== 2)
240 { if (SSF_SHOWALLOBJECTS
& dwMask
) lpsfs
->fShowAllObjects
= 0;
241 if (SSF_SHOWSYSFILES
& dwMask
) lpsfs
->fShowSysFiles
= 1;
246 TRACE("-- 0x%04x\n", *(WORD
*)lpsfs
);
249 /*************************************************************************
250 * SHShellFolderView_Message [SHELL32.73]
252 * Send a message to an explorer cabinet window.
255 * hwndCabinet [I] The window containing the shellview to communicate with
256 * dwMessage [I] The SFVM message to send
257 * dwParam [I] Message parameter
263 * Message SFVM_REARRANGE = 1
265 * This message gets sent when a column gets clicked to instruct the
266 * shell view to re-sort the item list. dwParam identifies the column
269 LRESULT WINAPI
SHShellFolderView_Message(
274 FIXME("%p %08x %08lx stub\n",hwndCabinet
, uMessage
, lParam
);
278 /*************************************************************************
279 * RegisterShellHook [SHELL32.181]
281 * Register a shell hook.
284 * hwnd [I] Window handle
285 * dwType [I] Type of hook.
288 * Exported by ordinal
290 BOOL WINAPI
RegisterShellHook(
294 FIXME("(%p,0x%08x):stub.\n",hWnd
, dwType
);
298 /*************************************************************************
299 * ShellMessageBoxW [SHELL32.182]
301 * See ShellMessageBoxA.
304 * shlwapi.ShellMessageBoxWrapW is a duplicate of shell32.ShellMessageBoxW
305 * because we can't forward to it in the .spec file since it's exported by
306 * ordinal. If you change the implementation here please update the code in
309 EXTERN_C
int WINAPI
ShellMessageBoxW(
317 WCHAR szText
[100],szTitle
[100];
318 LPCWSTR pszText
= szText
, pszTitle
= szTitle
;
323 va_start(args
, uType
);
324 /* wvsprintfA(buf,fmt, args); */
326 TRACE("(%p,%p,%p,%p,%08x)\n",
327 hInstance
,hWnd
,lpText
,lpCaption
,uType
);
329 if (IS_INTRESOURCE(lpCaption
))
330 LoadStringW(hInstance
, LOWORD(lpCaption
), szTitle
, sizeof(szTitle
)/sizeof(szTitle
[0]));
332 pszTitle
= lpCaption
;
334 if (IS_INTRESOURCE(lpText
))
335 LoadStringW(hInstance
, LOWORD(lpText
), szText
, sizeof(szText
)/sizeof(szText
[0]));
339 FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_STRING
,
340 pszText
, 0, 0, (LPWSTR
)&pszTemp
, 0, &args
);
344 ret
= MessageBoxW(hWnd
,pszTemp
,pszTitle
,uType
);
349 /*************************************************************************
350 * ShellMessageBoxA [SHELL32.183]
352 * Format and output an error message.
355 * hInstance [I] Instance handle of message creator
356 * hWnd [I] Window handle of message creator
357 * lpText [I] Resource Id of title or LPSTR
358 * lpCaption [I] Resource Id of title or LPSTR
359 * uType [I] Type of error message
362 * A return value from MessageBoxA().
365 * Exported by ordinal
367 EXTERN_C
int WINAPI
ShellMessageBoxA(
375 char szText
[100],szTitle
[100];
376 LPCSTR pszText
= szText
, pszTitle
= szTitle
;
381 va_start(args
, uType
);
382 /* wvsprintfA(buf,fmt, args); */
384 TRACE("(%p,%p,%p,%p,%08x)\n",
385 hInstance
,hWnd
,lpText
,lpCaption
,uType
);
387 if (IS_INTRESOURCE(lpCaption
))
388 LoadStringA(hInstance
, LOWORD(lpCaption
), szTitle
, sizeof(szTitle
));
390 pszTitle
= lpCaption
;
392 if (IS_INTRESOURCE(lpText
))
393 LoadStringA(hInstance
, LOWORD(lpText
), szText
, sizeof(szText
));
397 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_STRING
,
398 pszText
, 0, 0, (LPSTR
)&pszTemp
, 0, &args
);
402 ret
= MessageBoxA(hWnd
,pszTemp
,pszTitle
,uType
);
407 /*************************************************************************
408 * SHRegisterDragDrop [SHELL32.86]
410 * Probably equivalent to RegisterDragDrop but under Windows 95 it could use the
411 * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
412 * for details. Under Windows 98 this function initializes the true OLE when called
413 * the first time, on XP always returns E_OUTOFMEMORY and it got removed from Vista.
417 * exported by ordinal
420 * RegisterDragDrop, SHLoadOLE
422 HRESULT WINAPI
SHRegisterDragDrop(
424 LPDROPTARGET pDropTarget
)
426 FIXME("(%p,%p):stub.\n", hWnd
, pDropTarget
);
427 return RegisterDragDrop(hWnd
, pDropTarget
);
430 /*************************************************************************
431 * SHRevokeDragDrop [SHELL32.87]
433 * Probably equivalent to RevokeDragDrop but under Windows 9x it could use the
434 * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
435 * for details. Function removed from Windows Vista.
438 * exported by ordinal
441 * RevokeDragDrop, SHLoadOLE
443 HRESULT WINAPI
SHRevokeDragDrop(HWND hWnd
)
445 FIXME("(%p):stub.\n",hWnd
);
446 return RevokeDragDrop(hWnd
);
449 /*************************************************************************
450 * SHDoDragDrop [SHELL32.88]
452 * Probably equivalent to DoDragDrop but under Windows 9x it could use the
453 * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
457 * exported by ordinal
460 * DoDragDrop, SHLoadOLE
462 HRESULT WINAPI
SHDoDragDrop(
464 LPDATAOBJECT lpDataObject
,
465 LPDROPSOURCE lpDropSource
,
469 FIXME("(%p %p %p 0x%08x %p):stub.\n",
470 hWnd
, lpDataObject
, lpDropSource
, dwOKEffect
, pdwEffect
);
471 return DoDragDrop(lpDataObject
, lpDropSource
, dwOKEffect
, pdwEffect
);
474 /*************************************************************************
475 * ArrangeWindows [SHELL32.184]
478 WORD WINAPI
ArrangeWindows(
485 /* Unimplemented in WinXP SP3 */
486 TRACE("(%p 0x%08x %p 0x%04x %p):stub.\n",
487 hwndParent
, dwReserved
, lpRect
, cKids
, lpKids
);
491 /*************************************************************************
492 * SignalFileOpen [SHELL32.103]
495 * exported by ordinal
498 SignalFileOpen (LPCITEMIDLIST pidl
)
500 FIXME("(0x%08x):stub.\n", pidl
);
505 /*************************************************************************
506 * SHADD_get_policy - helper function for SHAddToRecentDocs
509 * policy [IN] policy name (null termed string) to find
510 * type [OUT] ptr to DWORD to receive type
511 * buffer [OUT] ptr to area to hold data retrieved
512 * len [IN/OUT] ptr to DWORD holding size of buffer and getting
516 * result of the SHQueryValueEx call
518 static INT
SHADD_get_policy(LPCSTR policy
, LPDWORD type
, LPVOID buffer
, LPDWORD len
)
523 /* Get the key for the policies location in the registry
525 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
526 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
527 0, KEY_READ
, &Policy_basekey
)) {
529 if (RegOpenKeyExA(HKEY_CURRENT_USER
,
530 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
531 0, KEY_READ
, &Policy_basekey
)) {
532 TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
535 return ERROR_FILE_NOT_FOUND
;
539 /* Retrieve the data if it exists
541 ret
= SHQueryValueExA(Policy_basekey
, policy
, 0, type
, buffer
, len
);
542 RegCloseKey(Policy_basekey
);
547 /*************************************************************************
548 * SHADD_compare_mru - helper function for SHAddToRecentDocs
551 * data1 [IN] data being looked for
552 * data2 [IN] data in MRU
553 * cbdata [IN] length from FindMRUData call (not used)
556 * position within MRU list that data was added.
558 static INT CALLBACK
SHADD_compare_mru(LPCVOID data1
, LPCVOID data2
, DWORD cbData
)
560 return lstrcmpiA((LPCSTR
)data1
, (LPCSTR
)data2
);
563 /*************************************************************************
564 * SHADD_create_add_mru_data - helper function for SHAddToRecentDocs
567 * mruhandle [IN] handle for created MRU list
568 * doc_name [IN] null termed pure doc name
569 * new_lnk_name [IN] null termed path and file name for .lnk file
570 * buffer [IN/OUT] 2048 byte area to construct MRU data
571 * len [OUT] ptr to int to receive space used in buffer
574 * position within MRU list that data was added.
576 static INT
SHADD_create_add_mru_data(HANDLE mruhandle
, LPCSTR doc_name
, LPCSTR new_lnk_name
,
577 LPSTR buffer
, INT
*len
)
583 * RecentDocs MRU data structure seems to be:
584 * +0h document file name w/ terminating 0h
585 * +nh short int w/ size of remaining
586 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
587 * +n+4h 10 bytes zeros - unknown
588 * +n+eh shortcut file name w/ terminating 0h
589 * +n+e+nh 3 zero bytes - unknown
592 /* Create the MRU data structure for "RecentDocs"
595 lstrcpyA(ptr
, doc_name
);
596 ptr
+= (lstrlenA(buffer
) + 1);
597 wlen
= lstrlenA(new_lnk_name
) + 1 + 12;
598 *((short int*)ptr
) = wlen
;
599 ptr
+= 2; /* step past the length */
600 *(ptr
++) = 0x30; /* unknown reason */
601 *(ptr
++) = 0; /* unknown, but can be 0x00, 0x01, 0x02 */
604 lstrcpyA(ptr
, new_lnk_name
);
605 ptr
+= (lstrlenA(new_lnk_name
) + 1);
610 /* Add the new entry into the MRU list
612 return AddMRUData(mruhandle
, buffer
, *len
);
615 /*************************************************************************
616 * SHAddToRecentDocs [SHELL32.@]
618 * Modify (add/clear) Shell's list of recently used documents.
621 * uFlags [IN] SHARD_PATHA, SHARD_PATHW or SHARD_PIDL
622 * pv [IN] string or pidl, NULL clears the list
630 void WINAPI
SHAddToRecentDocs (UINT uFlags
,LPCVOID pv
)
632 /* If list is a string list lpfnCompare has the following prototype
633 * int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
634 * for binary lists the prototype is
635 * int CALLBACK MRUCompareBinary(LPCVOID data1, LPCVOID data2, DWORD cbData)
636 * where cbData is the no. of bytes to compare.
637 * Need to check what return value means identical - 0?
643 CHAR doc_name
[MAX_PATH
];
644 CHAR link_dir
[MAX_PATH
];
645 CHAR new_lnk_filepath
[MAX_PATH
];
646 CHAR new_lnk_name
[MAX_PATH
];
648 CComPtr
<IMalloc
> ppM
;
650 HWND hwnd
= 0; /* FIXME: get real window handle */
652 DWORD data
[64], datalen
, type
;
654 TRACE("%04x %p\n", uFlags
, pv
);
657 * RecentDocs MRU data structure seems to be:
658 * +0h document file name w/ terminating 0h
659 * +nh short int w/ size of remaining
660 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
661 * +n+4h 10 bytes zeros - unknown
662 * +n+eh shortcut file name w/ terminating 0h
663 * +n+e+nh 3 zero bytes - unknown
666 /* See if we need to do anything.
669 ret
=SHADD_get_policy( "NoRecentDocsHistory", &type
, data
, &datalen
);
670 if ((ret
> 0) && (ret
!= ERROR_FILE_NOT_FOUND
)) {
671 ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret
);
674 if (ret
== ERROR_SUCCESS
) {
675 if (!( (type
== REG_DWORD
) ||
676 ((type
== REG_BINARY
) && (datalen
== 4)) )) {
677 ERR("Error policy data for \"NoRecentDocsHistory\" not formatted correctly, type=%d, len=%d\n",
682 TRACE("policy value for NoRecentDocsHistory = %08x\n", data
[0]);
683 /* now test the actual policy value */
688 /* Open key to where the necessary info is
690 /* FIXME: This should be done during DLL PROCESS_ATTACH (or THREAD_ATTACH)
691 * and the close should be done during the _DETACH. The resulting
692 * key is stored in the DLL global data.
694 if (RegCreateKeyExA(HKEY_CURRENT_USER
,
695 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
696 0, 0, 0, KEY_READ
, 0, &HCUbasekey
, 0)) {
697 ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
701 /* Get path to user's "Recent" directory
703 if(SUCCEEDED(SHGetMalloc(&ppM
))) {
704 if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd
, CSIDL_RECENT
,
706 SHGetPathFromIDListA(pidl
, link_dir
);
712 ERR("serious issues 1\n");
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
763 SHGetPathFromIDListA((LPCITEMIDLIST
)pv
, doc_name
);
767 lstrcpynA(doc_name
, (LPCSTR
)pv
, MAX_PATH
);
771 WideCharToMultiByte(CP_ACP
, 0, (LPCWSTR
)pv
, -1, doc_name
, MAX_PATH
, NULL
, NULL
);
775 FIXME("Unsupported flags: %u\n", uFlags
);
779 TRACE("full document name %s\n", debugstr_a(doc_name
));
781 /* check if file is a shortcut */
782 ext
= strrchr(doc_name
, '.');
783 if (!lstrcmpiA(ext
, ".lnk"))
785 CComPtr
<IShellLinkA
> ShellLink
;
786 IShellLink_ConstructFromFile(NULL
, IID_IShellLinkA
, (LPCITEMIDLIST
)SHSimpleIDListFromPathA(doc_name
), (LPVOID
*)&ShellLink
);
787 ShellLink
->GetPath(doc_name
, MAX_PATH
, NULL
, 0);
790 ext
= strrchr(doc_name
, '.');
791 if (!lstrcmpiA(ext
, ".exe"))
793 /* executables are not added */
797 PathStripPathA(doc_name
);
798 TRACE("stripped document name %s\n", debugstr_a(doc_name
));
801 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
804 * doc_name - pure file-spec, no path
805 * link_dir - path to the user's Recent directory
806 * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node
808 * new_lnk_name- pure file-spec, no path for new .lnk file
810 * - path and file name of new .lnk file
812 CREATEMRULISTA mymru
;
814 INT len
, pos
, bufused
, err
;
819 CHAR old_lnk_name
[MAX_PATH
];
822 mymru
.cbSize
= sizeof(CREATEMRULISTA
);
823 mymru
.nMaxItems
= 15;
824 mymru
.dwFlags
= MRUF_BINARY_LIST
| MRUF_DELAYED_SAVE
;
825 mymru
.hKey
= HCUbasekey
;
826 mymru
.lpszSubKey
= "RecentDocs";
827 mymru
.lpfnCompare
= (PROC
)SHADD_compare_mru
;
828 mruhandle
= CreateMRUListA(&mymru
);
831 ERR("MRU processing failed, handle zero\n");
832 RegCloseKey(HCUbasekey
);
835 len
= lstrlenA(doc_name
);
836 pos
= FindMRUData(mruhandle
, doc_name
, len
, 0);
838 /* Now get the MRU entry that will be replaced
839 * and delete the .lnk file for it
841 if ((bufused
= EnumMRUListA(mruhandle
, (pos
== -1) ? 14 : pos
,
842 buffer
, 2048)) != -1) {
844 ptr
+= (lstrlenA(buffer
) + 1);
845 slen
= *((short int*)ptr
);
846 ptr
+= 2; /* skip the length area */
847 if (bufused
>= slen
+ (ptr
-buffer
)) {
848 /* buffer size looks good */
849 ptr
+= 12; /* get to string */
850 len
= bufused
- (ptr
-buffer
); /* get length of buf remaining */
851 if ((lstrlenA(ptr
) > 0) && (lstrlenA(ptr
) <= len
-1)) {
852 /* appears to be good string */
853 lstrcpyA(old_lnk_name
, link_dir
);
854 PathAppendA(old_lnk_name
, ptr
);
855 if (!DeleteFileA(old_lnk_name
)) {
856 if ((attr
= GetFileAttributesA(old_lnk_name
)) == INVALID_FILE_ATTRIBUTES
) {
857 if ((err
= GetLastError()) != ERROR_FILE_NOT_FOUND
) {
858 ERR("Delete for %s failed, err=%d, attr=%08x\n",
859 old_lnk_name
, err
, attr
);
862 TRACE("old .lnk file %s did not exist\n",
867 ERR("Delete for %s failed, attr=%08x\n",
872 TRACE("deleted old .lnk file %s\n", old_lnk_name
);
878 /* Create usable .lnk file name for the "Recent" directory
880 wsprintfA(new_lnk_name
, "%s.lnk", doc_name
);
881 lstrcpyA(new_lnk_filepath
, link_dir
);
882 PathAppendA(new_lnk_filepath
, new_lnk_name
);
884 olderrormode
= SetErrorMode(SEM_FAILCRITICALERRORS
);
885 while (GetFileAttributesA(new_lnk_filepath
) != INVALID_FILE_ATTRIBUTES
) {
887 wsprintfA(new_lnk_name
, "%s (%u).lnk", doc_name
, i
);
888 lstrcpyA(new_lnk_filepath
, link_dir
);
889 PathAppendA(new_lnk_filepath
, new_lnk_name
);
891 SetErrorMode(olderrormode
);
892 TRACE("new shortcut will be %s\n", new_lnk_filepath
);
894 /* Now add the new MRU entry and data
896 pos
= SHADD_create_add_mru_data(mruhandle
, doc_name
, new_lnk_name
,
898 FreeMRUList(mruhandle
);
899 TRACE("Updated MRU list, new doc is position %d\n", pos
);
902 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
905 * doc_name - pure file-spec, no path
907 * - path and file name of new .lnk file
908 * uFlags[in] - flags on call to SHAddToRecentDocs
909 * pv[in] - document path/pidl on call to SHAddToRecentDocs
911 CComPtr
<IShellLinkA
> psl
;
912 CComPtr
<IPersistFile
> pPf
;
915 WCHAR widelink
[MAX_PATH
];
919 hres
= CoCreateInstance(CLSID_ShellLink
,
921 CLSCTX_INPROC_SERVER
,
924 if(SUCCEEDED(hres
)) {
926 hres
= psl
->QueryInterface(IID_IPersistFile
,
930 ERR("failed QueryInterface for IPersistFile %08x\n", hres
);
934 /* Set the document path or pidl */
935 if (uFlags
== SHARD_PIDL
) {
936 hres
= psl
->SetIDList((LPCITEMIDLIST
) pv
);
938 hres
= psl
->SetPath((LPCSTR
) pv
);
942 ERR("failed Set{IDList|Path} %08x\n", hres
);
946 lstrcpyA(desc
, "Shortcut to ");
947 lstrcatA(desc
, doc_name
);
948 hres
= psl
->SetDescription(desc
);
951 ERR("failed SetDescription %08x\n", hres
);
955 MultiByteToWideChar(CP_ACP
, 0, new_lnk_filepath
, -1,
957 /* create the short cut */
958 hres
= pPf
->Save(widelink
, TRUE
);
961 ERR("failed IPersistFile::Save %08x\n", hres
);
964 hres
= pPf
->SaveCompleted(widelink
);
965 TRACE("shortcut %s has been created, result=%08x\n",
966 new_lnk_filepath
, hres
);
969 ERR("CoCreateInstance failed, hres=%08x\n", hres
);
977 RegCloseKey(HCUbasekey
);
981 /*************************************************************************
982 * SHCreateShellFolderViewEx [SHELL32.174]
984 * Create a new instance of the default Shell folder view object.
988 * Failure: error value
991 * see IShellFolder::CreateViewObject
993 HRESULT WINAPI
SHCreateShellFolderViewEx(
994 LPCSFV psvcbi
, /* [in] shelltemplate struct */
995 IShellView
**ppv
) /* [out] IShellView pointer */
1000 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
1001 psvcbi
->pshf
, psvcbi
->pidl
, psvcbi
->pfnCallback
,
1002 psvcbi
->fvm
, psvcbi
->psvOuter
);
1004 hRes
= IShellView_Constructor(psvcbi
->pshf
, &psf
);
1009 return E_OUTOFMEMORY
;
1012 hRes
= psf
->QueryInterface(IID_IShellView
, (LPVOID
*)ppv
);
1017 /*************************************************************************
1018 * SHWinHelp [SHELL32.127]
1021 EXTERN_C HRESULT WINAPI
SHWinHelp (DWORD v
, DWORD w
, DWORD x
, DWORD z
)
1022 { FIXME("0x%08x 0x%08x 0x%08x 0x%08x stub\n",v
,w
,x
,z
);
1025 /*************************************************************************
1026 * SHRunControlPanel [SHELL32.161]
1029 EXTERN_C BOOL WINAPI
SHRunControlPanel (LPCWSTR lpcszCmdLine
, HWND hwndMsgParent
)
1031 FIXME("0x%08x 0x%08x stub\n",lpcszCmdLine
,hwndMsgParent
);
1035 static LPUNKNOWN SHELL32_IExplorerInterface
=0;
1036 /*************************************************************************
1037 * SHSetInstanceExplorer [SHELL32.176]
1040 * Sets the interface
1042 VOID WINAPI
SHSetInstanceExplorer (LPUNKNOWN lpUnknown
)
1043 { TRACE("%p\n", lpUnknown
);
1044 SHELL32_IExplorerInterface
= lpUnknown
;
1046 /*************************************************************************
1047 * SHGetInstanceExplorer [SHELL32.@]
1050 * gets the interface pointer of the explorer and a reference
1052 HRESULT WINAPI
SHGetInstanceExplorer (IUnknown
**lpUnknown
)
1053 { TRACE("%p\n", lpUnknown
);
1055 *lpUnknown
= SHELL32_IExplorerInterface
;
1057 if (!SHELL32_IExplorerInterface
)
1060 SHELL32_IExplorerInterface
->AddRef();
1063 /*************************************************************************
1064 * SHFreeUnusedLibraries [SHELL32.123]
1066 * Probably equivalent to CoFreeUnusedLibraries but under Windows 9x it could use
1067 * the shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
1071 * exported by ordinal
1074 * CoFreeUnusedLibraries, SHLoadOLE
1076 void WINAPI
SHFreeUnusedLibraries (void)
1079 CoFreeUnusedLibraries();
1081 /*************************************************************************
1082 * DAD_AutoScroll [SHELL32.129]
1085 BOOL WINAPI
DAD_AutoScroll(HWND hwnd
, AUTO_SCROLL_DATA
*samples
, const POINT
* pt
)
1087 FIXME("hwnd = %p %p %p\n",hwnd
,samples
,pt
);
1090 /*************************************************************************
1091 * DAD_DragEnter [SHELL32.130]
1094 BOOL WINAPI
DAD_DragEnter(HWND hwnd
)
1096 FIXME("hwnd = %p\n",hwnd
);
1099 /*************************************************************************
1100 * DAD_DragEnterEx [SHELL32.131]
1103 BOOL WINAPI
DAD_DragEnterEx(HWND hwnd
, POINT p
)
1105 FIXME("hwnd = %p (%d,%d)\n",hwnd
,p
.x
,p
.y
);
1108 /*************************************************************************
1109 * DAD_DragMove [SHELL32.134]
1112 BOOL WINAPI
DAD_DragMove(POINT p
)
1114 FIXME("(%d,%d)\n",p
.x
,p
.y
);
1117 /*************************************************************************
1118 * DAD_DragLeave [SHELL32.132]
1121 BOOL WINAPI
DAD_DragLeave(VOID
)
1126 /*************************************************************************
1127 * DAD_SetDragImage [SHELL32.136]
1132 BOOL WINAPI
DAD_SetDragImage(
1133 HIMAGELIST himlTrack
,
1136 FIXME("%p %p stub\n",himlTrack
, lppt
);
1139 /*************************************************************************
1140 * DAD_ShowDragImage [SHELL32.137]
1145 BOOL WINAPI
DAD_ShowDragImage(BOOL bShow
)
1147 FIXME("0x%08x stub\n",bShow
);
1151 static const WCHAR szwCabLocation
[] = {
1152 'S','o','f','t','w','a','r','e','\\',
1153 'M','i','c','r','o','s','o','f','t','\\',
1154 'W','i','n','d','o','w','s','\\',
1155 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
1156 'E','x','p','l','o','r','e','r','\\',
1157 'C','a','b','i','n','e','t','S','t','a','t','e',0
1160 static const WCHAR szwSettings
[] = { 'S','e','t','t','i','n','g','s',0 };
1162 /*************************************************************************
1163 * ReadCabinetState [SHELL32.651] NT 4.0
1166 BOOL WINAPI
ReadCabinetState(CABINETSTATE
*cs
, int length
)
1171 TRACE("%p %d\n", cs
, length
);
1173 if( (cs
== NULL
) || (length
< (int)sizeof(*cs
)) )
1176 r
= RegOpenKeyW( HKEY_CURRENT_USER
, szwCabLocation
, &hkey
);
1177 if( r
== ERROR_SUCCESS
)
1180 r
= RegQueryValueExW( hkey
, szwSettings
,
1181 NULL
, &type
, (LPBYTE
)cs
, (LPDWORD
)&length
);
1182 RegCloseKey( hkey
);
1186 /* if we can't read from the registry, create default values */
1187 if ( (r
!= ERROR_SUCCESS
) || (cs
->cLength
< sizeof(*cs
)) ||
1188 (cs
->cLength
!= length
) )
1190 ERR("Initializing shell cabinet settings\n");
1191 memset(cs
, 0, sizeof(*cs
));
1192 cs
->cLength
= sizeof(*cs
);
1194 cs
->fFullPathTitle
= FALSE
;
1195 cs
->fSaveLocalView
= TRUE
;
1196 cs
->fNotShell
= FALSE
;
1197 cs
->fSimpleDefault
= TRUE
;
1198 cs
->fDontShowDescBar
= FALSE
;
1199 cs
->fNewWindowMode
= FALSE
;
1200 cs
->fShowCompColor
= FALSE
;
1201 cs
->fDontPrettyNames
= FALSE
;
1202 cs
->fAdminsCreateCommonGroups
= TRUE
;
1203 cs
->fMenuEnumFilter
= 96;
1209 /*************************************************************************
1210 * WriteCabinetState [SHELL32.652] NT 4.0
1213 BOOL WINAPI
WriteCabinetState(CABINETSTATE
*cs
)
1223 r
= RegCreateKeyExW( HKEY_CURRENT_USER
, szwCabLocation
, 0,
1224 NULL
, 0, KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
1225 if( r
== ERROR_SUCCESS
)
1227 r
= RegSetValueExW( hkey
, szwSettings
, 0,
1228 REG_BINARY
, (LPBYTE
) cs
, cs
->cLength
);
1230 RegCloseKey( hkey
);
1233 return (r
==ERROR_SUCCESS
);
1236 /*************************************************************************
1237 * FileIconInit [SHELL32.660]
1240 BOOL WINAPI
FileIconInit(BOOL bFullInit
)
1241 { FIXME("(%s)\n", bFullInit
? "true" : "false");
1245 /*************************************************************************
1246 * IsUserAnAdmin [SHELL32.680] NT 4.0
1248 * Checks whether the current user is a member of the Administrators group.
1257 BOOL WINAPI
IsUserAnAdmin(VOID
)
1259 SID_IDENTIFIER_AUTHORITY Authority
= {SECURITY_NT_AUTHORITY
};
1262 PTOKEN_GROUPS lpGroups
;
1265 BOOL bResult
= FALSE
;
1269 if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &hToken
))
1274 if (!GetTokenInformation(hToken
, TokenGroups
, NULL
, 0, &dwSize
))
1276 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER
)
1278 CloseHandle(hToken
);
1283 lpGroups
= (PTOKEN_GROUPS
)HeapAlloc(GetProcessHeap(), 0, dwSize
);
1284 if (lpGroups
== NULL
)
1286 CloseHandle(hToken
);
1290 if (!GetTokenInformation(hToken
, TokenGroups
, lpGroups
, dwSize
, &dwSize
))
1292 HeapFree(GetProcessHeap(), 0, lpGroups
);
1293 CloseHandle(hToken
);
1297 CloseHandle(hToken
);
1299 if (!AllocateAndInitializeSid(&Authority
, 2, SECURITY_BUILTIN_DOMAIN_RID
,
1300 DOMAIN_ALIAS_RID_ADMINS
, 0, 0, 0, 0, 0, 0,
1303 HeapFree(GetProcessHeap(), 0, lpGroups
);
1307 for (i
= 0; i
< lpGroups
->GroupCount
; i
++)
1309 if (EqualSid(lpSid
, lpGroups
->Groups
[i
].Sid
))
1317 HeapFree(GetProcessHeap(), 0, lpGroups
);
1321 /*************************************************************************
1322 * SHAllocShared [SHELL32.520]
1324 * See shlwapi.SHAllocShared
1326 HANDLE WINAPI
SHAllocShared(LPVOID lpvData
, DWORD dwSize
, DWORD dwProcId
)
1328 typedef HANDLE (WINAPI
*SHAllocSharedProc
)(LPCVOID
, DWORD
, DWORD
);
1329 static SHAllocSharedProc pSHAllocShared
;
1331 GET_FUNC(pSHAllocShared
, SHAllocSharedProc
, shlwapi
, (char*)7, NULL
);
1332 return pSHAllocShared(lpvData
, dwSize
, dwProcId
);
1335 /*************************************************************************
1336 * SHLockShared [SHELL32.521]
1338 * See shlwapi.SHLockShared
1340 LPVOID WINAPI
SHLockShared(HANDLE hShared
, DWORD dwProcId
)
1342 typedef HANDLE (WINAPI
*SHLockSharedProc
)(HANDLE
, DWORD
);
1343 static SHLockSharedProc pSHLockShared
;
1345 GET_FUNC(pSHLockShared
, SHLockSharedProc
, shlwapi
, (char*)8, NULL
);
1346 return pSHLockShared(hShared
, dwProcId
);
1349 /*************************************************************************
1350 * SHUnlockShared [SHELL32.522]
1352 * See shlwapi.SHUnlockShared
1354 BOOL WINAPI
SHUnlockShared(LPVOID lpView
)
1356 typedef HANDLE (WINAPI
*SHUnlockSharedProc
)(LPCVOID
);
1357 static SHUnlockSharedProc pSHUnlockShared
;
1359 GET_FUNC(pSHUnlockShared
, SHUnlockSharedProc
, shlwapi
, (char*)9, FALSE
);
1360 return pSHUnlockShared(lpView
) != NULL
;
1363 /*************************************************************************
1364 * SHFreeShared [SHELL32.523]
1366 * See shlwapi.SHFreeShared
1368 BOOL WINAPI
SHFreeShared(HANDLE hShared
, DWORD dwProcId
)
1370 typedef HANDLE (WINAPI
*SHFreeSharedProc
)(HANDLE
, DWORD
);
1371 static SHFreeSharedProc pSHFreeShared
;
1373 GET_FUNC(pSHFreeShared
, SHFreeSharedProc
, shlwapi
, (char*)10, FALSE
);
1374 return pSHFreeShared(hShared
, dwProcId
) != NULL
;
1377 /*************************************************************************
1378 * SetAppStartingCursor [SHELL32.99]
1380 EXTERN_C HRESULT WINAPI
SetAppStartingCursor(HWND u
, DWORD v
)
1381 { FIXME("hwnd=%p 0x%04x stub\n",u
,v
);
1385 /*************************************************************************
1386 * SHLoadOLE [SHELL32.151]
1388 * To reduce the memory usage of Windows 95, its shell32 contained an
1389 * internal implementation of a part of COM (see e.g. SHGetMalloc, SHCoCreateInstance,
1390 * SHRegisterDragDrop etc.) that allowed to use in-process STA objects without
1391 * the need to load OLE32.DLL. If OLE32.DLL was already loaded, the SH* function
1392 * would just call the Co* functions.
1394 * The SHLoadOLE was called when OLE32.DLL was being loaded to transfer all the
1395 * information from the shell32 "mini-COM" to ole32.dll.
1397 * See http://blogs.msdn.com/oldnewthing/archive/2004/07/05/173226.aspx for a
1398 * detailed description.
1400 * Under wine ole32.dll is always loaded as it is imported by shlwapi.dll which is
1401 * imported by shell32 and no "mini-COM" is used (except for the "LoadWithoutCOM"
1402 * hack in SHCoCreateInstance)
1404 HRESULT WINAPI
SHLoadOLE(LPARAM lParam
)
1405 { FIXME("0x%08lx stub\n",lParam
);
1408 /*************************************************************************
1409 * DriveType [SHELL32.64]
1412 EXTERN_C
int WINAPI
DriveType(int DriveType
)
1414 WCHAR root
[] = L
"A:\\";
1415 root
[0] = L
'A' + DriveType
;
1416 return GetDriveTypeW(root
);
1419 /*************************************************************************
1420 * InvalidateDriveType [SHELL32.65]
1421 * Unimplemented in XP SP3
1423 EXTERN_C
int WINAPI
InvalidateDriveType(int u
)
1425 TRACE("0x%08x stub\n",u
);
1429 /*************************************************************************
1430 * SHAbortInvokeCommand [SHELL32.198]
1433 EXTERN_C HRESULT WINAPI
SHAbortInvokeCommand(void)
1438 /*************************************************************************
1439 * SHOutOfMemoryMessageBox [SHELL32.126]
1442 int WINAPI
SHOutOfMemoryMessageBox(
1447 FIXME("%p %s 0x%08x stub\n",hwndOwner
, lpCaption
, uType
);
1451 /*************************************************************************
1452 * SHFlushClipboard [SHELL32.121]
1455 EXTERN_C HRESULT WINAPI
SHFlushClipboard(void)
1457 return OleFlushClipboard();
1460 /*************************************************************************
1461 * SHWaitForFileToOpen [SHELL32.97]
1464 BOOL WINAPI
SHWaitForFileToOpen(
1469 FIXME("%p 0x%08x 0x%08x stub\n", pidl
, dwFlags
, dwTimeout
);
1473 /************************************************************************
1474 * RLBuildListOfPaths [SHELL32.146]
1479 EXTERN_C DWORD WINAPI
RLBuildListOfPaths (void)
1484 /************************************************************************
1485 * SHValidateUNC [SHELL32.173]
1488 EXTERN_C BOOL WINAPI
SHValidateUNC (HWND hwndOwner
, LPWSTR pszFile
, UINT fConnect
)
1490 FIXME("0x%08x 0x%08x 0x%08x stub\n",hwndOwner
,pszFile
,fConnect
);
1494 /************************************************************************
1495 * DoEnvironmentSubstA [SHELL32.@]
1497 * See DoEnvironmentSubstW.
1499 EXTERN_C DWORD WINAPI
DoEnvironmentSubstA(LPSTR pszString
, UINT cchString
)
1503 DWORD len
= cchString
;
1505 TRACE("(%s, %d)\n", debugstr_a(pszString
), cchString
);
1506 if (pszString
== NULL
) /* Really return 0? */
1508 if ((dst
= (LPSTR
)HeapAlloc(GetProcessHeap(), 0, cchString
* sizeof(CHAR
))))
1510 len
= ExpandEnvironmentStringsA(pszString
, dst
, cchString
);
1511 /* len includes the terminating 0 */
1512 if (len
&& len
< cchString
)
1515 memcpy(pszString
, dst
, len
);
1520 HeapFree(GetProcessHeap(), 0, dst
);
1522 return MAKELONG(len
, res
);
1525 /************************************************************************
1526 * DoEnvironmentSubstW [SHELL32.@]
1528 * Replace all %KEYWORD% in the string with the value of the named
1529 * environment variable. If the buffer is too small, the string is not modified.
1532 * pszString [I] '\0' terminated string with %keyword%.
1533 * [O] '\0' terminated string with %keyword% substituted.
1534 * cchString [I] size of str.
1537 * Success: The string in the buffer is updated
1539 * LOWORD: characters used in the buffer, including space for the terminating 0
1540 * Failure: buffer too small. The string is not modified.
1542 * LOWORD: provided size of the buffer in characters
1544 EXTERN_C DWORD WINAPI
DoEnvironmentSubstW(LPWSTR pszString
, UINT cchString
)
1548 DWORD len
= cchString
;
1550 TRACE("(%s, %d)\n", debugstr_w(pszString
), cchString
);
1552 if ((cchString
< MAXLONG
) && (dst
= (LPWSTR
)HeapAlloc(GetProcessHeap(), 0, cchString
* sizeof(WCHAR
))))
1554 len
= ExpandEnvironmentStringsW(pszString
, dst
, cchString
);
1555 /* len includes the terminating 0 */
1556 if (len
&& len
<= cchString
)
1559 memcpy(pszString
, dst
, len
* sizeof(WCHAR
));
1564 HeapFree(GetProcessHeap(), 0, dst
);
1566 return MAKELONG(len
, res
);
1569 /************************************************************************
1570 * DoEnvironmentSubst [SHELL32.53]
1572 * See DoEnvironmentSubstA.
1574 DWORD WINAPI
DoEnvironmentSubstAW(LPVOID x
, UINT y
)
1576 if (SHELL_OsIsUnicode())
1577 return DoEnvironmentSubstW((LPWSTR
)x
, y
);
1578 return DoEnvironmentSubstA((LPSTR
)x
, y
);
1581 /*************************************************************************
1582 * GUIDFromStringA [SHELL32.703]
1584 BOOL WINAPI
GUIDFromStringA(LPCSTR str
, LPGUID guid
)
1586 TRACE("GUIDFromStringA() stub\n");
1590 /*************************************************************************
1591 * GUIDFromStringW [SHELL32.704]
1593 BOOL WINAPI
GUIDFromStringW(LPCWSTR str
, LPGUID guid
)
1595 UNICODE_STRING guid_str
;
1597 RtlInitUnicodeString(&guid_str
, str
);
1598 return !RtlGUIDFromString(&guid_str
, guid
);
1601 /*************************************************************************
1602 * PathIsTemporaryW [SHELL32.714]
1604 EXTERN_C BOOL WINAPI
PathIsTemporaryW(LPWSTR Str
)
1606 FIXME("(%s)stub\n", debugstr_w(Str
));
1610 /*************************************************************************
1611 * PathIsTemporaryA [SHELL32.713]
1613 EXTERN_C BOOL WINAPI
PathIsTemporaryA(LPSTR Str
)
1615 FIXME("(%s)stub\n", debugstr_a(Str
));
1619 typedef struct _PSXA
1623 IShellPropSheetExt
*pspsx
[0];
1626 typedef struct _PSXA_CALL
1628 LPFNADDPROPSHEETPAGE lpfnAddReplaceWith
;
1633 } PSXA_CALL
, *PPSXA_CALL
;
1635 static BOOL CALLBACK
PsxaCall(HPROPSHEETPAGE hpage
, LPARAM lParam
)
1637 PPSXA_CALL Call
= (PPSXA_CALL
)lParam
;
1641 if ((Call
->bMultiple
|| !Call
->bCalled
) &&
1642 Call
->lpfnAddReplaceWith(hpage
, Call
->lParam
))
1644 Call
->bCalled
= TRUE
;
1653 /*************************************************************************
1654 * SHAddFromPropSheetExtArray [SHELL32.167]
1656 UINT WINAPI
SHAddFromPropSheetExtArray(HPSXA hpsxa
, LPFNADDPROPSHEETPAGE lpfnAddPage
, LPARAM lParam
)
1660 PPSXA psxa
= (PPSXA
)hpsxa
;
1662 TRACE("(%p,%p,%08lx)\n", hpsxa
, lpfnAddPage
, lParam
);
1666 ZeroMemory(&Call
, sizeof(Call
));
1667 Call
.lpfnAddReplaceWith
= lpfnAddPage
;
1668 Call
.lParam
= lParam
;
1669 Call
.bMultiple
= TRUE
;
1671 /* Call the AddPage method of all registered IShellPropSheetExt interfaces */
1672 for (i
= 0; i
!= psxa
->uiCount
; i
++)
1674 psxa
->pspsx
[i
]->AddPages(PsxaCall
, (LPARAM
)&Call
);
1677 return Call
.uiCount
;
1683 /*************************************************************************
1684 * SHCreatePropSheetExtArray [SHELL32.168]
1686 HPSXA WINAPI
SHCreatePropSheetExtArray(HKEY hKey
, LPCWSTR pszSubKey
, UINT max_iface
)
1688 return SHCreatePropSheetExtArrayEx(hKey
, pszSubKey
, max_iface
, NULL
);
1692 /*************************************************************************
1693 * SHCreatePropSheetExtArrayEx [SHELL32.194]
1695 EXTERN_C HPSXA WINAPI
SHCreatePropSheetExtArrayEx(HKEY hKey
, LPCWSTR pszSubKey
, UINT max_iface
, IDataObject
*pDataObj
)
1697 static const WCHAR szPropSheetSubKey
[] = {'s','h','e','l','l','e','x','\\','P','r','o','p','e','r','t','y','S','h','e','e','t','H','a','n','d','l','e','r','s',0};
1698 WCHAR szHandler
[64];
1700 WCHAR szClsidHandler
[39];
1705 HKEY hkBase
, hkPropSheetHandlers
;
1709 TRACE("(%p,%s,%u)\n", hKey
, debugstr_w(pszSubKey
), max_iface
);
1714 /* Open the registry key */
1715 lRet
= RegOpenKeyW(hKey
, pszSubKey
, &hkBase
);
1716 if (lRet
!= ERROR_SUCCESS
)
1719 lRet
= RegOpenKeyExW(hkBase
, szPropSheetSubKey
, 0, KEY_ENUMERATE_SUB_KEYS
, &hkPropSheetHandlers
);
1720 RegCloseKey(hkBase
);
1721 if (lRet
== ERROR_SUCCESS
)
1723 /* Create and initialize the Property Sheet Extensions Array */
1724 psxa
= (PPSXA
)LocalAlloc(LMEM_FIXED
| LMEM_ZEROINIT
, sizeof(PSXA
) + max_iface
* sizeof(IShellPropSheetExt
*));
1727 psxa
->uiAllocated
= max_iface
;
1729 /* Enumerate all subkeys and attempt to load the shell extensions */
1733 dwHandlerLen
= sizeof(szHandler
) / sizeof(szHandler
[0]);
1734 lRet
= RegEnumKeyExW(hkPropSheetHandlers
, dwIndex
++, szHandler
, &dwHandlerLen
, NULL
, NULL
, NULL
, NULL
);
1735 if (lRet
!= ERROR_SUCCESS
)
1737 if (lRet
== ERROR_MORE_DATA
)
1740 if (lRet
== ERROR_NO_MORE_ITEMS
)
1741 lRet
= ERROR_SUCCESS
;
1744 szHandler
[(sizeof(szHandler
) / sizeof(szHandler
[0])) - 1] = 0;
1745 hr
= CLSIDFromString(szHandler
, &clsid
);
1748 dwClsidSize
= sizeof(szClsidHandler
);
1749 if (SHGetValueW(hkPropSheetHandlers
, szHandler
, NULL
, NULL
, szClsidHandler
, &dwClsidSize
) == ERROR_SUCCESS
)
1751 szClsidHandler
[(sizeof(szClsidHandler
) / sizeof(szClsidHandler
[0])) - 1] = 0;
1752 hr
= CLSIDFromString(szClsidHandler
, &clsid
);
1757 CComPtr
<IShellExtInit
> psxi
;
1758 CComPtr
<IShellPropSheetExt
> pspsx
;
1760 /* Attempt to get an IShellPropSheetExt and an IShellExtInit instance.
1761 Only if both interfaces are supported it's a real shell extension.
1762 Then call IShellExtInit's Initialize method. */
1763 if (SUCCEEDED(CoCreateInstance(clsid
, NULL
, CLSCTX_INPROC_SERVER
/* | CLSCTX_NO_CODE_DOWNLOAD */, IID_IShellPropSheetExt
, (LPVOID
*)&pspsx
)))
1765 if (SUCCEEDED(pspsx
->QueryInterface(IID_IShellExtInit
, (PVOID
*)&psxi
)))
1767 if (SUCCEEDED(psxi
->Initialize(NULL
, pDataObj
, hKey
)))
1769 /* Add the IShellPropSheetExt instance to the array */
1770 psxa
->pspsx
[psxa
->uiCount
++] = pspsx
.Detach();
1775 } while (psxa
->uiCount
!= psxa
->uiAllocated
);
1778 lRet
= ERROR_NOT_ENOUGH_MEMORY
;
1780 RegCloseKey(hkPropSheetHandlers
);
1783 if (lRet
!= ERROR_SUCCESS
&& psxa
)
1785 SHDestroyPropSheetExtArray((HPSXA
)psxa
);
1792 /*************************************************************************
1793 * SHReplaceFromPropSheetExtArray [SHELL32.170]
1795 UINT WINAPI
SHReplaceFromPropSheetExtArray(HPSXA hpsxa
, UINT uPageID
, LPFNADDPROPSHEETPAGE lpfnReplaceWith
, LPARAM lParam
)
1799 PPSXA psxa
= (PPSXA
)hpsxa
;
1801 TRACE("(%p,%u,%p,%08lx)\n", hpsxa
, uPageID
, lpfnReplaceWith
, lParam
);
1805 ZeroMemory(&Call
, sizeof(Call
));
1806 Call
.lpfnAddReplaceWith
= lpfnReplaceWith
;
1807 Call
.lParam
= lParam
;
1809 /* Call the ReplacePage method of all registered IShellPropSheetExt interfaces.
1810 Each shell extension is only allowed to call the callback once during the callback. */
1811 for (i
= 0; i
!= psxa
->uiCount
; i
++)
1813 Call
.bCalled
= FALSE
;
1814 psxa
->pspsx
[i
]->ReplacePage(uPageID
, PsxaCall
, (LPARAM
)&Call
);
1817 return Call
.uiCount
;
1823 /*************************************************************************
1824 * SHDestroyPropSheetExtArray [SHELL32.169]
1826 void WINAPI
SHDestroyPropSheetExtArray(HPSXA hpsxa
)
1829 PPSXA psxa
= (PPSXA
)hpsxa
;
1831 TRACE("(%p)\n", hpsxa
);
1835 for (i
= 0; i
!= psxa
->uiCount
; i
++)
1837 psxa
->pspsx
[i
]->Release();
1840 LocalFree((HLOCAL
)psxa
);
1844 /*************************************************************************
1845 * CIDLData_CreateFromIDArray [SHELL32.83]
1847 * Create IDataObject from PIDLs??
1849 HRESULT WINAPI
CIDLData_CreateFromIDArray(
1850 LPCITEMIDLIST pidlFolder
,
1852 LPCITEMIDLIST
*lppidlFiles
,
1853 IDataObject
**ppdataObject
)
1856 HWND hwnd
= 0; /*FIXME: who should be hwnd of owner? set to desktop */
1859 TRACE("(%p, %d, %p, %p)\n", pidlFolder
, cpidlFiles
, lppidlFiles
, ppdataObject
);
1863 for (i
= 0; i
< cpidlFiles
; i
++)
1864 pdump(lppidlFiles
[i
]);
1866 hResult
= IDataObject_Constructor(hwnd
, pidlFolder
, lppidlFiles
, cpidlFiles
, ppdataObject
);
1870 /*************************************************************************
1871 * SHCreateStdEnumFmtEtc [SHELL32.74]
1876 HRESULT WINAPI
SHCreateStdEnumFmtEtc(
1878 const FORMATETC
*lpFormats
,
1879 LPENUMFORMATETC
*ppenumFormatetc
)
1881 IEnumFORMATETC
*pef
;
1883 TRACE("cf=%d fe=%p pef=%p\n", cFormats
, lpFormats
, ppenumFormatetc
);
1885 hRes
= IEnumFORMATETC_Constructor(cFormats
, lpFormats
, &pef
);
1890 hRes
= pef
->QueryInterface(IID_IEnumFORMATETC
, (LPVOID
*)ppenumFormatetc
);
1897 /*************************************************************************
1898 * SHCreateShellFolderView (SHELL32.256)
1900 HRESULT WINAPI
SHCreateShellFolderView(const SFV_CREATE
*pcsfv
, IShellView
**ppsv
)
1904 FIXME("SHCreateShellFolderView() stub\n");
1906 if (!pcsfv
|| sizeof(*pcsfv
) != pcsfv
->cbSize
)
1910 LPVOID lpdata
= 0;/*LocalAlloc(LMEM_ZEROINIT, 0x4E4);*/
1913 ret
= E_OUTOFMEMORY
;
1916 /* Initialize and return unknown lpdata structure */
1923 /*************************************************************************
1924 * SHFindFiles (SHELL32.90)
1926 BOOL WINAPI
SHFindFiles( LPCITEMIDLIST pidlFolder
, LPCITEMIDLIST pidlSaveFile
)
1928 FIXME("%p %p\n", pidlFolder
, pidlSaveFile
);
1932 /*************************************************************************
1933 * SHUpdateImageW (SHELL32.192)
1935 * Notifies the shell that an icon in the system image list has been changed.
1938 * pszHashItem [I] Path to file that contains the icon.
1939 * iIndex [I] Zero-based index of the icon in the file.
1940 * uFlags [I] Flags determining the icon attributes. See notes.
1941 * iImageIndex [I] Index of the icon in the system image list.
1947 * uFlags can be one or more of the following flags:
1948 * GIL_NOTFILENAME - pszHashItem is not a file name.
1949 * GIL_SIMULATEDOC - Create a document icon using the specified icon.
1951 void WINAPI
SHUpdateImageW(LPCWSTR pszHashItem
, int iIndex
, UINT uFlags
, int iImageIndex
)
1953 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_w(pszHashItem
), iIndex
, uFlags
, iImageIndex
);
1956 /*************************************************************************
1957 * SHUpdateImageA (SHELL32.191)
1959 * See SHUpdateImageW.
1961 VOID WINAPI
SHUpdateImageA(LPCSTR pszHashItem
, INT iIndex
, UINT uFlags
, INT iImageIndex
)
1963 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem
), iIndex
, uFlags
, iImageIndex
);
1966 INT WINAPI
SHHandleUpdateImage(LPCITEMIDLIST pidlExtra
)
1968 FIXME("%p - stub\n", pidlExtra
);
1973 BOOL WINAPI
SHObjectProperties(HWND hwnd
, DWORD dwType
, LPCWSTR szObject
, LPCWSTR szPage
)
1975 FIXME("%p, 0x%08x, %s, %s - stub\n", hwnd
, dwType
, debugstr_w(szObject
), debugstr_w(szPage
));
1980 BOOL WINAPI
SHGetNewLinkInfoA(LPCSTR pszLinkTo
, LPCSTR pszDir
, LPSTR pszName
, BOOL
*pfMustCopy
,
1983 WCHAR wszLinkTo
[MAX_PATH
];
1984 WCHAR wszDir
[MAX_PATH
];
1985 WCHAR wszName
[MAX_PATH
];
1988 MultiByteToWideChar(CP_ACP
, 0, pszLinkTo
, -1, wszLinkTo
, MAX_PATH
);
1989 MultiByteToWideChar(CP_ACP
, 0, pszDir
, -1, wszDir
, MAX_PATH
);
1991 res
= SHGetNewLinkInfoW(wszLinkTo
, wszDir
, wszName
, pfMustCopy
, uFlags
);
1994 WideCharToMultiByte(CP_ACP
, 0, wszName
, -1, pszName
, MAX_PATH
, NULL
, NULL
);
1999 BOOL WINAPI
SHGetNewLinkInfoW(LPCWSTR pszLinkTo
, LPCWSTR pszDir
, LPWSTR pszName
, BOOL
*pfMustCopy
,
2002 const WCHAR
*basename
;
2003 WCHAR
*dst_basename
;
2005 static const WCHAR lnkformat
[] = {'%','s','.','l','n','k',0};
2006 static const WCHAR lnkformatnum
[] = {'%','s',' ','(','%','d',')','.','l','n','k',0};
2008 TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(pszLinkTo
), debugstr_w(pszDir
),
2009 pszName
, pfMustCopy
, uFlags
);
2011 *pfMustCopy
= FALSE
;
2013 if (uFlags
& SHGNLI_PIDL
)
2015 FIXME("SHGNLI_PIDL flag unsupported\n");
2020 FIXME("ignoring flags: 0x%08x\n", uFlags
);
2022 /* FIXME: should test if the file is a shortcut or DOS program */
2023 if (GetFileAttributesW(pszLinkTo
) == INVALID_FILE_ATTRIBUTES
)
2026 basename
= strrchrW(pszLinkTo
, '\\');
2028 basename
= basename
+1;
2030 basename
= pszLinkTo
;
2032 lstrcpynW(pszName
, pszDir
, MAX_PATH
);
2033 if (!PathAddBackslashW(pszName
))
2036 dst_basename
= pszName
+ strlenW(pszName
);
2038 snprintfW(dst_basename
, pszName
+ MAX_PATH
- dst_basename
, lnkformat
, basename
);
2040 while (GetFileAttributesW(pszName
) != INVALID_FILE_ATTRIBUTES
)
2042 snprintfW(dst_basename
, pszName
+ MAX_PATH
- dst_basename
, lnkformatnum
, basename
, i
);
2049 /*************************************************************************
2050 * SHStartNetConnectionDialog (SHELL32.@)
2052 HRESULT WINAPI
SHStartNetConnectionDialog(HWND hwnd
, LPCSTR pszRemoteName
, DWORD dwType
)
2054 FIXME("%p, %s, 0x%08x - stub\n", hwnd
, debugstr_a(pszRemoteName
), dwType
);
2058 /*************************************************************************
2059 * SHEmptyRecycleBinA (SHELL32.@)
2061 HRESULT WINAPI
SHEmptyRecycleBinA(HWND hwnd
, LPCSTR pszRootPath
, DWORD dwFlags
)
2063 LPWSTR szRootPathW
= NULL
;
2067 TRACE("%p, %s, 0x%08x\n", hwnd
, debugstr_a(pszRootPath
), dwFlags
);
2071 len
= MultiByteToWideChar(CP_ACP
, 0, pszRootPath
, -1, NULL
, 0);
2073 return HRESULT_FROM_WIN32(GetLastError());
2074 szRootPathW
= (LPWSTR
)HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
2076 return E_OUTOFMEMORY
;
2077 if (MultiByteToWideChar(CP_ACP
, 0, pszRootPath
, -1, szRootPathW
, len
) == 0)
2079 HeapFree(GetProcessHeap(), 0, szRootPathW
);
2080 return HRESULT_FROM_WIN32(GetLastError());
2084 hr
= SHEmptyRecycleBinW(hwnd
, szRootPathW
, dwFlags
);
2085 HeapFree(GetProcessHeap(), 0, szRootPathW
);
2090 HRESULT WINAPI
SHEmptyRecycleBinW(HWND hwnd
, LPCWSTR pszRootPath
, DWORD dwFlags
)
2092 WCHAR szPath
[MAX_PATH
] = {0};
2093 DWORD dwSize
, dwType
;
2096 TRACE("%p, %s, 0x%08x\n", hwnd
, debugstr_w(pszRootPath
), dwFlags
);
2098 if (!(dwFlags
& SHERB_NOCONFIRMATION
))
2101 * enumerate available files
2102 * show confirmation dialog
2104 FIXME("show confirmation dialog\n");
2107 if (dwFlags
& SHERB_NOPROGRESSUI
)
2109 ret
= EmptyRecycleBinW(pszRootPath
);
2114 * show a progress dialog
2116 ret
= EmptyRecycleBinW(pszRootPath
);
2120 return HRESULT_FROM_WIN32(GetLastError());
2122 if (!(dwFlags
& SHERB_NOSOUND
))
2124 dwSize
= sizeof(szPath
);
2125 ret
= RegGetValueW(HKEY_CURRENT_USER
,
2126 L
"AppEvents\\Schemes\\Apps\\Explorer\\EmptyRecycleBin\\.Current",
2128 RRF_RT_REG_EXPAND_SZ
,
2132 if (ret
!= ERROR_SUCCESS
)
2135 if (dwType
!= REG_EXPAND_SZ
) /* type dismatch */
2138 szPath
[(sizeof(szPath
)/sizeof(WCHAR
))-1] = L
'\0';
2139 PlaySoundW(szPath
, NULL
, SND_FILENAME
);
2144 HRESULT WINAPI
SHQueryRecycleBinA(LPCSTR pszRootPath
, LPSHQUERYRBINFO pSHQueryRBInfo
)
2146 LPWSTR szRootPathW
= NULL
;
2150 TRACE("%s, %p\n", debugstr_a(pszRootPath
), pSHQueryRBInfo
);
2154 len
= MultiByteToWideChar(CP_ACP
, 0, pszRootPath
, -1, NULL
, 0);
2156 return HRESULT_FROM_WIN32(GetLastError());
2157 szRootPathW
= (LPWSTR
)HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
2159 return E_OUTOFMEMORY
;
2160 if (MultiByteToWideChar(CP_ACP
, 0, pszRootPath
, -1, szRootPathW
, len
) == 0)
2162 HeapFree(GetProcessHeap(), 0, szRootPathW
);
2163 return HRESULT_FROM_WIN32(GetLastError());
2167 hr
= SHQueryRecycleBinW(szRootPathW
, pSHQueryRBInfo
);
2168 HeapFree(GetProcessHeap(), 0, szRootPathW
);
2173 HRESULT WINAPI
SHQueryRecycleBinW(LPCWSTR pszRootPath
, LPSHQUERYRBINFO pSHQueryRBInfo
)
2175 FIXME("%s, %p - stub\n", debugstr_w(pszRootPath
), pSHQueryRBInfo
);
2177 if (!(pszRootPath
) || (pszRootPath
[0] == 0) ||
2178 !(pSHQueryRBInfo
) || (pSHQueryRBInfo
->cbSize
< sizeof(SHQUERYRBINFO
)))
2180 return E_INVALIDARG
;
2183 pSHQueryRBInfo
->i64Size
= 0;
2184 pSHQueryRBInfo
->i64NumItems
= 0;
2189 /*************************************************************************
2190 * SHSetLocalizedName (SHELL32.@)
2192 EXTERN_C HRESULT WINAPI
SHSetLocalizedName(LPCWSTR pszPath
, LPCWSTR pszResModule
, int idsRes
)
2194 FIXME("%p, %s, %d - stub\n", pszPath
, debugstr_w(pszResModule
), idsRes
);
2199 /*************************************************************************
2200 * LinkWindow_RegisterClass (SHELL32.258)
2202 EXTERN_C BOOL WINAPI
LinkWindow_RegisterClass(void)
2208 /*************************************************************************
2209 * LinkWindow_UnregisterClass (SHELL32.259)
2211 EXTERN_C BOOL WINAPI
LinkWindow_UnregisterClass(void)
2218 /*************************************************************************
2219 * SHFlushSFCache (SHELL32.526)
2221 * Notifies the shell that a user-specified special folder location has changed.
2224 * In Wine, the shell folder registry values are not cached, so this function
2227 EXTERN_C
void WINAPI
SHFlushSFCache(void)
2231 /*************************************************************************
2232 * SHGetImageList (SHELL32.727)
2234 * Returns a copy of a shell image list.
2237 * Windows XP features 4 sizes of image list, and Vista 5. Wine currently
2238 * only supports the traditional small and large image lists, so requests
2239 * for the others will currently fail.
2241 EXTERN_C HRESULT WINAPI
SHGetImageList(int iImageList
, REFIID riid
, void **ppv
)
2243 HIMAGELIST hLarge
, hSmall
;
2245 HRESULT ret
= E_FAIL
;
2247 /* Wine currently only maintains large and small image lists */
2248 if ((iImageList
!= SHIL_LARGE
) && (iImageList
!= SHIL_SMALL
) && (iImageList
!= SHIL_SYSSMALL
))
2250 FIXME("Unsupported image list %i requested\n", iImageList
);
2254 Shell_GetImageLists(&hLarge
, &hSmall
);
2255 hNew
= ImageList_Duplicate(iImageList
== SHIL_LARGE
? hLarge
: hSmall
);
2257 /* Get the interface for the new image list */
2260 ret
= HIMAGELIST_QueryInterface(hNew
, riid
, ppv
);
2261 ImageList_Destroy(hNew
);
2267 /*************************************************************************
2268 * SHParseDisplayName [shell version 6.0]
2270 EXTERN_C HRESULT WINAPI
SHParseDisplayName(LPCWSTR pszName
, IBindCtx
*pbc
,
2271 LPITEMIDLIST
*ppidl
, SFGAOF sfgaoIn
, SFGAOF
*psfgaoOut
)
2273 CComPtr
<IShellFolder
> psfDesktop
;
2275 ULONG dwAttr
=sfgaoIn
;
2278 return E_INVALIDARG
;
2280 if (!pszName
|| !psfgaoOut
)
2283 return E_INVALIDARG
;
2286 hr
= SHGetDesktopFolder(&psfDesktop
);
2293 hr
= psfDesktop
->ParseDisplayName((HWND
)NULL
, pbc
, (LPOLESTR
)pszName
, (ULONG
*)NULL
, ppidl
, &dwAttr
);
2295 psfDesktop
->Release();
2298 *psfgaoOut
= dwAttr
;