webservices: Add a stub implementation of WS_TYPE_ATTRIBUTE_FIELD_MAPPING in the...
[wine.git] / dlls / shell32 / shell32_main.c
blobdce18969c581cd7c166e0e12c0596b5fb660aa0a
1 /*
2 * Shell basics
4 * Copyright 1998 Marcus Meissner
5 * Copyright 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "config.h"
24 #include <stdlib.h>
25 #include <string.h>
26 #include <stdarg.h>
27 #include <stdio.h>
29 #define COBJMACROS
31 #include "windef.h"
32 #include "winbase.h"
33 #include "winerror.h"
34 #include "winreg.h"
35 #include "dlgs.h"
36 #include "shellapi.h"
37 #include "winuser.h"
38 #include "wingdi.h"
39 #include "shlobj.h"
40 #include "rpcproxy.h"
41 #include "shlwapi.h"
42 #include "propsys.h"
44 #include "undocshell.h"
45 #include "pidl.h"
46 #include "shell32_main.h"
47 #include "version.h"
48 #include "shresdef.h"
49 #include "initguid.h"
50 #include "shfldr.h"
52 #include "wine/debug.h"
53 #include "wine/unicode.h"
55 WINE_DEFAULT_DEBUG_CHANNEL(shell);
57 /*************************************************************************
58 * CommandLineToArgvW [SHELL32.@]
60 * We must interpret the quotes in the command line to rebuild the argv
61 * array correctly:
62 * - arguments are separated by spaces or tabs
63 * - quotes serve as optional argument delimiters
64 * '"a b"' -> 'a b'
65 * - escaped quotes must be converted back to '"'
66 * '\"' -> '"'
67 * - consecutive backslashes preceding a quote see their number halved with
68 * the remainder escaping the quote:
69 * 2n backslashes + quote -> n backslashes + quote as an argument delimiter
70 * 2n+1 backslashes + quote -> n backslashes + literal quote
71 * - backslashes that are not followed by a quote are copied literally:
72 * 'a\b' -> 'a\b'
73 * 'a\\b' -> 'a\\b'
74 * - in quoted strings, consecutive quotes see their number divided by three
75 * with the remainder modulo 3 deciding whether to close the string or not.
76 * Note that the opening quote must be counted in the consecutive quotes,
77 * that's the (1+) below:
78 * (1+) 3n quotes -> n quotes
79 * (1+) 3n+1 quotes -> n quotes plus closes the quoted string
80 * (1+) 3n+2 quotes -> n+1 quotes plus closes the quoted string
81 * - in unquoted strings, the first quote opens the quoted string and the
82 * remaining consecutive quotes follow the above rule.
84 LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
86 DWORD argc;
87 LPWSTR *argv;
88 LPCWSTR s;
89 LPWSTR d;
90 LPWSTR cmdline;
91 int qcount,bcount;
93 if(!numargs)
95 SetLastError(ERROR_INVALID_PARAMETER);
96 return NULL;
99 if (*lpCmdline==0)
101 /* Return the path to the executable */
102 DWORD len, deslen=MAX_PATH, size;
104 size = sizeof(LPWSTR)*2 + deslen*sizeof(WCHAR);
105 for (;;)
107 if (!(argv = LocalAlloc(LMEM_FIXED, size))) return NULL;
108 len = GetModuleFileNameW(0, (LPWSTR)(argv+2), deslen);
109 if (!len)
111 LocalFree(argv);
112 return NULL;
114 if (len < deslen) break;
115 deslen*=2;
116 size = sizeof(LPWSTR)*2 + deslen*sizeof(WCHAR);
117 LocalFree( argv );
119 argv[0]=(LPWSTR)(argv+2);
120 argv[1]=NULL;
121 *numargs=1;
123 return argv;
126 /* --- First count the arguments */
127 argc=1;
128 s=lpCmdline;
129 /* The first argument, the executable path, follows special rules */
130 if (*s=='"')
132 /* The executable path ends at the next quote, no matter what */
133 s++;
134 while (*s)
135 if (*s++=='"')
136 break;
138 else
140 /* The executable path ends at the next space, no matter what */
141 while (*s && *s!=' ' && *s!='\t')
142 s++;
144 /* skip to the first argument, if any */
145 while (*s==' ' || *s=='\t')
146 s++;
147 if (*s)
148 argc++;
150 /* Analyze the remaining arguments */
151 qcount=bcount=0;
152 while (*s)
154 if ((*s==' ' || *s=='\t') && qcount==0)
156 /* skip to the next argument and count it if any */
157 while (*s==' ' || *s=='\t')
158 s++;
159 if (*s)
160 argc++;
161 bcount=0;
163 else if (*s=='\\')
165 /* '\', count them */
166 bcount++;
167 s++;
169 else if (*s=='"')
171 /* '"' */
172 if ((bcount & 1)==0)
173 qcount++; /* unescaped '"' */
174 s++;
175 bcount=0;
176 /* consecutive quotes, see comment in copying code below */
177 while (*s=='"')
179 qcount++;
180 s++;
182 qcount=qcount % 3;
183 if (qcount==2)
184 qcount=0;
186 else
188 /* a regular character */
189 bcount=0;
190 s++;
194 /* Allocate in a single lump, the string array, and the strings that go
195 * with it. This way the caller can make a single LocalFree() call to free
196 * both, as per MSDN.
198 argv=LocalAlloc(LMEM_FIXED, (argc+1)*sizeof(LPWSTR)+(strlenW(lpCmdline)+1)*sizeof(WCHAR));
199 if (!argv)
200 return NULL;
201 cmdline=(LPWSTR)(argv+argc+1);
202 strcpyW(cmdline, lpCmdline);
204 /* --- Then split and copy the arguments */
205 argv[0]=d=cmdline;
206 argc=1;
207 /* The first argument, the executable path, follows special rules */
208 if (*d=='"')
210 /* The executable path ends at the next quote, no matter what */
211 s=d+1;
212 while (*s)
214 if (*s=='"')
216 s++;
217 break;
219 *d++=*s++;
222 else
224 /* The executable path ends at the next space, no matter what */
225 while (*d && *d!=' ' && *d!='\t')
226 d++;
227 s=d;
228 if (*s)
229 s++;
231 /* close the executable path */
232 *d++=0;
233 /* skip to the first argument and initialize it if any */
234 while (*s==' ' || *s=='\t')
235 s++;
236 if (!*s)
238 /* There are no parameters so we are all done */
239 argv[argc]=NULL;
240 *numargs=argc;
241 return argv;
244 /* Split and copy the remaining arguments */
245 argv[argc++]=d;
246 qcount=bcount=0;
247 while (*s)
249 if ((*s==' ' || *s=='\t') && qcount==0)
251 /* close the argument */
252 *d++=0;
253 bcount=0;
255 /* skip to the next one and initialize it if any */
256 do {
257 s++;
258 } while (*s==' ' || *s=='\t');
259 if (*s)
260 argv[argc++]=d;
262 else if (*s=='\\')
264 *d++=*s++;
265 bcount++;
267 else if (*s=='"')
269 if ((bcount & 1)==0)
271 /* Preceded by an even number of '\', this is half that
272 * number of '\', plus a quote which we erase.
274 d-=bcount/2;
275 qcount++;
277 else
279 /* Preceded by an odd number of '\', this is half that
280 * number of '\' followed by a '"'
282 d=d-bcount/2-1;
283 *d++='"';
285 s++;
286 bcount=0;
287 /* Now count the number of consecutive quotes. Note that qcount
288 * already takes into account the opening quote if any, as well as
289 * the quote that lead us here.
291 while (*s=='"')
293 if (++qcount==3)
295 *d++='"';
296 qcount=0;
298 s++;
300 if (qcount==2)
301 qcount=0;
303 else
305 /* a regular character */
306 *d++=*s++;
307 bcount=0;
310 *d='\0';
311 argv[argc]=NULL;
312 *numargs=argc;
314 return argv;
317 static DWORD shgfi_get_exe_type(LPCWSTR szFullPath)
319 BOOL status = FALSE;
320 HANDLE hfile;
321 DWORD BinaryType;
322 IMAGE_DOS_HEADER mz_header;
323 IMAGE_NT_HEADERS nt;
324 DWORD len;
325 char magic[4];
327 status = GetBinaryTypeW (szFullPath, &BinaryType);
328 if (!status)
329 return 0;
330 if (BinaryType == SCS_DOS_BINARY || BinaryType == SCS_PIF_BINARY)
331 return 0x4d5a;
333 hfile = CreateFileW( szFullPath, GENERIC_READ, FILE_SHARE_READ,
334 NULL, OPEN_EXISTING, 0, 0 );
335 if ( hfile == INVALID_HANDLE_VALUE )
336 return 0;
339 * The next section is adapted from MODULE_GetBinaryType, as we need
340 * to examine the image header to get OS and version information. We
341 * know from calling GetBinaryTypeA that the image is valid and either
342 * an NE or PE, so much error handling can be omitted.
343 * Seek to the start of the file and read the header information.
346 SetFilePointer( hfile, 0, NULL, SEEK_SET );
347 ReadFile( hfile, &mz_header, sizeof(mz_header), &len, NULL );
349 SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
350 ReadFile( hfile, magic, sizeof(magic), &len, NULL );
351 if ( *(DWORD*)magic == IMAGE_NT_SIGNATURE )
353 SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
354 ReadFile( hfile, &nt, sizeof(nt), &len, NULL );
355 CloseHandle( hfile );
356 /* DLL files are not executable and should return 0 */
357 if (nt.FileHeader.Characteristics & IMAGE_FILE_DLL)
358 return 0;
359 if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI)
361 return IMAGE_NT_SIGNATURE |
362 (nt.OptionalHeader.MajorSubsystemVersion << 24) |
363 (nt.OptionalHeader.MinorSubsystemVersion << 16);
365 return IMAGE_NT_SIGNATURE;
367 else if ( *(WORD*)magic == IMAGE_OS2_SIGNATURE )
369 IMAGE_OS2_HEADER ne;
370 SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
371 ReadFile( hfile, &ne, sizeof(ne), &len, NULL );
372 CloseHandle( hfile );
373 if (ne.ne_exetyp == 2)
374 return IMAGE_OS2_SIGNATURE | (ne.ne_expver << 16);
375 return 0;
377 CloseHandle( hfile );
378 return 0;
381 /*************************************************************************
382 * SHELL_IsShortcut [internal]
384 * Decide if an item id list points to a shell shortcut
386 BOOL SHELL_IsShortcut(LPCITEMIDLIST pidlLast)
388 char szTemp[MAX_PATH];
389 HKEY keyCls;
390 BOOL ret = FALSE;
392 if (_ILGetExtension(pidlLast, szTemp, MAX_PATH) &&
393 HCR_MapTypeToValueA(szTemp, szTemp, MAX_PATH, TRUE))
395 if (ERROR_SUCCESS == RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_QUERY_VALUE, &keyCls))
397 if (ERROR_SUCCESS == RegQueryValueExA(keyCls, "IsShortcut", NULL, NULL, NULL, NULL))
398 ret = TRUE;
400 RegCloseKey(keyCls);
404 return ret;
407 #define SHGFI_KNOWN_FLAGS \
408 (SHGFI_SMALLICON | SHGFI_OPENICON | SHGFI_SHELLICONSIZE | SHGFI_PIDL | \
409 SHGFI_USEFILEATTRIBUTES | SHGFI_ADDOVERLAYS | SHGFI_OVERLAYINDEX | \
410 SHGFI_ICON | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ATTRIBUTES | \
411 SHGFI_ICONLOCATION | SHGFI_EXETYPE | SHGFI_SYSICONINDEX | \
412 SHGFI_LINKOVERLAY | SHGFI_SELECTED | SHGFI_ATTR_SPECIFIED)
414 /*************************************************************************
415 * SHGetFileInfoW [SHELL32.@]
418 DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
419 SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags )
421 WCHAR szLocation[MAX_PATH], szFullPath[MAX_PATH];
422 int iIndex;
423 DWORD_PTR ret = TRUE;
424 DWORD dwAttributes = 0;
425 IShellFolder * psfParent = NULL;
426 IExtractIconW * pei = NULL;
427 LPITEMIDLIST pidlLast = NULL, pidl = NULL;
428 HRESULT hr = S_OK;
429 BOOL IconNotYetLoaded=TRUE;
430 UINT uGilFlags = 0;
431 HIMAGELIST big_icons, small_icons;
433 TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n",
434 (flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes,
435 psfi, psfi->dwAttributes, sizeofpsfi, flags);
437 if (!path)
438 return FALSE;
440 /* windows initializes these values regardless of the flags */
441 if (psfi != NULL)
443 psfi->szDisplayName[0] = '\0';
444 psfi->szTypeName[0] = '\0';
445 psfi->iIcon = 0;
448 if (!(flags & SHGFI_PIDL))
450 /* SHGetFileInfo should work with absolute and relative paths */
451 if (PathIsRelativeW(path))
453 GetCurrentDirectoryW(MAX_PATH, szLocation);
454 PathCombineW(szFullPath, szLocation, path);
456 else
458 lstrcpynW(szFullPath, path, MAX_PATH);
462 if (flags & SHGFI_EXETYPE)
464 if (flags != SHGFI_EXETYPE)
465 return 0;
466 return shgfi_get_exe_type(szFullPath);
470 * psfi is NULL normally to query EXE type. If it is NULL, none of the
471 * below makes sense anyway. Windows allows this and just returns FALSE
473 if (psfi == NULL)
474 return FALSE;
477 * translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES
478 * is not specified.
479 * The pidl functions fail on not existing file names
482 if (flags & SHGFI_PIDL)
484 pidl = ILClone((LPCITEMIDLIST)path);
486 else if (!(flags & SHGFI_USEFILEATTRIBUTES))
488 hr = SHILCreateFromPathW(szFullPath, &pidl, &dwAttributes);
491 if ((flags & SHGFI_PIDL) || !(flags & SHGFI_USEFILEATTRIBUTES))
493 /* get the parent shellfolder */
494 if (pidl)
496 hr = SHBindToParent( pidl, &IID_IShellFolder, (LPVOID*)&psfParent,
497 (LPCITEMIDLIST*)&pidlLast );
498 if (SUCCEEDED(hr))
499 pidlLast = ILClone(pidlLast);
500 ILFree(pidl);
502 else
504 ERR("pidl is null!\n");
505 return FALSE;
509 /* get the attributes of the child */
510 if (SUCCEEDED(hr) && (flags & SHGFI_ATTRIBUTES))
512 if (!(flags & SHGFI_ATTR_SPECIFIED))
514 psfi->dwAttributes = 0xffffffff;
516 if (psfParent)
517 IShellFolder_GetAttributesOf( psfParent, 1, (LPCITEMIDLIST*)&pidlLast,
518 &(psfi->dwAttributes) );
521 /* get the displayname */
522 if (SUCCEEDED(hr) && (flags & SHGFI_DISPLAYNAME))
524 if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL))
526 lstrcpyW (psfi->szDisplayName, PathFindFileNameW(szFullPath));
528 else
530 STRRET str;
531 hr = IShellFolder_GetDisplayNameOf( psfParent, pidlLast,
532 SHGDN_INFOLDER, &str);
533 StrRetToStrNW (psfi->szDisplayName, MAX_PATH, &str, pidlLast);
537 /* get the type name */
538 if (SUCCEEDED(hr) && (flags & SHGFI_TYPENAME))
540 static const WCHAR szFile[] = { 'F','i','l','e',0 };
541 static const WCHAR szDashFile[] = { '-','f','i','l','e',0 };
543 if (!(flags & SHGFI_USEFILEATTRIBUTES) || (flags & SHGFI_PIDL))
545 char ftype[80];
547 _ILGetFileType(pidlLast, ftype, 80);
548 MultiByteToWideChar(CP_ACP, 0, ftype, -1, psfi->szTypeName, 80 );
550 else
552 if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
553 strcatW (psfi->szTypeName, szFile);
554 else
556 WCHAR sTemp[64];
558 lstrcpyW(sTemp,PathFindExtensionW(szFullPath));
559 if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) &&
560 HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE )))
562 lstrcpynW (psfi->szTypeName, sTemp, 64);
563 strcatW (psfi->szTypeName, szDashFile);
569 /* ### icons ###*/
571 Shell_GetImageLists( &big_icons, &small_icons );
573 if (flags & SHGFI_OPENICON)
574 uGilFlags |= GIL_OPENICON;
576 if (flags & SHGFI_LINKOVERLAY)
577 uGilFlags |= GIL_FORSHORTCUT;
578 else if ((flags&SHGFI_ADDOVERLAYS) ||
579 (flags&(SHGFI_ICON|SHGFI_SMALLICON))==SHGFI_ICON)
581 if (SHELL_IsShortcut(pidlLast))
582 uGilFlags |= GIL_FORSHORTCUT;
585 if (flags & SHGFI_OVERLAYINDEX)
586 FIXME("SHGFI_OVERLAYINDEX unhandled\n");
588 if (flags & SHGFI_SELECTED)
589 FIXME("set icon to selected, stub\n");
591 if (flags & SHGFI_SHELLICONSIZE)
592 FIXME("set icon to shell size, stub\n");
594 /* get the iconlocation */
595 if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION ))
597 UINT uDummy,uFlags;
599 if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL))
601 if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
603 lstrcpyW(psfi->szDisplayName, swShell32Name);
604 psfi->iIcon = -IDI_SHELL_FOLDER;
606 else
608 WCHAR* szExt;
609 static const WCHAR p1W[] = {'%','1',0};
610 WCHAR sTemp [MAX_PATH];
612 szExt = PathFindExtensionW(szFullPath);
613 TRACE("szExt=%s\n", debugstr_w(szExt));
614 if ( szExt &&
615 HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
616 HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &psfi->iIcon))
618 if (lstrcmpW(p1W, sTemp))
619 strcpyW(psfi->szDisplayName, sTemp);
620 else
622 /* the icon is in the file */
623 strcpyW(psfi->szDisplayName, szFullPath);
626 else
627 ret = FALSE;
630 else
632 hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1,
633 (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconW,
634 &uDummy, (LPVOID*)&pei);
635 if (SUCCEEDED(hr))
637 hr = IExtractIconW_GetIconLocation(pei, uGilFlags,
638 szLocation, MAX_PATH, &iIndex, &uFlags);
640 if (uFlags & GIL_NOTFILENAME)
641 ret = FALSE;
642 else
644 lstrcpyW (psfi->szDisplayName, szLocation);
645 psfi->iIcon = iIndex;
647 IExtractIconW_Release(pei);
652 /* get icon index (or load icon)*/
653 if (SUCCEEDED(hr) && (flags & (SHGFI_ICON | SHGFI_SYSICONINDEX)))
655 if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL))
657 WCHAR sTemp [MAX_PATH];
658 WCHAR * szExt;
659 int icon_idx=0;
661 lstrcpynW(sTemp, szFullPath, MAX_PATH);
663 if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
664 psfi->iIcon = SIC_GetIconIndex(swShell32Name, -IDI_SHELL_FOLDER, 0);
665 else
667 static const WCHAR p1W[] = {'%','1',0};
669 psfi->iIcon = 0;
670 szExt = PathFindExtensionW(sTemp);
671 if ( szExt &&
672 HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
673 HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &icon_idx))
675 if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */
676 strcpyW(sTemp, szFullPath);
678 if (flags & SHGFI_SYSICONINDEX)
680 psfi->iIcon = SIC_GetIconIndex(sTemp,icon_idx,0);
681 if (psfi->iIcon == -1)
682 psfi->iIcon = 0;
684 else
686 UINT ret;
687 if (flags & SHGFI_SMALLICON)
688 ret = PrivateExtractIconsW( sTemp,icon_idx,
689 GetSystemMetrics( SM_CXSMICON ),
690 GetSystemMetrics( SM_CYSMICON ),
691 &psfi->hIcon, 0, 1, 0);
692 else
693 ret = PrivateExtractIconsW( sTemp, icon_idx,
694 GetSystemMetrics( SM_CXICON),
695 GetSystemMetrics( SM_CYICON),
696 &psfi->hIcon, 0, 1, 0);
697 if (ret != 0 && ret != (UINT)-1)
699 IconNotYetLoaded=FALSE;
700 psfi->iIcon = icon_idx;
706 else
708 if (!(PidlToSicIndex(psfParent, pidlLast, !(flags & SHGFI_SMALLICON),
709 uGilFlags, &(psfi->iIcon))))
711 ret = FALSE;
714 if (ret && (flags & SHGFI_SYSICONINDEX))
716 if (flags & SHGFI_SMALLICON)
717 ret = (DWORD_PTR)small_icons;
718 else
719 ret = (DWORD_PTR)big_icons;
723 /* icon handle */
724 if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded)
726 if (flags & SHGFI_SMALLICON)
727 psfi->hIcon = ImageList_GetIcon( small_icons, psfi->iIcon, ILD_NORMAL);
728 else
729 psfi->hIcon = ImageList_GetIcon( big_icons, psfi->iIcon, ILD_NORMAL);
732 if (flags & ~SHGFI_KNOWN_FLAGS)
733 FIXME("unknown flags %08x\n", flags & ~SHGFI_KNOWN_FLAGS);
735 if (psfParent)
736 IShellFolder_Release(psfParent);
738 if (hr != S_OK)
739 ret = FALSE;
741 SHFree(pidlLast);
743 TRACE ("icon=%p index=0x%08x attr=0x%08x name=%s type=%s ret=0x%08lx\n",
744 psfi->hIcon, psfi->iIcon, psfi->dwAttributes,
745 debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret);
747 return ret;
750 /*************************************************************************
751 * SHGetFileInfoA [SHELL32.@]
753 * Note:
754 * MSVBVM60.__vbaNew2 expects this function to return a value in range
755 * 1 .. 0x7fff when the function succeeds and flags does not contain
756 * SHGFI_EXETYPE or SHGFI_SYSICONINDEX (see bug 7701)
758 DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
759 SHFILEINFOA *psfi, UINT sizeofpsfi,
760 UINT flags )
762 INT len;
763 LPWSTR temppath = NULL;
764 LPCWSTR pathW;
765 DWORD_PTR ret;
766 SHFILEINFOW temppsfi;
768 if (flags & SHGFI_PIDL)
770 /* path contains a pidl */
771 pathW = (LPCWSTR)path;
773 else
775 len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0);
776 temppath = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
777 MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len);
778 pathW = temppath;
781 if (psfi && (flags & SHGFI_ATTR_SPECIFIED))
782 temppsfi.dwAttributes=psfi->dwAttributes;
784 if (psfi == NULL)
785 ret = SHGetFileInfoW(pathW, dwFileAttributes, NULL, sizeof(temppsfi), flags);
786 else
787 ret = SHGetFileInfoW(pathW, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
789 if (psfi)
791 if(flags & SHGFI_ICON)
792 psfi->hIcon=temppsfi.hIcon;
793 if(flags & (SHGFI_SYSICONINDEX|SHGFI_ICON|SHGFI_ICONLOCATION))
794 psfi->iIcon=temppsfi.iIcon;
795 if(flags & SHGFI_ATTRIBUTES)
796 psfi->dwAttributes=temppsfi.dwAttributes;
797 if(flags & (SHGFI_DISPLAYNAME|SHGFI_ICONLOCATION))
799 WideCharToMultiByte(CP_ACP, 0, temppsfi.szDisplayName, -1,
800 psfi->szDisplayName, sizeof(psfi->szDisplayName), NULL, NULL);
802 if(flags & SHGFI_TYPENAME)
804 WideCharToMultiByte(CP_ACP, 0, temppsfi.szTypeName, -1,
805 psfi->szTypeName, sizeof(psfi->szTypeName), NULL, NULL);
809 HeapFree(GetProcessHeap(), 0, temppath);
811 return ret;
814 /*************************************************************************
815 * DuplicateIcon [SHELL32.@]
817 HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon)
819 ICONINFO IconInfo;
820 HICON hDupIcon = 0;
822 TRACE("%p %p\n", hInstance, hIcon);
824 if (GetIconInfo(hIcon, &IconInfo))
826 hDupIcon = CreateIconIndirect(&IconInfo);
828 /* clean up hbmMask and hbmColor */
829 DeleteObject(IconInfo.hbmMask);
830 DeleteObject(IconInfo.hbmColor);
833 return hDupIcon;
836 /*************************************************************************
837 * ExtractIconA [SHELL32.@]
839 HICON WINAPI ExtractIconA(HINSTANCE hInstance, LPCSTR lpszFile, UINT nIconIndex)
841 HICON ret;
842 INT len = MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, NULL, 0);
843 LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
845 TRACE("%p %s %d\n", hInstance, lpszFile, nIconIndex);
847 MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len);
848 ret = ExtractIconW(hInstance, lpwstrFile, nIconIndex);
849 HeapFree(GetProcessHeap(), 0, lpwstrFile);
851 return ret;
854 /*************************************************************************
855 * ExtractIconW [SHELL32.@]
857 HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex)
859 HICON hIcon = NULL;
860 UINT ret;
861 UINT cx = GetSystemMetrics(SM_CXICON), cy = GetSystemMetrics(SM_CYICON);
863 TRACE("%p %s %d\n", hInstance, debugstr_w(lpszFile), nIconIndex);
865 if (nIconIndex == (UINT)-1)
867 ret = PrivateExtractIconsW(lpszFile, 0, cx, cy, NULL, NULL, 0, LR_DEFAULTCOLOR);
868 if (ret != (UINT)-1 && ret)
869 return (HICON)(UINT_PTR)ret;
870 return NULL;
872 else
873 ret = PrivateExtractIconsW(lpszFile, nIconIndex, cx, cy, &hIcon, NULL, 1, LR_DEFAULTCOLOR);
875 if (ret == (UINT)-1)
876 return (HICON)1;
877 else if (ret > 0 && hIcon)
878 return hIcon;
880 return NULL;
883 HRESULT WINAPI SHCreateFileExtractIconW(LPCWSTR file, DWORD attribs, REFIID riid, void **ppv)
885 FIXME("%s, %x, %s, %p\n", debugstr_w(file), attribs, debugstr_guid(riid), ppv);
886 *ppv = NULL;
887 return E_NOTIMPL;
890 /*************************************************************************
891 * Printer_LoadIconsW [SHELL32.205]
893 VOID WINAPI Printer_LoadIconsW(LPCWSTR wsPrinterName, HICON * pLargeIcon, HICON * pSmallIcon)
895 INT iconindex=IDI_SHELL_PRINTER;
897 TRACE("(%s, %p, %p)\n", debugstr_w(wsPrinterName), pLargeIcon, pSmallIcon);
899 /* We should check if wsPrinterName is
900 1. the Default Printer or not
901 2. connected or not
902 3. a Local Printer or a Network-Printer
903 and use different Icons
905 if((wsPrinterName != NULL) && (wsPrinterName[0] != 0))
907 FIXME("(select Icon by PrinterName %s not implemented)\n", debugstr_w(wsPrinterName));
910 if(pLargeIcon != NULL)
911 *pLargeIcon = LoadImageW(shell32_hInstance,
912 (LPCWSTR) MAKEINTRESOURCE(iconindex), IMAGE_ICON,
913 0, 0, LR_DEFAULTCOLOR|LR_DEFAULTSIZE);
915 if(pSmallIcon != NULL)
916 *pSmallIcon = LoadImageW(shell32_hInstance,
917 (LPCWSTR) MAKEINTRESOURCE(iconindex), IMAGE_ICON,
918 16, 16, LR_DEFAULTCOLOR);
921 /*************************************************************************
922 * Printers_RegisterWindowW [SHELL32.213]
923 * used by "printui.dll":
924 * find the Window of the given Type for the specific Printer and
925 * return the already existent hwnd or open a new window
927 BOOL WINAPI Printers_RegisterWindowW(LPCWSTR wsPrinter, DWORD dwType,
928 HANDLE * phClassPidl, HWND * phwnd)
930 FIXME("(%s, %x, %p (%p), %p (%p)) stub!\n", debugstr_w(wsPrinter), dwType,
931 phClassPidl, (phClassPidl != NULL) ? *(phClassPidl) : NULL,
932 phwnd, (phwnd != NULL) ? *(phwnd) : NULL);
934 return FALSE;
937 /*************************************************************************
938 * Printers_UnregisterWindow [SHELL32.214]
940 VOID WINAPI Printers_UnregisterWindow(HANDLE hClassPidl, HWND hwnd)
942 FIXME("(%p, %p) stub!\n", hClassPidl, hwnd);
945 /*************************************************************************
946 * SHGetPropertyStoreForWindow [SHELL32.@]
948 HRESULT WINAPI SHGetPropertyStoreForWindow(HWND hwnd, REFIID riid, void **ppv)
950 FIXME("(%p %p %p) stub!\n", hwnd, riid, ppv);
951 return E_NOTIMPL;
954 /*************************************************************************
955 * SHGetPropertyStoreFromParsingName [SHELL32.@]
957 HRESULT WINAPI SHGetPropertyStoreFromParsingName(PCWSTR pszPath, IBindCtx *pbc, GETPROPERTYSTOREFLAGS flags, REFIID riid, void **ppv)
959 FIXME("(%s %p %u %p %p) stub!\n", debugstr_w(pszPath), pbc, flags, riid, ppv);
960 return E_NOTIMPL;
963 /*************************************************************************/
965 typedef struct
967 LPCWSTR szApp;
968 LPCWSTR szOtherStuff;
969 HICON hIcon;
970 HFONT hFont;
971 } ABOUT_INFO;
973 #define DROP_FIELD_TOP (-12)
975 static void paint_dropline( HDC hdc, HWND hWnd )
977 HWND hWndCtl = GetDlgItem(hWnd, IDC_ABOUT_WINE_TEXT);
978 RECT rect;
980 if (!hWndCtl) return;
981 GetWindowRect( hWndCtl, &rect );
982 MapWindowPoints( 0, hWnd, (LPPOINT)&rect, 2 );
983 rect.top += DROP_FIELD_TOP;
984 rect.bottom = rect.top + 2;
985 DrawEdge( hdc, &rect, BDR_SUNKENOUTER, BF_RECT );
988 /*************************************************************************
989 * SHHelpShortcuts_RunDLLA [SHELL32.@]
992 DWORD WINAPI SHHelpShortcuts_RunDLLA(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
994 FIXME("(%x, %x, %x, %x) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4);
995 return 0;
998 /*************************************************************************
999 * SHHelpShortcuts_RunDLLA [SHELL32.@]
1002 DWORD WINAPI SHHelpShortcuts_RunDLLW(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
1004 FIXME("(%x, %x, %x, %x) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4);
1005 return 0;
1008 /*************************************************************************
1009 * SHLoadInProc [SHELL32.@]
1010 * Create an instance of specified object class from within
1011 * the shell process and release it immediately
1013 HRESULT WINAPI SHLoadInProc (REFCLSID rclsid)
1015 void *ptr = NULL;
1017 TRACE("%s\n", debugstr_guid(rclsid));
1019 CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown,&ptr);
1020 if(ptr)
1022 IUnknown * pUnk = ptr;
1023 IUnknown_Release(pUnk);
1024 return S_OK;
1026 return DISP_E_MEMBERNOTFOUND;
1029 static void add_authors( HWND list )
1031 static const WCHAR eol[] = {'\r','\n',0};
1032 static const WCHAR authors[] = {'A','U','T','H','O','R','S',0};
1033 WCHAR *strW, *start, *end;
1034 HRSRC rsrc = FindResourceW( shell32_hInstance, authors, (LPCWSTR)RT_RCDATA );
1035 char *strA = LockResource( LoadResource( shell32_hInstance, rsrc ));
1036 DWORD sizeW, sizeA = SizeofResource( shell32_hInstance, rsrc );
1038 if (!strA) return;
1039 sizeW = MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, NULL, 0 ) + 1;
1040 if (!(strW = HeapAlloc( GetProcessHeap(), 0, sizeW * sizeof(WCHAR) ))) return;
1041 MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, strW, sizeW );
1042 strW[sizeW - 1] = 0;
1044 start = strpbrkW( strW, eol ); /* skip the header line */
1045 while (start)
1047 while (*start && strchrW( eol, *start )) start++;
1048 if (!*start) break;
1049 end = strpbrkW( start, eol );
1050 if (end) *end++ = 0;
1051 SendMessageW( list, LB_ADDSTRING, -1, (LPARAM)start );
1052 start = end;
1054 HeapFree( GetProcessHeap(), 0, strW );
1057 /*************************************************************************
1058 * AboutDlgProc (internal)
1060 static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
1061 LPARAM lParam )
1063 HWND hWndCtl;
1065 TRACE("\n");
1067 switch(msg)
1069 case WM_INITDIALOG:
1071 ABOUT_INFO *info = (ABOUT_INFO *)lParam;
1072 WCHAR template[512], buffer[512], version[64];
1073 extern const char *wine_get_build_id(void);
1075 if (info)
1077 SendDlgItemMessageW(hWnd, stc1, STM_SETICON,(WPARAM)info->hIcon, 0);
1078 GetWindowTextW( hWnd, template, sizeof(template)/sizeof(WCHAR) );
1079 sprintfW( buffer, template, info->szApp );
1080 SetWindowTextW( hWnd, buffer );
1081 SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT1), info->szApp );
1082 SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT2), info->szOtherStuff );
1083 GetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT3),
1084 template, sizeof(template)/sizeof(WCHAR) );
1085 MultiByteToWideChar( CP_UTF8, 0, wine_get_build_id(), -1,
1086 version, sizeof(version)/sizeof(WCHAR) );
1087 sprintfW( buffer, template, version );
1088 SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT3), buffer );
1089 hWndCtl = GetDlgItem(hWnd, IDC_ABOUT_LISTBOX);
1090 SendMessageW( hWndCtl, WM_SETREDRAW, 0, 0 );
1091 SendMessageW( hWndCtl, WM_SETFONT, (WPARAM)info->hFont, 0 );
1092 add_authors( hWndCtl );
1093 SendMessageW( hWndCtl, WM_SETREDRAW, 1, 0 );
1096 return 1;
1098 case WM_PAINT:
1100 PAINTSTRUCT ps;
1101 HDC hDC = BeginPaint( hWnd, &ps );
1102 paint_dropline( hDC, hWnd );
1103 EndPaint( hWnd, &ps );
1105 break;
1107 case WM_COMMAND:
1108 if (wParam == IDOK || wParam == IDCANCEL)
1110 EndDialog(hWnd, TRUE);
1111 return TRUE;
1113 if (wParam == IDC_ABOUT_LICENSE)
1115 MSGBOXPARAMSW params;
1117 params.cbSize = sizeof(params);
1118 params.hwndOwner = hWnd;
1119 params.hInstance = shell32_hInstance;
1120 params.lpszText = MAKEINTRESOURCEW(IDS_LICENSE);
1121 params.lpszCaption = MAKEINTRESOURCEW(IDS_LICENSE_CAPTION);
1122 params.dwStyle = MB_ICONINFORMATION | MB_OK;
1123 params.lpszIcon = 0;
1124 params.dwContextHelpId = 0;
1125 params.lpfnMsgBoxCallback = NULL;
1126 params.dwLanguageId = LANG_NEUTRAL;
1127 MessageBoxIndirectW( &params );
1129 break;
1130 case WM_CLOSE:
1131 EndDialog(hWnd, TRUE);
1132 break;
1135 return 0;
1139 /*************************************************************************
1140 * ShellAboutA [SHELL32.288]
1142 BOOL WINAPI ShellAboutA( HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon )
1144 BOOL ret;
1145 LPWSTR appW = NULL, otherW = NULL;
1146 int len;
1148 if (szApp)
1150 len = MultiByteToWideChar(CP_ACP, 0, szApp, -1, NULL, 0);
1151 appW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1152 MultiByteToWideChar(CP_ACP, 0, szApp, -1, appW, len);
1154 if (szOtherStuff)
1156 len = MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, NULL, 0);
1157 otherW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1158 MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, otherW, len);
1161 ret = ShellAboutW(hWnd, appW, otherW, hIcon);
1163 HeapFree(GetProcessHeap(), 0, otherW);
1164 HeapFree(GetProcessHeap(), 0, appW);
1165 return ret;
1169 /*************************************************************************
1170 * ShellAboutW [SHELL32.289]
1172 BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
1173 HICON hIcon )
1175 ABOUT_INFO info;
1176 LOGFONTW logFont;
1177 BOOL bRet;
1178 static const WCHAR wszSHELL_ABOUT_MSGBOX[] =
1179 {'S','H','E','L','L','_','A','B','O','U','T','_','M','S','G','B','O','X',0};
1181 TRACE("\n");
1183 if (!hIcon) hIcon = LoadImageW( 0, (LPWSTR)IDI_WINLOGO, IMAGE_ICON, 48, 48, LR_SHARED );
1184 info.szApp = szApp;
1185 info.szOtherStuff = szOtherStuff;
1186 info.hIcon = hIcon;
1188 SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 );
1189 info.hFont = CreateFontIndirectW( &logFont );
1191 bRet = DialogBoxParamW( shell32_hInstance, wszSHELL_ABOUT_MSGBOX, hWnd, AboutDlgProc, (LPARAM)&info );
1192 DeleteObject(info.hFont);
1193 return bRet;
1196 /*************************************************************************
1197 * FreeIconList (SHELL32.@)
1199 void WINAPI FreeIconList( DWORD dw )
1201 FIXME("%x: stub\n",dw);
1204 /*************************************************************************
1205 * SHLoadNonloadedIconOverlayIdentifiers (SHELL32.@)
1207 HRESULT WINAPI SHLoadNonloadedIconOverlayIdentifiers( VOID )
1209 FIXME("stub\n");
1210 return S_OK;
1213 /***********************************************************************
1214 * DllGetVersion [SHELL32.@]
1216 * Retrieves version information of the 'SHELL32.DLL'
1218 * PARAMS
1219 * pdvi [O] pointer to version information structure.
1221 * RETURNS
1222 * Success: S_OK
1223 * Failure: E_INVALIDARG
1225 * NOTES
1226 * Returns version of a shell32.dll from IE4.01 SP1.
1229 HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
1231 /* FIXME: shouldn't these values come from the version resource? */
1232 if (pdvi->cbSize == sizeof(DLLVERSIONINFO) ||
1233 pdvi->cbSize == sizeof(DLLVERSIONINFO2))
1235 pdvi->dwMajorVersion = WINE_FILEVERSION_MAJOR;
1236 pdvi->dwMinorVersion = WINE_FILEVERSION_MINOR;
1237 pdvi->dwBuildNumber = WINE_FILEVERSION_BUILD;
1238 pdvi->dwPlatformID = WINE_FILEVERSION_PLATFORMID;
1239 if (pdvi->cbSize == sizeof(DLLVERSIONINFO2))
1241 DLLVERSIONINFO2 *pdvi2 = (DLLVERSIONINFO2 *)pdvi;
1243 pdvi2->dwFlags = 0;
1244 pdvi2->ullVersion = MAKEDLLVERULL(WINE_FILEVERSION_MAJOR,
1245 WINE_FILEVERSION_MINOR,
1246 WINE_FILEVERSION_BUILD,
1247 WINE_FILEVERSION_PLATFORMID);
1249 TRACE("%u.%u.%u.%u\n",
1250 pdvi->dwMajorVersion, pdvi->dwMinorVersion,
1251 pdvi->dwBuildNumber, pdvi->dwPlatformID);
1252 return S_OK;
1254 else
1256 WARN("wrong DLLVERSIONINFO size from app\n");
1257 return E_INVALIDARG;
1261 /*************************************************************************
1262 * global variables of the shell32.dll
1263 * all are once per process
1266 HINSTANCE shell32_hInstance = 0;
1269 /*************************************************************************
1270 * SHELL32 DllMain
1272 * NOTES
1273 * calling oleinitialize here breaks some apps.
1275 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
1277 TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad);
1279 switch (fdwReason)
1281 case DLL_PROCESS_ATTACH:
1282 shell32_hInstance = hinstDLL;
1283 DisableThreadLibraryCalls(shell32_hInstance);
1285 /* get full path to this DLL for IExtractIconW_fnGetIconLocation() */
1286 GetModuleFileNameW(hinstDLL, swShell32Name, MAX_PATH);
1287 swShell32Name[MAX_PATH - 1] = '\0';
1289 InitChangeNotifications();
1290 break;
1292 case DLL_PROCESS_DETACH:
1293 if (fImpLoad) break;
1294 SIC_Destroy();
1295 FreeChangeNotifications();
1296 release_desktop_folder();
1297 release_typelib();
1298 break;
1300 return TRUE;
1303 /*************************************************************************
1304 * DllInstall [SHELL32.@]
1306 * PARAMETERS
1308 * BOOL bInstall - TRUE for install, FALSE for uninstall
1309 * LPCWSTR pszCmdLine - command line (unused by shell32?)
1312 HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
1314 FIXME("%s %s: stub\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline));
1315 return S_OK; /* indicate success */
1318 /***********************************************************************
1319 * DllCanUnloadNow (SHELL32.@)
1321 HRESULT WINAPI DllCanUnloadNow(void)
1323 return S_FALSE;
1326 /***********************************************************************
1327 * DllRegisterServer (SHELL32.@)
1329 HRESULT WINAPI DllRegisterServer(void)
1331 HRESULT hr = __wine_register_resources( shell32_hInstance );
1332 if (SUCCEEDED(hr)) hr = SHELL_RegisterShellFolders();
1333 return hr;
1336 /***********************************************************************
1337 * DllUnregisterServer (SHELL32.@)
1339 HRESULT WINAPI DllUnregisterServer(void)
1341 return __wine_unregister_resources( shell32_hInstance );
1344 /***********************************************************************
1345 * ExtractVersionResource16W (SHELL32.@)
1347 BOOL WINAPI ExtractVersionResource16W(LPWSTR s, DWORD d)
1349 FIXME("(%s %x) stub!\n", debugstr_w(s), d);
1350 return FALSE;
1353 /***********************************************************************
1354 * InitNetworkAddressControl (SHELL32.@)
1356 BOOL WINAPI InitNetworkAddressControl(void)
1358 FIXME("stub\n");
1359 return FALSE;
1362 /***********************************************************************
1363 * ShellHookProc (SHELL32.@)
1365 LRESULT CALLBACK ShellHookProc(DWORD a, DWORD b, DWORD c)
1367 FIXME("Stub\n");
1368 return 0;
1371 /***********************************************************************
1372 * SHGetLocalizedName (SHELL32.@)
1374 HRESULT WINAPI SHGetLocalizedName(LPCWSTR path, LPWSTR module, UINT size, INT *res)
1376 FIXME("%s %p %u %p: stub\n", debugstr_w(path), module, size, res);
1377 return E_NOTIMPL;
1380 /***********************************************************************
1381 * SetCurrentProcessExplicitAppUserModelID (SHELL32.@)
1383 HRESULT WINAPI SetCurrentProcessExplicitAppUserModelID(PCWSTR appid)
1385 FIXME("%s: stub\n", debugstr_w(appid));
1386 return E_NOTIMPL;
1389 /***********************************************************************
1390 * GetCurrentProcessExplicitAppUserModelID (SHELL32.@)
1392 HRESULT WINAPI GetCurrentProcessExplicitAppUserModelID(PWSTR *appid)
1394 FIXME("%p: stub\n", appid);
1395 *appid = NULL;
1396 return E_NOTIMPL;
1399 /***********************************************************************
1400 * SHSetUnreadMailCountW (SHELL32.@)
1402 HRESULT WINAPI SHSetUnreadMailCountW(LPCWSTR mailaddress, DWORD count, LPCWSTR executecommand)
1404 FIXME("%s %x %s: stub\n", debugstr_w(mailaddress), count, debugstr_w(executecommand));
1405 return E_NOTIMPL;
1408 /***********************************************************************
1409 * SHEnumerateUnreadMailAccountsW (SHELL32.@)
1411 HRESULT WINAPI SHEnumerateUnreadMailAccountsW(HKEY user, DWORD idx, LPWSTR mailaddress, INT mailaddresslen)
1413 FIXME("%p %d %p %d: stub\n", user, idx, mailaddress, mailaddresslen);
1414 return E_NOTIMPL;
1417 /***********************************************************************
1418 * SHQueryUserNotificationState (SHELL32.@)
1420 HRESULT WINAPI SHQueryUserNotificationState(QUERY_USER_NOTIFICATION_STATE *state)
1422 FIXME("%p: stub\n", state);
1423 *state = QUNS_ACCEPTS_NOTIFICATIONS;
1424 return S_OK;