Added class factories for DirectSoundCapture, DirectSoundFullDuplex
[wine/multimedia.git] / dlls / shell32 / shellord.c
blob68908d228ed48b64e2bc4dba9c42a3528367500c
1 /*
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
6 * 1998 Jürgen Schmied
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
22 #include "config.h"
24 #include <string.h>
25 #include <stdio.h>
26 #include "winerror.h"
27 #include "winreg.h"
28 #include "wine/debug.h"
29 #include "winnls.h"
31 #include "shellapi.h"
32 #include "shlguid.h"
33 #include "shlobj.h"
34 #include "shell32_main.h"
35 #include "undocshell.h"
36 #include "pidl.h"
37 #include "shlwapi.h"
38 #include "commdlg.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(shell);
41 WINE_DECLARE_DEBUG_CHANNEL(pidl);
43 /* FIXME: !!! move CREATEMRULIST and flags to header file !!! */
44 /* !!! it is in both here and comctl32undoc.c !!! */
45 typedef struct tagCREATEMRULIST
47 DWORD cbSize; /* size of struct */
48 DWORD nMaxItems; /* max no. of items in list */
49 DWORD dwFlags; /* see below */
50 HKEY hKey; /* root reg. key under which list is saved */
51 LPCSTR lpszSubKey; /* reg. subkey */
52 PROC lpfnCompare; /* item compare proc */
53 } CREATEMRULISTA, *LPCREATEMRULISTA;
55 /* dwFlags */
56 #define MRUF_STRING_LIST 0 /* list will contain strings */
57 #define MRUF_BINARY_LIST 1 /* list will contain binary data */
58 #define MRUF_DELAYED_SAVE 2 /* only save list order to reg. is FreeMRUList */
60 extern HANDLE WINAPI CreateMRUListA(LPCREATEMRULISTA lpcml);
61 extern DWORD WINAPI FreeMRUList(HANDLE hMRUList);
62 extern INT WINAPI AddMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData);
63 extern INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum);
64 extern INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize);
66 /*************************************************************************
67 * ParseFieldA [internal]
69 * copies a field from a ',' delimited string
71 * first field is nField = 1
73 DWORD WINAPI ParseFieldA(
74 LPCSTR src,
75 DWORD nField,
76 LPSTR dst,
77 DWORD len)
79 WARN("(%s,0x%08lx,%p,%ld) semi-stub.\n",debugstr_a(src),nField,dst,len);
81 if (!src || !src[0] || !dst || !len)
82 return 0;
84 /* skip n fields delimited by ',' */
85 while (nField > 1)
87 if (*src=='\0') return FALSE;
88 if (*(src++)==',') nField--;
91 /* copy part till the next ',' to dst */
92 while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
94 /* finalize the string */
95 *dst=0x0;
97 return TRUE;
100 /*************************************************************************
101 * ParseFieldW [internal]
103 * copies a field from a ',' delimited string
105 * first field is nField = 1
107 DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
109 WARN("(%s,0x%08lx,%p,%ld) semi-stub.\n", debugstr_w(src), nField, dst, len);
111 if (!src || !src[0] || !dst || !len)
112 return 0;
114 /* skip n fields delimited by ',' */
115 while (nField > 1)
117 if (*src == 0x0) return FALSE;
118 if (*src++ == ',') nField--;
121 /* copy part till the next ',' to dst */
122 while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++) = *(src++);
124 /* finalize the string */
125 *dst = 0x0;
127 return TRUE;
130 /*************************************************************************
131 * ParseField [SHELL32.58]
133 DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
135 if (SHELL_OsIsUnicode())
136 return ParseFieldW(src, nField, dst, len);
137 return ParseFieldA(src, nField, dst, len);
140 /*************************************************************************
141 * GetFileNameFromBrowse [SHELL32.63]
144 BOOL WINAPI GetFileNameFromBrowse(
145 HWND hwndOwner,
146 LPSTR lpstrFile,
147 DWORD nMaxFile,
148 LPCSTR lpstrInitialDir,
149 LPCSTR lpstrDefExt,
150 LPCSTR lpstrFilter,
151 LPCSTR lpstrTitle)
153 HMODULE hmodule;
154 FARPROC pGetOpenFileNameA;
155 OPENFILENAMEA ofn;
156 BOOL ret;
158 TRACE("%p, %s, %ld, %s, %s, %s, %s)\n",
159 hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt,
160 lpstrFilter, lpstrTitle);
162 hmodule = LoadLibraryA("comdlg32.dll");
163 if(!hmodule) return FALSE;
164 pGetOpenFileNameA = GetProcAddress(hmodule, "GetOpenFileNameA");
165 if(!pGetOpenFileNameA)
167 FreeLibrary(hmodule);
168 return FALSE;
171 memset(&ofn, 0, sizeof(ofn));
173 ofn.lStructSize = sizeof(ofn);
174 ofn.hwndOwner = hwndOwner;
175 ofn.lpstrFilter = lpstrFilter;
176 ofn.lpstrFile = lpstrFile;
177 ofn.nMaxFile = nMaxFile;
178 ofn.lpstrInitialDir = lpstrInitialDir;
179 ofn.lpstrTitle = lpstrTitle;
180 ofn.lpstrDefExt = lpstrDefExt;
181 ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST;
182 ret = pGetOpenFileNameA(&ofn);
184 FreeLibrary(hmodule);
185 return ret;
188 /*************************************************************************
189 * SHGetSetSettings [SHELL32.68]
191 VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet)
193 if(bSet)
195 FIXME("%p 0x%08lx TRUE\n", lpss, dwMask);
197 else
199 SHGetSettings((LPSHELLFLAGSTATE)lpss,dwMask);
203 /*************************************************************************
204 * SHGetSettings [SHELL32.@]
206 * NOTES
207 * the registry path are for win98 (tested)
208 * and possibly are the same in nt40
211 VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
213 HKEY hKey;
214 DWORD dwData;
215 DWORD dwDataSize = sizeof (DWORD);
217 TRACE("(%p 0x%08lx)\n",lpsfs,dwMask);
219 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
220 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
221 return;
223 if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
224 lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
226 if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
227 lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
229 if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
230 lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
232 if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
233 lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
235 if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
236 lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
238 if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
239 lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
241 if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
242 { if (dwData == 0)
243 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
244 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
246 else if (dwData == 1)
247 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
248 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
250 else if (dwData == 2)
251 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
252 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
255 RegCloseKey (hKey);
257 TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
260 /*************************************************************************
261 * SHShellFolderView_Message [SHELL32.73]
263 * Send a message to an explorer cabinet window.
265 * PARAMS
266 * hwndCabinet [I] The window containing the shellview to communicate with
267 * dwMessage [I] The SFVM message to send
268 * dwParam [I] Message parameter
270 * RETURNS
271 * fixme.
273 * NOTES
274 * Message SFVM_REARRANGE = 1
276 * This message gets sent when a column gets clicked to instruct the
277 * shell view to re-sort the item list. dwParam identifies the column
278 * that was clicked.
280 int WINAPI SHShellFolderView_Message(
281 HWND hwndCabinet,
282 DWORD dwMessage,
283 DWORD dwParam)
285 FIXME("%p %08lx %08lx stub\n",hwndCabinet, dwMessage, dwParam);
286 return 0;
289 /*************************************************************************
290 * RegisterShellHook [SHELL32.181]
292 * Register a shell hook.
294 * PARAMS
295 * hwnd [I] Window handle
296 * dwType [I] Type of hook.
298 * NOTES
299 * Exported by ordinal
301 BOOL WINAPI RegisterShellHook(
302 HWND hWnd,
303 DWORD dwType)
305 FIXME("(%p,0x%08lx):stub.\n",hWnd, dwType);
306 return TRUE;
309 /*************************************************************************
310 * ShellMessageBoxW [SHELL32.182]
312 * See ShellMessageBoxA.
314 int WINAPIV ShellMessageBoxW(
315 HINSTANCE hInstance,
316 HWND hWnd,
317 LPCWSTR lpText,
318 LPCWSTR lpCaption,
319 UINT uType,
320 ...)
322 WCHAR szText[100],szTitle[100];
323 LPCWSTR pszText = szText, pszTitle = szTitle, pszTemp;
324 va_list args;
325 int ret;
327 va_start(args, uType);
328 /* wvsprintfA(buf,fmt, args); */
330 TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
331 (DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
333 if (!HIWORD(lpCaption))
334 LoadStringW(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
335 else
336 pszTitle = lpCaption;
338 if (!HIWORD(lpText))
339 LoadStringW(hInstance, (DWORD)lpText, szText, sizeof(szText)/sizeof(szText[0]));
340 else
341 pszText = lpText;
343 FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
344 pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
346 va_end(args);
348 ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
349 LocalFree((HLOCAL)pszTemp);
350 return ret;
353 /*************************************************************************
354 * ShellMessageBoxA [SHELL32.183]
356 * Format and output an error message.
358 * PARAMS
359 * hInstance [I] Instance handle of message creator
360 * hWnd [I] Window handle of message creator
361 * lpText [I] Resource Id of title or LPSTR
362 * lpCaption [I] Resource Id of title or LPSTR
363 * uType [I] Type of error message
365 * RETURNS
366 * A return value from MessageBoxA().
368 * NOTES
369 * Exported by ordinal
371 int WINAPIV ShellMessageBoxA(
372 HINSTANCE hInstance,
373 HWND hWnd,
374 LPCSTR lpText,
375 LPCSTR lpCaption,
376 UINT uType,
377 ...)
379 char szText[100],szTitle[100];
380 LPCSTR pszText = szText, pszTitle = szTitle, pszTemp;
381 va_list args;
382 int ret;
384 va_start(args, uType);
385 /* wvsprintfA(buf,fmt, args); */
387 TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
388 (DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
390 if (!HIWORD(lpCaption))
391 LoadStringA(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle));
392 else
393 pszTitle = lpCaption;
395 if (!HIWORD(lpText))
396 LoadStringA(hInstance, (DWORD)lpText, szText, sizeof(szText));
397 else
398 pszText = lpText;
400 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
401 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
403 va_end(args);
405 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
406 LocalFree((HLOCAL)pszTemp);
407 return ret;
410 /*************************************************************************
411 * SHRegisterDragDrop [SHELL32.86]
413 * NOTES
414 * exported by ordinal
416 HRESULT WINAPI SHRegisterDragDrop(
417 HWND hWnd,
418 LPDROPTARGET pDropTarget)
420 FIXME("(%p,%p):stub.\n", hWnd, pDropTarget);
421 if (GetShellOle()) return pRegisterDragDrop(hWnd, pDropTarget);
422 return 0;
425 /*************************************************************************
426 * SHRevokeDragDrop [SHELL32.87]
428 * NOTES
429 * exported by ordinal
431 HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
433 FIXME("(%p):stub.\n",hWnd);
434 if (GetShellOle()) return pRevokeDragDrop(hWnd);
435 return 0;
438 /*************************************************************************
439 * SHDoDragDrop [SHELL32.88]
441 * NOTES
442 * exported by ordinal
444 HRESULT WINAPI SHDoDragDrop(
445 HWND hWnd,
446 LPDATAOBJECT lpDataObject,
447 LPDROPSOURCE lpDropSource,
448 DWORD dwOKEffect,
449 LPDWORD pdwEffect)
451 FIXME("(%p %p %p 0x%08lx %p):stub.\n",
452 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
453 if (GetShellOle()) return pDoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
454 return 0;
457 /*************************************************************************
458 * ArrangeWindows [SHELL32.184]
461 WORD WINAPI ArrangeWindows(
462 HWND hwndParent,
463 DWORD dwReserved,
464 LPCRECT lpRect,
465 WORD cKids,
466 CONST HWND * lpKids)
468 FIXME("(%p 0x%08lx %p 0x%04x %p):stub.\n",
469 hwndParent, dwReserved, lpRect, cKids, lpKids);
470 return 0;
473 /*************************************************************************
474 * SignalFileOpen [SHELL32.103]
476 * NOTES
477 * exported by ordinal
479 DWORD WINAPI
480 SignalFileOpen (DWORD dwParam1)
482 FIXME("(0x%08lx):stub.\n", dwParam1);
484 return 0;
487 /*************************************************************************
488 * SHADD_get_policy - helper function for SHAddToRecentDocs
490 * PARAMETERS
491 * policy [IN] policy name (null termed string) to find
492 * type [OUT] ptr to DWORD to receive type
493 * buffer [OUT] ptr to area to hold data retrieved
494 * len [IN/OUT] ptr to DWORD holding size of buffer and getting
495 * length filled
497 * RETURNS
498 * result of the SHQueryValueEx call
500 static INT SHADD_get_policy(LPSTR policy, LPDWORD type, LPVOID buffer, LPDWORD len)
502 HKEY Policy_basekey;
503 INT ret;
505 /* Get the key for the policies location in the registry
507 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
508 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
509 0, KEY_READ, &Policy_basekey)) {
511 if (RegOpenKeyExA(HKEY_CURRENT_USER,
512 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
513 0, KEY_READ, &Policy_basekey)) {
514 TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
515 policy);
516 *len = 0;
517 return ERROR_FILE_NOT_FOUND;
521 /* Retrieve the data if it exists
523 ret = SHQueryValueExA(Policy_basekey, policy, 0, type, buffer, len);
524 RegCloseKey(Policy_basekey);
525 return ret;
529 /*************************************************************************
530 * SHADD_compare_mru - helper function for SHAddToRecentDocs
532 * PARAMETERS
533 * data1 [IN] data being looked for
534 * data2 [IN] data in MRU
535 * cbdata [IN] length from FindMRUData call (not used)
537 * RETURNS
538 * position within MRU list that data was added.
540 static INT CALLBACK SHADD_compare_mru(LPCVOID data1, LPCVOID data2, DWORD cbData)
542 return lstrcmpiA(data1, data2);
545 /*************************************************************************
546 * SHADD_create_add_mru_data - helper function for SHAddToRecentDocs
548 * PARAMETERS
549 * mruhandle [IN] handle for created MRU list
550 * doc_name [IN] null termed pure doc name
551 * new_lnk_name [IN] null termed path and file name for .lnk file
552 * buffer [IN/OUT] 2048 byte area to consturct MRU data
553 * len [OUT] ptr to int to receive space used in buffer
555 * RETURNS
556 * position within MRU list that data was added.
558 static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPSTR doc_name, LPSTR new_lnk_name,
559 LPSTR buffer, INT *len)
561 LPSTR ptr;
562 INT wlen;
564 /*FIXME: Document:
565 * RecentDocs MRU data structure seems to be:
566 * +0h document file name w/ terminating 0h
567 * +nh short int w/ size of remaining
568 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
569 * +n+4h 10 bytes zeros - unknown
570 * +n+eh shortcut file name w/ terminating 0h
571 * +n+e+nh 3 zero bytes - unknown
574 /* Create the MRU data structure for "RecentDocs"
576 ptr = buffer;
577 lstrcpyA(ptr, doc_name);
578 ptr += (lstrlenA(buffer) + 1);
579 wlen= lstrlenA(new_lnk_name) + 1 + 12;
580 *((short int*)ptr) = wlen;
581 ptr += 2; /* step past the length */
582 *(ptr++) = 0x30; /* unknown reason */
583 *(ptr++) = 0; /* unknown, but can be 0x00, 0x01, 0x02 */
584 memset(ptr, 0, 10);
585 ptr += 10;
586 lstrcpyA(ptr, new_lnk_name);
587 ptr += (lstrlenA(new_lnk_name) + 1);
588 memset(ptr, 0, 3);
589 ptr += 3;
590 *len = ptr - buffer;
592 /* Add the new entry into the MRU list
594 return AddMRUData(mruhandle, (LPCVOID)buffer, *len);
597 /*************************************************************************
598 * SHAddToRecentDocs [SHELL32.@]
600 * PARAMETERS
601 * uFlags [IN] SHARD_PATH or SHARD_PIDL
602 * pv [IN] string or pidl, NULL clears the list
604 * NOTES
605 * exported by name
607 * FIXME: ?? MSDN shows this as a VOID
609 DWORD WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
611 /* If list is a string list lpfnCompare has the following prototype
612 * int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
613 * for binary lists the prototype is
614 * int CALLBACK MRUCompareBinary(LPCVOID data1, LPCVOID data2, DWORD cbData)
615 * where cbData is the no. of bytes to compare.
616 * Need to check what return value means identical - 0?
620 UINT olderrormode;
621 HKEY HCUbasekey;
622 CHAR doc_name[MAX_PATH];
623 CHAR link_dir[MAX_PATH];
624 CHAR new_lnk_filepath[MAX_PATH];
625 CHAR new_lnk_name[MAX_PATH];
626 IMalloc *ppM;
627 LPITEMIDLIST pidl;
628 HWND hwnd = 0; /* FIXME: get real window handle */
629 INT ret;
630 DWORD data[64], datalen, type;
632 /*FIXME: Document:
633 * RecentDocs MRU data structure seems to be:
634 * +0h document file name w/ terminating 0h
635 * +nh short int w/ size of remaining
636 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
637 * +n+4h 10 bytes zeros - unknown
638 * +n+eh shortcut file name w/ terminating 0h
639 * +n+e+nh 3 zero bytes - unknown
642 /* See if we need to do anything.
644 datalen = 64;
645 ret=SHADD_get_policy( "NoRecentDocsHistory", &type, &data, &datalen);
646 if ((ret > 0) && (ret != ERROR_FILE_NOT_FOUND)) {
647 ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
648 return 0;
650 if (ret == ERROR_SUCCESS) {
651 if (!( (type == REG_DWORD) ||
652 ((type == REG_BINARY) && (datalen == 4)) )) {
653 ERR("Error policy data for \"NoRecentDocsHistory\" not formated correctly, type=%ld, len=%ld\n",
654 type, datalen);
655 return 0;
658 TRACE("policy value for NoRecentDocsHistory = %08lx\n", data[0]);
659 /* now test the actual policy value */
660 if ( data[0] != 0)
661 return 0;
664 /* Open key to where the necessary info is
666 /* FIXME: This should be done during DLL PROCESS_ATTACH (or THREAD_ATTACH)
667 * and the close should be done during the _DETACH. The resulting
668 * key is stored in the DLL global data.
670 if (RegCreateKeyExA(HKEY_CURRENT_USER,
671 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
672 0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
673 ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
674 return 0;
677 /* Get path to user's "Recent" directory
679 if(SUCCEEDED(SHGetMalloc(&ppM))) {
680 if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT,
681 &pidl))) {
682 SHGetPathFromIDListA(pidl, link_dir);
683 IMalloc_Free(ppM, pidl);
685 else {
686 /* serious issues */
687 link_dir[0] = 0;
688 ERR("serious issues 1\n");
690 IMalloc_Release(ppM);
692 else {
693 /* serious issues */
694 link_dir[0] = 0;
695 ERR("serious issues 2\n");
697 TRACE("Users Recent dir %s\n", link_dir);
699 /* If no input, then go clear the lists */
700 if (!pv) {
701 /* clear user's Recent dir
704 /* FIXME: delete all files in "link_dir"
706 * while( more files ) {
707 * lstrcpyA(old_lnk_name, link_dir);
708 * PathAppendA(old_lnk_name, filenam);
709 * DeleteFileA(old_lnk_name);
712 FIXME("should delete all files in %s\\ \n", link_dir);
714 /* clear MRU list
716 /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
717 * HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
718 * and naturally it fails w/ rc=2. It should do it against
719 * HKEY_CURRENT_USER which is where it is stored, and where
720 * the MRU routines expect it!!!!
722 RegDeleteKeyA(HCUbasekey, "RecentDocs");
723 RegCloseKey(HCUbasekey);
724 return 0;
727 /* Have data to add, the jobs to be done:
728 * 1. Add document to MRU list in registry "HKCU\Software\
729 * Microsoft\Windows\CurrentVersion\Explorer\RecentDocs".
730 * 2. Add shortcut to document in the user's Recent directory
731 * (CSIDL_RECENT).
732 * 3. Add shortcut to Start menu's Documents submenu.
735 /* Get the pure document name from the input
737 if (uFlags & SHARD_PIDL) {
738 SHGetPathFromIDListA((LPCITEMIDLIST) pv, doc_name);
740 else {
741 lstrcpyA(doc_name, (LPSTR) pv);
743 TRACE("full document name %s\n", doc_name);
744 PathStripPathA(doc_name);
745 TRACE("stripped document name %s\n", doc_name);
748 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
750 { /* on input needs:
751 * doc_name - pure file-spec, no path
752 * link_dir - path to the user's Recent directory
753 * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node
754 * creates:
755 * new_lnk_name- pure file-spec, no path for new .lnk file
756 * new_lnk_filepath
757 * - path and file name of new .lnk file
759 CREATEMRULISTA mymru;
760 HANDLE mruhandle;
761 INT len, pos, bufused, err;
762 INT i;
763 DWORD attr;
764 CHAR buffer[2048];
765 CHAR *ptr;
766 CHAR old_lnk_name[MAX_PATH];
767 short int slen;
769 mymru.cbSize = sizeof(CREATEMRULISTA);
770 mymru.nMaxItems = 15;
771 mymru.dwFlags = MRUF_BINARY_LIST | MRUF_DELAYED_SAVE;
772 mymru.hKey = HCUbasekey;
773 mymru.lpszSubKey = "RecentDocs";
774 mymru.lpfnCompare = &SHADD_compare_mru;
775 mruhandle = CreateMRUListA(&mymru);
776 if (!mruhandle) {
777 /* MRU failed */
778 ERR("MRU processing failed, handle zero\n");
779 RegCloseKey(HCUbasekey);
780 return 0;
782 len = lstrlenA(doc_name);
783 pos = FindMRUData(mruhandle, doc_name, len, 0);
785 /* Now get the MRU entry that will be replaced
786 * and delete the .lnk file for it
788 if ((bufused = EnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
789 buffer, 2048)) != -1) {
790 ptr = buffer;
791 ptr += (lstrlenA(buffer) + 1);
792 slen = *((short int*)ptr);
793 ptr += 2; /* skip the length area */
794 if (bufused >= slen + (ptr-buffer)) {
795 /* buffer size looks good */
796 ptr += 12; /* get to string */
797 len = bufused - (ptr-buffer); /* get length of buf remaining */
798 if ((lstrlenA(ptr) > 0) && (lstrlenA(ptr) <= len-1)) {
799 /* appears to be good string */
800 lstrcpyA(old_lnk_name, link_dir);
801 PathAppendA(old_lnk_name, ptr);
802 if (!DeleteFileA(old_lnk_name)) {
803 if ((attr = GetFileAttributesA(old_lnk_name)) == -1) {
804 if ((err = GetLastError()) != ERROR_FILE_NOT_FOUND) {
805 ERR("Delete for %s failed, err=%d, attr=%08lx\n",
806 old_lnk_name, err, attr);
808 else {
809 TRACE("old .lnk file %s did not exist\n",
810 old_lnk_name);
813 else {
814 ERR("Delete for %s failed, attr=%08lx\n",
815 old_lnk_name, attr);
818 else {
819 TRACE("deleted old .lnk file %s\n", old_lnk_name);
825 /* Create usable .lnk file name for the "Recent" directory
827 wsprintfA(new_lnk_name, "%s.lnk", doc_name);
828 lstrcpyA(new_lnk_filepath, link_dir);
829 PathAppendA(new_lnk_filepath, new_lnk_name);
830 i = 1;
831 olderrormode = SetErrorMode(SEM_FAILCRITICALERRORS);
832 while (GetFileAttributesA(new_lnk_filepath) != -1) {
833 i++;
834 wsprintfA(new_lnk_name, "%s (%u).lnk", doc_name, i);
835 lstrcpyA(new_lnk_filepath, link_dir);
836 PathAppendA(new_lnk_filepath, new_lnk_name);
838 SetErrorMode(olderrormode);
839 TRACE("new shortcut will be %s\n", new_lnk_filepath);
841 /* Now add the new MRU entry and data
843 pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
844 buffer, &len);
845 FreeMRUList(mruhandle);
846 TRACE("Updated MRU list, new doc is position %d\n", pos);
849 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
851 { /* on input needs:
852 * doc_name - pure file-spec, no path
853 * new_lnk_filepath
854 * - path and file name of new .lnk file
855 * uFlags[in] - flags on call to SHAddToRecentDocs
856 * pv[in] - document path/pidl on call to SHAddToRecentDocs
858 IShellLinkA *psl = NULL;
859 IPersistFile *pPf = NULL;
860 HRESULT hres;
861 CHAR desc[MAX_PATH];
862 WCHAR widelink[MAX_PATH];
864 CoInitialize(0);
866 hres = CoCreateInstance( &CLSID_ShellLink,
867 NULL,
868 CLSCTX_INPROC_SERVER,
869 &IID_IShellLinkA,
870 (LPVOID )&psl);
871 if(SUCCEEDED(hres)) {
873 hres = IShellLinkA_QueryInterface(psl, &IID_IPersistFile,
874 (LPVOID *)&pPf);
875 if(FAILED(hres)) {
876 /* bombed */
877 ERR("failed QueryInterface for IPersistFile %08lx\n", hres);
878 goto fail;
881 /* Set the document path or pidl */
882 if (uFlags & SHARD_PIDL) {
883 hres = IShellLinkA_SetIDList(psl, (LPCITEMIDLIST) pv);
884 } else {
885 hres = IShellLinkA_SetPath(psl, (LPCSTR) pv);
887 if(FAILED(hres)) {
888 /* bombed */
889 ERR("failed Set{IDList|Path} %08lx\n", hres);
890 goto fail;
893 lstrcpyA(desc, "Shortcut to ");
894 lstrcatA(desc, doc_name);
895 hres = IShellLinkA_SetDescription(psl, desc);
896 if(FAILED(hres)) {
897 /* bombed */
898 ERR("failed SetDescription %08lx\n", hres);
899 goto fail;
902 MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1,
903 widelink, MAX_PATH);
904 /* create the short cut */
905 hres = IPersistFile_Save(pPf, widelink, TRUE);
906 if(FAILED(hres)) {
907 /* bombed */
908 ERR("failed IPersistFile::Save %08lx\n", hres);
909 IPersistFile_Release(pPf);
910 IShellLinkA_Release(psl);
911 goto fail;
913 hres = IPersistFile_SaveCompleted(pPf, widelink);
914 IPersistFile_Release(pPf);
915 IShellLinkA_Release(psl);
916 TRACE("shortcut %s has been created, result=%08lx\n",
917 new_lnk_filepath, hres);
919 else {
920 ERR("CoCreateInstance failed, hres=%08lx\n", hres);
924 fail:
925 CoUninitialize();
927 /* all done */
928 RegCloseKey(HCUbasekey);
929 return 0;
932 /*************************************************************************
933 * SHCreateShellFolderViewEx [SHELL32.174]
935 * NOTES
936 * see IShellFolder::CreateViewObject
938 HRESULT WINAPI SHCreateShellFolderViewEx(
939 LPCSHELLFOLDERVIEWINFO psvcbi, /* [in] shelltemplate struct */
940 LPSHELLVIEW* ppv) /* [out] IShellView pointer */
942 IShellView * psf;
943 HRESULT hRes;
945 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=0x%08lx\n",
946 psvcbi->pshf, psvcbi->pidlFolder, psvcbi->lpfnCallback,
947 psvcbi->uViewMode, psvcbi->dwUser);
949 psf = IShellView_Constructor(psvcbi->pshf);
951 if (!psf)
952 return E_OUTOFMEMORY;
954 IShellView_AddRef(psf);
955 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
956 IShellView_Release(psf);
958 return hRes;
960 /*************************************************************************
961 * SHWinHelp [SHELL32.127]
964 HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
965 { FIXME("0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
966 return 0;
968 /*************************************************************************
969 * SHRunControlPanel [SHELL32.161]
972 HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
973 { FIXME("0x%08lx 0x%08lx stub\n",x,z);
974 return 0;
977 static LPUNKNOWN SHELL32_IExplorerInterface=0;
978 /*************************************************************************
979 * SHSetInstanceExplorer [SHELL32.176]
981 * NOTES
982 * Sets the interface
984 HRESULT WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
985 { TRACE("%p\n", lpUnknown);
986 SHELL32_IExplorerInterface = lpUnknown;
987 return (HRESULT) lpUnknown;
989 /*************************************************************************
990 * SHGetInstanceExplorer [SHELL32.@]
992 * NOTES
993 * gets the interface pointer of the explorer and a reference
995 HRESULT WINAPI SHGetInstanceExplorer (LPUNKNOWN * lpUnknown)
996 { TRACE("%p\n", lpUnknown);
998 *lpUnknown = SHELL32_IExplorerInterface;
1000 if (!SHELL32_IExplorerInterface)
1001 return E_FAIL;
1003 IUnknown_AddRef(SHELL32_IExplorerInterface);
1004 return NOERROR;
1006 /*************************************************************************
1007 * SHFreeUnusedLibraries [SHELL32.123]
1009 * NOTES
1010 * exported by name
1012 void WINAPI SHFreeUnusedLibraries (void)
1014 FIXME("stub\n");
1016 /*************************************************************************
1017 * DAD_AutoScroll [SHELL32.129]
1020 DWORD WINAPI DAD_AutoScroll(HWND hwnd, LPSCROLLSAMPLES samples, LPPOINT pt)
1022 FIXME("hwnd = %p %p %p\n",hwnd,samples,pt);
1023 return 0;
1025 /*************************************************************************
1026 * DAD_DragEnter [SHELL32.130]
1029 BOOL WINAPI DAD_DragEnter(HWND hwnd)
1031 FIXME("hwnd = %p\n",hwnd);
1032 return FALSE;
1034 /*************************************************************************
1035 * DAD_DragEnterEx [SHELL32.131]
1038 BOOL WINAPI DAD_DragEnterEx(HWND hwnd, POINT p)
1040 FIXME("hwnd = %p (%ld,%ld)\n",hwnd,p.x,p.y);
1041 return FALSE;
1043 /*************************************************************************
1044 * DAD_DragMove [SHELL32.134]
1047 BOOL WINAPI DAD_DragMove(POINT p)
1049 FIXME("(%ld,%ld)\n",p.x,p.y);
1050 return FALSE;
1052 /*************************************************************************
1053 * DAD_DragLeave [SHELL32.132]
1056 BOOL WINAPI DAD_DragLeave(VOID)
1058 FIXME("\n");
1059 return FALSE;
1061 /*************************************************************************
1062 * DAD_SetDragImage [SHELL32.136]
1064 * NOTES
1065 * exported by name
1067 BOOL WINAPI DAD_SetDragImage(
1068 HIMAGELIST himlTrack,
1069 LPPOINT lppt)
1071 FIXME("%p %p stub\n",himlTrack, lppt);
1072 return 0;
1074 /*************************************************************************
1075 * DAD_ShowDragImage [SHELL32.137]
1077 * NOTES
1078 * exported by name
1080 BOOL WINAPI DAD_ShowDragImage(BOOL bShow)
1082 FIXME("0x%08x stub\n",bShow);
1083 return 0;
1086 static const WCHAR szwCabLocation[] = {
1087 'S','o','f','t','w','a','r','e','\\',
1088 'M','i','c','r','o','s','o','f','t','\\',
1089 'W','i','n','d','o','w','s','\\',
1090 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
1091 'E','x','p','l','o','r','e','r','\\',
1092 'C','a','b','i','n','e','t','S','t','a','t','e',0
1095 static const WCHAR szwSettings[] = { 'S','e','t','t','i','n','g','s',0 };
1097 /*************************************************************************
1098 * ReadCabinetState [SHELL32.651] NT 4.0
1101 BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length)
1103 HKEY hkey = 0;
1104 DWORD type, r;
1106 TRACE("%p %d \n",cs,length);
1108 if( (cs == NULL) || (length < sizeof(*cs)) )
1109 return FALSE;
1111 r = RegOpenKeyW( HKEY_CURRENT_USER, szwCabLocation, &hkey );
1112 if( r == ERROR_SUCCESS )
1114 type = REG_BINARY;
1115 r = RegQueryValueExW( hkey, szwSettings,
1116 NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
1117 RegCloseKey( hkey );
1121 /* if we can't read from the registry, create default values */
1122 if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
1123 (cs->cLength != length) )
1125 ERR("Initializing shell cabinet settings\n");
1126 memset(cs, 0, sizeof(*cs));
1127 cs->cLength = sizeof(*cs);
1128 cs->nVersion = 2;
1129 cs->fFullPathTitle = FALSE;
1130 cs->fSaveLocalView = TRUE;
1131 cs->fNotShell = FALSE;
1132 cs->fSimpleDefault = TRUE;
1133 cs->fDontShowDescBar = FALSE;
1134 cs->fNewWindowMode = FALSE;
1135 cs->fShowCompColor = FALSE;
1136 cs->fDontPrettyNames = FALSE;
1137 cs->fAdminsCreateCommonGroups = TRUE;
1138 cs->fMenuEnumFilter = 96;
1141 return TRUE;
1144 /*************************************************************************
1145 * WriteCabinetState [SHELL32.652] NT 4.0
1148 BOOL WINAPI WriteCabinetState(CABINETSTATE *cs)
1150 DWORD r;
1151 HKEY hkey = 0;
1153 TRACE("%p\n",cs);
1155 if( cs == NULL )
1156 return FALSE;
1158 r = RegCreateKeyExW( HKEY_CURRENT_USER, szwCabLocation, 0,
1159 NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
1160 if( r == ERROR_SUCCESS )
1162 r = RegSetValueExW( hkey, szwSettings, 0,
1163 REG_BINARY, (LPBYTE) cs, cs->cLength);
1165 RegCloseKey( hkey );
1168 return (r==ERROR_SUCCESS);
1171 /*************************************************************************
1172 * FileIconInit [SHELL32.660]
1175 BOOL WINAPI FileIconInit(BOOL bFullInit)
1176 { FIXME("(%s)\n", bFullInit ? "true" : "false");
1177 return 0;
1179 /*************************************************************************
1180 * IsUserAdmin [SHELL32.680] NT 4.0
1183 HRESULT WINAPI IsUserAdmin(void)
1184 { FIXME("stub\n");
1185 return TRUE;
1188 /*************************************************************************
1189 * SHAllocShared [SHELL32.520]
1191 * NOTES
1192 * parameter1 is return value from HeapAlloc
1193 * parameter2 is equal to the size allocated with HeapAlloc
1194 * parameter3 is return value from GetCurrentProcessId
1196 * the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
1197 * WM_USER+2 could be the undocumented CWM_SETPATH
1198 * the allocated memory contains a pidl
1200 HGLOBAL WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
1201 { HGLOBAL hmem;
1202 LPVOID pmem;
1204 TRACE("ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID);
1205 hmem = GlobalAlloc(GMEM_FIXED, size);
1206 if (!hmem)
1207 return 0;
1209 pmem = GlobalLock (hmem);
1211 if (! pmem)
1212 return 0;
1214 memcpy (pmem, psrc, size);
1215 GlobalUnlock(hmem);
1216 return hmem;
1218 /*************************************************************************
1219 * SHLockShared [SHELL32.521]
1221 * NOTES
1222 * parameter1 is return value from SHAllocShared
1223 * parameter2 is return value from GetCurrentProcessId
1224 * the receiver of (WM_USER+2) tries to lock the HANDLE (?)
1225 * the return value seems to be a memory address
1227 LPVOID WINAPI SHLockShared(HANDLE hmem, DWORD procID)
1228 { TRACE("handle=%p procID=0x%04lx\n",hmem,procID);
1229 return GlobalLock(hmem);
1231 /*************************************************************************
1232 * SHUnlockShared [SHELL32.522]
1234 * NOTES
1235 * parameter1 is return value from SHLockShared
1237 BOOL WINAPI SHUnlockShared(LPVOID pv)
1239 TRACE("%p\n",pv);
1240 return GlobalUnlock((HANDLE)pv);
1242 /*************************************************************************
1243 * SHFreeShared [SHELL32.523]
1245 * NOTES
1246 * parameter1 is return value from SHAllocShared
1247 * parameter2 is return value from GetCurrentProcessId
1249 BOOL WINAPI SHFreeShared(
1250 HANDLE hMem,
1251 DWORD pid)
1253 TRACE("handle=%p 0x%04lx\n",hMem,pid);
1254 return (BOOL)GlobalFree(hMem);
1257 /*************************************************************************
1258 * SetAppStartingCursor [SHELL32.99]
1260 HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
1261 { FIXME("hwnd=%p 0x%04lx stub\n",u,v );
1262 return 0;
1264 /*************************************************************************
1265 * SHLoadOLE [SHELL32.151]
1268 HRESULT WINAPI SHLoadOLE(DWORD u)
1269 { FIXME("0x%04lx stub\n",u);
1270 return S_OK;
1272 /*************************************************************************
1273 * DriveType [SHELL32.64]
1276 HRESULT WINAPI DriveType(DWORD u)
1277 { FIXME("0x%04lx stub\n",u);
1278 return 0;
1280 /*************************************************************************
1281 * SHAbortInvokeCommand [SHELL32.198]
1284 HRESULT WINAPI SHAbortInvokeCommand(void)
1285 { FIXME("stub\n");
1286 return 1;
1288 /*************************************************************************
1289 * SHOutOfMemoryMessageBox [SHELL32.126]
1292 int WINAPI SHOutOfMemoryMessageBox(
1293 HWND hwndOwner,
1294 LPCSTR lpCaption,
1295 UINT uType)
1297 FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
1298 return 0;
1300 /*************************************************************************
1301 * SHFlushClipboard [SHELL32.121]
1304 HRESULT WINAPI SHFlushClipboard(void)
1305 { FIXME("stub\n");
1306 return 1;
1309 /*************************************************************************
1310 * SHWaitForFileToOpen [SHELL32.97]
1313 BOOL WINAPI SHWaitForFileToOpen(
1314 LPCITEMIDLIST pidl,
1315 DWORD dwFlags,
1316 DWORD dwTimeout)
1318 FIXME("%p 0x%08lx 0x%08lx stub\n", pidl, dwFlags, dwTimeout);
1319 return 0;
1322 /************************************************************************
1323 * @ [SHELL32.654]
1325 * NOTES: first parameter seems to be a pointer (same as passed to WriteCabinetState)
1326 * second one could be a size (0x0c). The size is the same as the structure saved to
1327 * HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState
1328 * I'm (js) guessing: this one is just ReadCabinetState ;-)
1330 HRESULT WINAPI shell32_654 (CABINETSTATE *cs, int length)
1332 TRACE("%p %d\n",cs,length);
1333 return ReadCabinetState(cs,length);
1336 /************************************************************************
1337 * RLBuildListOfPaths [SHELL32.146]
1339 * NOTES
1340 * builds a DPA
1342 DWORD WINAPI RLBuildListOfPaths (void)
1343 { FIXME("stub\n");
1344 return 0;
1346 /************************************************************************
1347 * SHValidateUNC [SHELL32.173]
1350 HRESULT WINAPI SHValidateUNC (DWORD x, DWORD y, DWORD z)
1352 FIXME("0x%08lx 0x%08lx 0x%08lx stub\n",x,y,z);
1353 return 0;
1356 /************************************************************************
1357 * DoEnvironmentSubstA [SHELL32.@]
1360 HRESULT WINAPI DoEnvironmentSubstA(LPSTR x, LPSTR y)
1362 FIXME("(%s, %s) stub\n", debugstr_a(x), debugstr_a(y));
1363 return 0;
1366 /************************************************************************
1367 * DoEnvironmentSubstW [SHELL32.@]
1370 HRESULT WINAPI DoEnvironmentSubstW(LPWSTR x, LPWSTR y)
1372 FIXME("(%s, %s): stub\n", debugstr_w(x), debugstr_w(y));
1373 return 0;
1376 /************************************************************************
1377 * DoEnvironmentSubst [SHELL32.53]
1380 HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y)
1382 if (SHELL_OsIsUnicode())
1383 return DoEnvironmentSubstW(x, y);
1384 return DoEnvironmentSubstA(x, y);
1387 /*************************************************************************
1388 * @ [SHELL32.243]
1390 * Win98+ by-ordinal routine. In Win98 this routine returns zero and
1391 * does nothing else. Possibly this does something in NT or SHELL32 5.0?
1395 BOOL WINAPI shell32_243(DWORD a, DWORD b)
1397 return FALSE;
1400 /*************************************************************************
1401 * @ [SHELL32.714]
1403 DWORD WINAPI SHELL32_714(LPVOID x)
1405 FIXME("(%s)stub\n", debugstr_w(x));
1406 return 0;
1409 /*************************************************************************
1410 * SHAddFromPropSheetExtArray [SHELL32.167]
1412 DWORD WINAPI SHAddFromPropSheetExtArray(DWORD a, DWORD b, DWORD c)
1414 FIXME("(%08lx,%08lx,%08lx)stub\n", a, b, c);
1415 return 0;
1418 /*************************************************************************
1419 * SHCreatePropSheetExtArray [SHELL32.168]
1421 DWORD WINAPI SHCreatePropSheetExtArray(DWORD a, LPCSTR b, DWORD c)
1423 FIXME("(%08lx,%s,%08lx)stub\n", a, debugstr_a(b), c);
1424 return 0;
1427 /*************************************************************************
1428 * SHReplaceFromPropSheetExtArray [SHELL32.170]
1430 DWORD WINAPI SHReplaceFromPropSheetExtArray(DWORD a, DWORD b, DWORD c, DWORD d)
1432 FIXME("(%08lx,%08lx,%08lx,%08lx)stub\n", a, b, c, d);
1433 return 0;
1436 /*************************************************************************
1437 * SHDestroyPropSheetExtArray [SHELL32.169]
1439 DWORD WINAPI SHDestroyPropSheetExtArray(DWORD a)
1441 FIXME("(%08lx)stub\n", a);
1442 return 0;
1445 /*************************************************************************
1446 * CIDLData_CreateFromIDArray [SHELL32.83]
1448 * Create IDataObject from PIDLs??
1450 HRESULT WINAPI CIDLData_CreateFromIDArray(
1451 LPCITEMIDLIST pidlFolder,
1452 DWORD cpidlFiles,
1453 LPCITEMIDLIST *lppidlFiles,
1454 LPDATAOBJECT *ppdataObject)
1456 UINT i;
1457 HWND hwnd = 0; /*FIXME: who should be hwnd of owner? set to desktop */
1459 TRACE("(%p, %ld, %p, %p)\n", pidlFolder, cpidlFiles, lppidlFiles, ppdataObject);
1460 if (TRACE_ON(pidl))
1462 pdump (pidlFolder);
1463 for (i=0; i<cpidlFiles; i++) pdump (lppidlFiles[i]);
1465 *ppdataObject = IDataObject_Constructor( hwnd, pidlFolder,
1466 lppidlFiles, cpidlFiles);
1467 if (*ppdataObject) return S_OK;
1468 return E_OUTOFMEMORY;
1471 /*************************************************************************
1472 * SHCreateStdEnumFmtEtc [SHELL32.74]
1474 * NOTES
1477 HRESULT WINAPI SHCreateStdEnumFmtEtc(
1478 DWORD cFormats,
1479 const FORMATETC *lpFormats,
1480 LPENUMFORMATETC *ppenumFormatetc)
1482 IEnumFORMATETC *pef;
1483 HRESULT hRes;
1484 TRACE("cf=%ld fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
1486 pef = IEnumFORMATETC_Constructor(cFormats, lpFormats);
1487 if (!pef)
1488 return E_OUTOFMEMORY;
1490 IEnumFORMATETC_AddRef(pef);
1491 hRes = IEnumFORMATETC_QueryInterface(pef, &IID_IEnumFORMATETC, (LPVOID*)ppenumFormatetc);
1492 IEnumFORMATETC_Release(pef);
1494 return hRes;
1498 /*************************************************************************
1499 * SHELL32_256
1501 HRESULT WINAPI SHELL32_256(LPDWORD lpdw0, LPDWORD lpdw1)
1503 HRESULT ret = S_OK;
1505 FIXME("stub %p 0x%08lx %p\n", lpdw0, lpdw0 ? *lpdw0 : 0, lpdw1);
1507 if (!lpdw0 || *lpdw0 != 0x10)
1508 ret = E_INVALIDARG;
1509 else
1511 LPVOID lpdata = 0;/*LocalAlloc(GMEM_ZEROINIT, 0x4E4);*/
1513 if (!lpdata)
1514 ret = E_OUTOFMEMORY;
1515 else
1517 /* Initialize and return unknown lpdata structure */
1521 return ret;