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
23 #include "shell32_version.h"
24 #include <reactos/version.h>
26 WINE_DEFAULT_DEBUG_CHANNEL(shell
);
28 const char * const SHELL_Authors
[] = { "Copyright 1993-"COPYRIGHT_YEAR
" WINE team", "Copyright 1998-"COPYRIGHT_YEAR
" ReactOS Team", 0 };
31 /*************************************************************************
32 * CommandLineToArgvW [SHELL32.@]
34 * We must interpret the quotes in the command line to rebuild the argv
36 * - arguments are separated by spaces or tabs
37 * - quotes serve as optional argument delimiters
39 * - escaped quotes must be converted back to '"'
41 * - consecutive backslashes preceding a quote see their number halved with
42 * the remainder escaping the quote:
43 * 2n backslashes + quote -> n backslashes + quote as an argument delimiter
44 * 2n+1 backslashes + quote -> n backslashes + literal quote
45 * - backslashes that are not followed by a quote are copied literally:
48 * - in quoted strings, consecutive quotes see their number divided by three
49 * with the remainder modulo 3 deciding whether to close the string or not.
50 * Note that the opening quote must be counted in the consecutive quotes,
51 * that's the (1+) below:
52 * (1+) 3n quotes -> n quotes
53 * (1+) 3n+1 quotes -> n quotes plus closes the quoted string
54 * (1+) 3n+2 quotes -> n+1 quotes plus closes the quoted string
55 * - in unquoted strings, the first quote opens the quoted string and the
56 * remaining consecutive quotes follow the above rule.
58 LPWSTR
* WINAPI
CommandLineToArgvW(LPCWSTR lpCmdline
, int* numargs
)
69 SetLastError(ERROR_INVALID_PARAMETER
);
75 /* Return the path to the executable */
76 DWORD len
, deslen
=MAX_PATH
, size
;
78 size
= sizeof(LPWSTR
) + deslen
*sizeof(WCHAR
) + sizeof(LPWSTR
);
81 if (!(argv
= (LPWSTR
*)LocalAlloc(LMEM_FIXED
, size
))) return NULL
;
82 len
= GetModuleFileNameW(0, (LPWSTR
)(argv
+1), deslen
);
88 if (len
< deslen
) break;
90 size
= sizeof(LPWSTR
) + deslen
*sizeof(WCHAR
) + sizeof(LPWSTR
);
93 argv
[0]=(LPWSTR
)(argv
+1);
99 /* --- First count the arguments */
102 /* The first argument, the executable path, follows special rules */
105 /* The executable path ends at the next quote, no matter what */
113 /* The executable path ends at the next space, no matter what */
114 while (*s
&& *s
!=' ' && *s
!='\t')
117 /* skip to the first argument, if any */
118 while (*s
==' ' || *s
=='\t')
123 /* Analyze the remaining arguments */
127 if ((*s
==' ' || *s
=='\t') && qcount
==0)
129 /* skip to the next argument and count it if any */
130 while (*s
==' ' || *s
=='\t')
138 /* '\', count them */
146 qcount
++; /* unescaped '"' */
149 /* consecutive quotes, see comment in copying code below */
161 /* a regular character */
167 /* Allocate in a single lump, the string array, and the strings that go
168 * with it. This way the caller can make a single LocalFree() call to free
171 argv
=(LPWSTR
*)LocalAlloc(LMEM_FIXED
, argc
*sizeof(LPWSTR
)+(strlenW(lpCmdline
)+1)*sizeof(WCHAR
));
174 cmdline
=(LPWSTR
)(argv
+argc
);
175 strcpyW(cmdline
, lpCmdline
);
177 /* --- Then split and copy the arguments */
180 /* The first argument, the executable path, follows special rules */
183 /* The executable path ends at the next quote, no matter what */
197 /* The executable path ends at the next space, no matter what */
198 while (*d
&& *d
!=' ' && *d
!='\t')
204 /* close the executable path */
206 /* skip to the first argument and initialize it if any */
207 while (*s
==' ' || *s
=='\t')
211 /* There are no parameters so we are all done */
216 /* Split and copy the remaining arguments */
221 if ((*s
==' ' || *s
=='\t') && qcount
==0)
223 /* close the argument */
227 /* skip to the next one and initialize it if any */
230 } while (*s
==' ' || *s
=='\t');
243 /* Preceded by an even number of '\', this is half that
244 * number of '\', plus a quote which we erase.
251 /* Preceded by an odd number of '\', this is half that
252 * number of '\' followed by a '"'
259 /* Now count the number of consecutive quotes. Note that qcount
260 * already takes into account the opening quote if any, as well as
261 * the quote that lead us here.
277 /* a regular character */
288 static DWORD
shgfi_get_exe_type(LPCWSTR szFullPath
)
293 IMAGE_DOS_HEADER mz_header
;
298 status
= GetBinaryTypeW (szFullPath
, &BinaryType
);
301 if (BinaryType
== SCS_DOS_BINARY
|| BinaryType
== SCS_PIF_BINARY
)
304 hfile
= CreateFileW( szFullPath
, GENERIC_READ
, FILE_SHARE_READ
,
305 NULL
, OPEN_EXISTING
, 0, 0 );
306 if ( hfile
== INVALID_HANDLE_VALUE
)
310 * The next section is adapted from MODULE_GetBinaryType, as we need
311 * to examine the image header to get OS and version information. We
312 * know from calling GetBinaryTypeA that the image is valid and either
313 * an NE or PE, so much error handling can be omitted.
314 * Seek to the start of the file and read the header information.
317 SetFilePointer( hfile
, 0, NULL
, SEEK_SET
);
318 ReadFile( hfile
, &mz_header
, sizeof(mz_header
), &len
, NULL
);
320 SetFilePointer( hfile
, mz_header
.e_lfanew
, NULL
, SEEK_SET
);
321 ReadFile( hfile
, magic
, sizeof(magic
), &len
, NULL
);
323 if ( *(DWORD
*)magic
== IMAGE_NT_SIGNATURE
)
325 SetFilePointer( hfile
, mz_header
.e_lfanew
, NULL
, SEEK_SET
);
326 ReadFile( hfile
, &nt
, sizeof(nt
), &len
, NULL
);
327 CloseHandle( hfile
);
329 /* DLL files are not executable and should return 0 */
330 if (nt
.FileHeader
.Characteristics
& IMAGE_FILE_DLL
)
333 if (nt
.OptionalHeader
.Subsystem
== IMAGE_SUBSYSTEM_WINDOWS_GUI
)
335 return IMAGE_NT_SIGNATURE
|
336 (nt
.OptionalHeader
.MajorSubsystemVersion
<< 24) |
337 (nt
.OptionalHeader
.MinorSubsystemVersion
<< 16);
339 return IMAGE_NT_SIGNATURE
;
341 else if ( *(WORD
*)magic
== IMAGE_OS2_SIGNATURE
)
344 SetFilePointer( hfile
, mz_header
.e_lfanew
, NULL
, SEEK_SET
);
345 ReadFile( hfile
, &ne
, sizeof(ne
), &len
, NULL
);
346 CloseHandle( hfile
);
348 if (ne
.ne_exetyp
== 2)
349 return IMAGE_OS2_SIGNATURE
| (ne
.ne_expver
<< 16);
352 CloseHandle( hfile
);
356 /*************************************************************************
357 * SHELL_IsShortcut [internal]
359 * Decide if an item id list points to a shell shortcut
361 BOOL
SHELL_IsShortcut(LPCITEMIDLIST pidlLast
)
363 char szTemp
[MAX_PATH
];
367 if (_ILGetExtension(pidlLast
, szTemp
, MAX_PATH
) &&
368 HCR_MapTypeToValueA(szTemp
, szTemp
, MAX_PATH
, TRUE
))
370 if (ERROR_SUCCESS
== RegOpenKeyExA(HKEY_CLASSES_ROOT
, szTemp
, 0, KEY_QUERY_VALUE
, &keyCls
))
372 if (ERROR_SUCCESS
== RegQueryValueExA(keyCls
, "IsShortcut", NULL
, NULL
, NULL
, NULL
))
382 #define SHGFI_KNOWN_FLAGS \
383 (SHGFI_SMALLICON | SHGFI_OPENICON | SHGFI_SHELLICONSIZE | SHGFI_PIDL | \
384 SHGFI_USEFILEATTRIBUTES | SHGFI_ADDOVERLAYS | SHGFI_OVERLAYINDEX | \
385 SHGFI_ICON | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ATTRIBUTES | \
386 SHGFI_ICONLOCATION | SHGFI_EXETYPE | SHGFI_SYSICONINDEX | \
387 SHGFI_LINKOVERLAY | SHGFI_SELECTED | SHGFI_ATTR_SPECIFIED)
389 /*************************************************************************
390 * SHGetFileInfoW [SHELL32.@]
393 DWORD_PTR WINAPI
SHGetFileInfoW(LPCWSTR path
,DWORD dwFileAttributes
,
394 SHFILEINFOW
*psfi
, UINT sizeofpsfi
, UINT flags
)
396 WCHAR szLocation
[MAX_PATH
], szFullPath
[MAX_PATH
];
398 DWORD_PTR ret
= TRUE
;
399 DWORD dwAttributes
= 0;
400 CComPtr
<IShellFolder
> psfParent
;
401 CComPtr
<IExtractIconW
> pei
;
402 LPITEMIDLIST pidlLast
= NULL
, pidl
= NULL
;
404 BOOL IconNotYetLoaded
=TRUE
;
407 TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n",
408 (flags
& SHGFI_PIDL
)? "pidl" : debugstr_w(path
), dwFileAttributes
,
409 psfi
, psfi
->dwAttributes
, sizeofpsfi
, flags
);
414 /* windows initializes these values regardless of the flags */
417 psfi
->szDisplayName
[0] = '\0';
418 psfi
->szTypeName
[0] = '\0';
422 if (!(flags
& SHGFI_PIDL
))
424 /* SHGetFileInfo should work with absolute and relative paths */
425 if (PathIsRelativeW(path
))
427 GetCurrentDirectoryW(MAX_PATH
, szLocation
);
428 PathCombineW(szFullPath
, szLocation
, path
);
432 lstrcpynW(szFullPath
, path
, MAX_PATH
);
436 if (flags
& SHGFI_EXETYPE
)
438 if (flags
!= SHGFI_EXETYPE
)
440 return shgfi_get_exe_type(szFullPath
);
444 * psfi is NULL normally to query EXE type. If it is NULL, none of the
445 * below makes sense anyway. Windows allows this and just returns FALSE
451 * translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES
453 * The pidl functions fail on not existing file names
456 if (flags
& SHGFI_PIDL
)
458 pidl
= ILClone((LPCITEMIDLIST
)path
);
460 else if (!(flags
& SHGFI_USEFILEATTRIBUTES
))
462 hr
= SHILCreateFromPathW(szFullPath
, &pidl
, &dwAttributes
);
465 if ((flags
& SHGFI_PIDL
) || !(flags
& SHGFI_USEFILEATTRIBUTES
))
467 /* get the parent shellfolder */
470 hr
= SHBindToParent( pidl
, IID_PPV_ARG(IShellFolder
, &psfParent
),
471 (LPCITEMIDLIST
*)&pidlLast
);
473 pidlLast
= ILClone(pidlLast
);
478 ERR("pidl is null!\n");
483 /* get the attributes of the child */
484 if (SUCCEEDED(hr
) && (flags
& SHGFI_ATTRIBUTES
))
486 if (!(flags
& SHGFI_ATTR_SPECIFIED
))
488 psfi
->dwAttributes
= 0xffffffff;
490 if (psfParent
!= NULL
)
491 psfParent
->GetAttributesOf(1, (LPCITEMIDLIST
*)&pidlLast
,
492 &(psfi
->dwAttributes
) );
495 /* get the displayname */
496 if (SUCCEEDED(hr
) && (flags
& SHGFI_DISPLAYNAME
))
498 if (flags
& SHGFI_USEFILEATTRIBUTES
)
500 wcscpy (psfi
->szDisplayName
, PathFindFileNameW(szFullPath
));
505 hr
= psfParent
->GetDisplayNameOf(pidlLast
,
506 SHGDN_INFOLDER
, &str
);
507 StrRetToStrNW (psfi
->szDisplayName
, MAX_PATH
, &str
, pidlLast
);
511 /* get the type name */
512 if (SUCCEEDED(hr
) && (flags
& SHGFI_TYPENAME
))
514 static const WCHAR szFile
[] = { 'F','i','l','e',0 };
515 static const WCHAR szDashFile
[] = { '-','f','i','l','e',0 };
517 if (!(flags
& SHGFI_USEFILEATTRIBUTES
))
521 _ILGetFileType(pidlLast
, ftype
, 80);
522 MultiByteToWideChar(CP_ACP
, 0, ftype
, -1, psfi
->szTypeName
, 80 );
526 if (dwFileAttributes
& FILE_ATTRIBUTE_DIRECTORY
)
527 wcscat (psfi
->szTypeName
, szFile
);
532 wcscpy(sTemp
,PathFindExtensionW(szFullPath
));
533 if (!( HCR_MapTypeToValueW(sTemp
, sTemp
, 64, TRUE
) &&
534 HCR_MapTypeToValueW(sTemp
, psfi
->szTypeName
, 80, FALSE
)))
536 lstrcpynW (psfi
->szTypeName
, sTemp
, 64);
537 wcscat (psfi
->szTypeName
, szDashFile
);
544 if (flags
& SHGFI_OPENICON
)
545 uGilFlags
|= GIL_OPENICON
;
547 if (flags
& SHGFI_LINKOVERLAY
)
548 uGilFlags
|= GIL_FORSHORTCUT
;
549 else if ((flags
&SHGFI_ADDOVERLAYS
) ||
550 (flags
&(SHGFI_ICON
|SHGFI_SMALLICON
))==SHGFI_ICON
)
552 if (SHELL_IsShortcut(pidlLast
))
553 uGilFlags
|= GIL_FORSHORTCUT
;
556 if (flags
& SHGFI_OVERLAYINDEX
)
557 FIXME("SHGFI_OVERLAYINDEX unhandled\n");
559 if (flags
& SHGFI_SELECTED
)
560 FIXME("set icon to selected, stub\n");
562 if (flags
& SHGFI_SHELLICONSIZE
)
563 FIXME("set icon to shell size, stub\n");
565 /* get the iconlocation */
566 if (SUCCEEDED(hr
) && (flags
& SHGFI_ICONLOCATION
))
570 if (flags
& SHGFI_USEFILEATTRIBUTES
)
572 if (dwFileAttributes
& FILE_ATTRIBUTE_DIRECTORY
)
574 wcscpy(psfi
->szDisplayName
, swShell32Name
);
575 psfi
->iIcon
= -IDI_SHELL_FOLDER
;
580 static const WCHAR p1W
[] = {'%','1',0};
581 WCHAR sTemp
[MAX_PATH
];
583 szExt
= PathFindExtensionW(szFullPath
);
584 TRACE("szExt=%s\n", debugstr_w(szExt
));
586 HCR_MapTypeToValueW(szExt
, sTemp
, MAX_PATH
, TRUE
) &&
587 HCR_GetDefaultIconW(sTemp
, sTemp
, MAX_PATH
, &psfi
->iIcon
))
589 if (lstrcmpW(p1W
, sTemp
))
590 wcscpy(psfi
->szDisplayName
, sTemp
);
593 /* the icon is in the file */
594 wcscpy(psfi
->szDisplayName
, szFullPath
);
603 hr
= psfParent
->GetUIObjectOf(0, 1,
604 (LPCITEMIDLIST
*)&pidlLast
, IID_IExtractIconW
,
605 &uDummy
, (LPVOID
*)&pei
);
608 hr
= pei
->GetIconLocation(uGilFlags
,
609 szLocation
, MAX_PATH
, &iIndex
, &uFlags
);
611 if (uFlags
& GIL_NOTFILENAME
)
615 wcscpy (psfi
->szDisplayName
, szLocation
);
616 psfi
->iIcon
= iIndex
;
622 /* get icon index (or load icon)*/
623 if (SUCCEEDED(hr
) && (flags
& (SHGFI_ICON
| SHGFI_SYSICONINDEX
)))
625 if (flags
& SHGFI_USEFILEATTRIBUTES
&& !(flags
& SHGFI_PIDL
))
627 WCHAR sTemp
[MAX_PATH
];
631 lstrcpynW(sTemp
, szFullPath
, MAX_PATH
);
633 if (dwFileAttributes
& FILE_ATTRIBUTE_DIRECTORY
)
634 psfi
->iIcon
= SIC_GetIconIndex(swShell32Name
, -IDI_SHELL_FOLDER
, 0);
637 static const WCHAR p1W
[] = {'%','1',0};
640 szExt
= PathFindExtensionW(sTemp
);
642 HCR_MapTypeToValueW(szExt
, sTemp
, MAX_PATH
, TRUE
) &&
643 HCR_GetDefaultIconW(sTemp
, sTemp
, MAX_PATH
, &icon_idx
))
645 if (!lstrcmpW(p1W
,sTemp
)) /* icon is in the file */
646 wcscpy(sTemp
, szFullPath
);
648 if (flags
& SHGFI_SYSICONINDEX
)
650 psfi
->iIcon
= SIC_GetIconIndex(sTemp
,icon_idx
,0);
651 if (psfi
->iIcon
== -1)
657 if (flags
& SHGFI_SMALLICON
)
658 ret
= PrivateExtractIconsW( sTemp
,icon_idx
,
659 GetSystemMetrics( SM_CXSMICON
),
660 GetSystemMetrics( SM_CYSMICON
),
661 &psfi
->hIcon
, 0, 1, 0);
663 ret
= PrivateExtractIconsW( sTemp
, icon_idx
,
664 GetSystemMetrics( SM_CXICON
),
665 GetSystemMetrics( SM_CYICON
),
666 &psfi
->hIcon
, 0, 1, 0);
668 if (ret
!= 0 && ret
!= 0xFFFFFFFF)
670 IconNotYetLoaded
=FALSE
;
671 psfi
->iIcon
= icon_idx
;
679 if (!(PidlToSicIndex(psfParent
, pidlLast
, !(flags
& SHGFI_SMALLICON
),
680 uGilFlags
, &(psfi
->iIcon
))))
685 if (ret
&& (flags
& SHGFI_SYSICONINDEX
))
687 if (flags
& SHGFI_SMALLICON
)
688 ret
= (DWORD_PTR
) ShellSmallIconList
;
690 ret
= (DWORD_PTR
) ShellBigIconList
;
695 if (SUCCEEDED(hr
) && (flags
& SHGFI_ICON
) && IconNotYetLoaded
)
697 if (flags
& SHGFI_SMALLICON
)
698 psfi
->hIcon
= ImageList_GetIcon( ShellSmallIconList
, psfi
->iIcon
, ILD_NORMAL
);
700 psfi
->hIcon
= ImageList_GetIcon( ShellBigIconList
, psfi
->iIcon
, ILD_NORMAL
);
703 if (flags
& ~SHGFI_KNOWN_FLAGS
)
704 FIXME("unknown flags %08x\n", flags
& ~SHGFI_KNOWN_FLAGS
);
712 TRACE ("icon=%p index=0x%08x attr=0x%08x name=%s type=%s ret=0x%08lx\n",
713 psfi
->hIcon
, psfi
->iIcon
, psfi
->dwAttributes
,
714 debugstr_w(psfi
->szDisplayName
), debugstr_w(psfi
->szTypeName
), ret
);
720 /*************************************************************************
721 * SHGetFileInfoA [SHELL32.@]
724 * MSVBVM60.__vbaNew2 expects this function to return a value in range
725 * 1 .. 0x7fff when the function succeeds and flags does not contain
726 * SHGFI_EXETYPE or SHGFI_SYSICONINDEX (see bug 7701)
728 DWORD_PTR WINAPI
SHGetFileInfoA(LPCSTR path
,DWORD dwFileAttributes
,
729 SHFILEINFOA
*psfi
, UINT sizeofpsfi
,
733 LPWSTR temppath
= NULL
;
736 SHFILEINFOW temppsfi
;
738 if (flags
& SHGFI_PIDL
)
740 /* path contains a pidl */
741 pathW
= (LPCWSTR
)path
;
745 len
= MultiByteToWideChar(CP_ACP
, 0, path
, -1, NULL
, 0);
746 temppath
= (LPWSTR
)HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
747 MultiByteToWideChar(CP_ACP
, 0, path
, -1, temppath
, len
);
751 if (psfi
&& (flags
& SHGFI_ATTR_SPECIFIED
))
752 temppsfi
.dwAttributes
=psfi
->dwAttributes
;
755 ret
= SHGetFileInfoW(pathW
, dwFileAttributes
, NULL
, sizeof(temppsfi
), flags
);
757 ret
= SHGetFileInfoW(pathW
, dwFileAttributes
, &temppsfi
, sizeof(temppsfi
), flags
);
761 if(flags
& SHGFI_ICON
)
762 psfi
->hIcon
=temppsfi
.hIcon
;
763 if(flags
& (SHGFI_SYSICONINDEX
|SHGFI_ICON
|SHGFI_ICONLOCATION
))
764 psfi
->iIcon
=temppsfi
.iIcon
;
765 if(flags
& SHGFI_ATTRIBUTES
)
766 psfi
->dwAttributes
=temppsfi
.dwAttributes
;
767 if(flags
& (SHGFI_DISPLAYNAME
|SHGFI_ICONLOCATION
))
769 WideCharToMultiByte(CP_ACP
, 0, temppsfi
.szDisplayName
, -1,
770 psfi
->szDisplayName
, sizeof(psfi
->szDisplayName
), NULL
, NULL
);
772 if(flags
& SHGFI_TYPENAME
)
774 WideCharToMultiByte(CP_ACP
, 0, temppsfi
.szTypeName
, -1,
775 psfi
->szTypeName
, sizeof(psfi
->szTypeName
), NULL
, NULL
);
779 HeapFree(GetProcessHeap(), 0, temppath
);
784 /*************************************************************************
785 * DuplicateIcon [SHELL32.@]
787 EXTERN_C HICON WINAPI
DuplicateIcon( HINSTANCE hInstance
, HICON hIcon
)
792 TRACE("%p %p\n", hInstance
, hIcon
);
794 if (GetIconInfo(hIcon
, &IconInfo
))
796 hDupIcon
= CreateIconIndirect(&IconInfo
);
798 /* clean up hbmMask and hbmColor */
799 DeleteObject(IconInfo
.hbmMask
);
800 DeleteObject(IconInfo
.hbmColor
);
806 /*************************************************************************
807 * ExtractIconA [SHELL32.@]
809 HICON WINAPI
ExtractIconA(HINSTANCE hInstance
, LPCSTR lpszFile
, UINT nIconIndex
)
812 INT len
= MultiByteToWideChar(CP_ACP
, 0, lpszFile
, -1, NULL
, 0);
813 LPWSTR lpwstrFile
= (LPWSTR
)HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
815 TRACE("%p %s %d\n", hInstance
, lpszFile
, nIconIndex
);
817 MultiByteToWideChar(CP_ACP
, 0, lpszFile
, -1, lpwstrFile
, len
);
818 ret
= ExtractIconW(hInstance
, lpwstrFile
, nIconIndex
);
819 HeapFree(GetProcessHeap(), 0, lpwstrFile
);
824 /*************************************************************************
825 * ExtractIconW [SHELL32.@]
827 HICON WINAPI
ExtractIconW(HINSTANCE hInstance
, LPCWSTR lpszFile
, UINT nIconIndex
)
831 UINT cx
= GetSystemMetrics(SM_CXICON
), cy
= GetSystemMetrics(SM_CYICON
);
833 TRACE("%p %s %d\n", hInstance
, debugstr_w(lpszFile
), nIconIndex
);
835 if (nIconIndex
== 0xFFFFFFFF)
837 ret
= PrivateExtractIconsW(lpszFile
, 0, cx
, cy
, NULL
, NULL
, 0, LR_DEFAULTCOLOR
);
838 if (ret
!= 0xFFFFFFFF && ret
)
839 return (HICON
)(UINT_PTR
)ret
;
843 ret
= PrivateExtractIconsW(lpszFile
, nIconIndex
, cx
, cy
, &hIcon
, NULL
, 1, LR_DEFAULTCOLOR
);
845 if (ret
== 0xFFFFFFFF)
847 else if (ret
> 0 && hIcon
)
853 /*************************************************************************
854 * Printer_LoadIconsW [SHELL32.205]
856 EXTERN_C VOID WINAPI
Printer_LoadIconsW(LPCWSTR wsPrinterName
, HICON
* pLargeIcon
, HICON
* pSmallIcon
)
858 INT iconindex
=IDI_SHELL_PRINTERS_FOLDER
;
860 TRACE("(%s, %p, %p)\n", debugstr_w(wsPrinterName
), pLargeIcon
, pSmallIcon
);
862 /* We should check if wsPrinterName is
863 1. the Default Printer or not
865 3. a Local Printer or a Network-Printer
866 and use different Icons
868 if((wsPrinterName
!= NULL
) && (wsPrinterName
[0] != 0))
870 FIXME("(select Icon by PrinterName %s not implemented)\n", debugstr_w(wsPrinterName
));
873 if(pLargeIcon
!= NULL
)
874 *pLargeIcon
= (HICON
)LoadImageW(shell32_hInstance
,
875 (LPCWSTR
) MAKEINTRESOURCE(iconindex
), IMAGE_ICON
,
876 0, 0, LR_DEFAULTCOLOR
|LR_DEFAULTSIZE
);
878 if(pSmallIcon
!= NULL
)
879 *pSmallIcon
= (HICON
)LoadImageW(shell32_hInstance
,
880 (LPCWSTR
) MAKEINTRESOURCE(iconindex
), IMAGE_ICON
,
881 16, 16, LR_DEFAULTCOLOR
);
884 /*************************************************************************
885 * Printers_RegisterWindowW [SHELL32.213]
886 * used by "printui.dll":
887 * find the Window of the given Type for the specific Printer and
888 * return the already existent hwnd or open a new window
890 EXTERN_C BOOL WINAPI
Printers_RegisterWindowW(LPCWSTR wsPrinter
, DWORD dwType
,
891 HANDLE
* phClassPidl
, HWND
* phwnd
)
893 FIXME("(%s, %x, %p (%p), %p (%p)) stub!\n", debugstr_w(wsPrinter
), dwType
,
894 phClassPidl
, (phClassPidl
!= NULL
) ? *(phClassPidl
) : NULL
,
895 phwnd
, (phwnd
!= NULL
) ? *(phwnd
) : NULL
);
900 /*************************************************************************
901 * Printers_UnregisterWindow [SHELL32.214]
903 EXTERN_C VOID WINAPI
Printers_UnregisterWindow(HANDLE hClassPidl
, HWND hwnd
)
905 FIXME("(%p, %p) stub!\n", hClassPidl
, hwnd
);
908 /*************************************************************************/
913 LPCWSTR szOtherStuff
;
917 #define DROP_FIELD_TOP (-15)
918 #define DROP_FIELD_HEIGHT 15
920 /*************************************************************************
921 * SHAppBarMessage [SHELL32.@]
923 UINT_PTR WINAPI
SHAppBarMessage(DWORD msg
, PAPPBARDATA data
)
925 int width
=data
->rc
.right
- data
->rc
.left
;
926 int height
=data
->rc
.bottom
- data
->rc
.top
;
929 TRACE("msg=%d, data={cb=%d, hwnd=%p, callback=%x, edge=%d, rc=%s, lparam=%lx}\n",
930 msg
, data
->cbSize
, data
->hWnd
, data
->uCallbackMessage
, data
->uEdge
,
931 wine_dbgstr_rect(&data
->rc
), data
->lParam
);
936 return ABS_ALWAYSONTOP
| ABS_AUTOHIDE
;
938 case ABM_GETTASKBARPOS
:
939 GetWindowRect(data
->hWnd
, &rec
);
944 SetActiveWindow(data
->hWnd
);
947 case ABM_GETAUTOHIDEBAR
:
948 return 0; /* pretend there is no autohide bar */
951 /* cbSize, hWnd, and uCallbackMessage are used. All other ignored */
952 SetWindowPos(data
->hWnd
,HWND_TOP
,0,0,0,0,SWP_SHOWWINDOW
|SWP_NOMOVE
|SWP_NOSIZE
);
956 GetWindowRect(data
->hWnd
, &(data
->rc
));
960 FIXME("ABM_REMOVE broken\n");
961 /* FIXME: this is wrong; should it be DestroyWindow instead? */
962 /*CloseHandle(data->hWnd);*/
965 case ABM_SETAUTOHIDEBAR
:
966 SetWindowPos(data
->hWnd
,HWND_TOP
,rec
.left
+1000,rec
.top
,
967 width
,height
,SWP_SHOWWINDOW
);
971 data
->uEdge
=(ABE_RIGHT
| ABE_LEFT
);
972 SetWindowPos(data
->hWnd
,HWND_TOP
,data
->rc
.left
,data
->rc
.top
,
973 width
,height
,SWP_SHOWWINDOW
);
976 case ABM_WINDOWPOSCHANGED
:
983 /*************************************************************************
984 * SHHelpShortcuts_RunDLLA [SHELL32.@]
987 EXTERN_C DWORD WINAPI
SHHelpShortcuts_RunDLLA(DWORD dwArg1
, DWORD dwArg2
, DWORD dwArg3
, DWORD dwArg4
)
989 FIXME("(%x, %x, %x, %x) stub!\n", dwArg1
, dwArg2
, dwArg3
, dwArg4
);
993 /*************************************************************************
994 * SHHelpShortcuts_RunDLLA [SHELL32.@]
997 EXTERN_C DWORD WINAPI
SHHelpShortcuts_RunDLLW(DWORD dwArg1
, DWORD dwArg2
, DWORD dwArg3
, DWORD dwArg4
)
999 FIXME("(%x, %x, %x, %x) stub!\n", dwArg1
, dwArg2
, dwArg3
, dwArg4
);
1003 /*************************************************************************
1004 * SHLoadInProc [SHELL32.@]
1005 * Create an instance of specified object class from within
1006 * the shell process and release it immediately
1008 EXTERN_C HRESULT WINAPI
SHLoadInProc (REFCLSID rclsid
)
1010 CComPtr
<IUnknown
> ptr
;
1012 TRACE("%s\n", debugstr_guid(&rclsid
));
1014 CoCreateInstance(rclsid
, NULL
, CLSCTX_INPROC_SERVER
, IID_IUnknown
, (void **)&ptr
);
1017 return DISP_E_MEMBERNOTFOUND
;
1020 static VOID
SetRegTextData(HWND hWnd
, HKEY hKey
, LPCWSTR Value
, UINT uID
)
1026 if( RegQueryValueExW(hKey
, Value
, NULL
, &dwType
, NULL
, &dwBufferSize
) == ERROR_SUCCESS
)
1028 if(dwType
== REG_SZ
)
1030 lpBuffer
= (LPWSTR
)HeapAlloc(GetProcessHeap(), 0, dwBufferSize
);
1034 if( RegQueryValueExW(hKey
, Value
, NULL
, &dwType
, (LPBYTE
)lpBuffer
, &dwBufferSize
) == ERROR_SUCCESS
)
1036 SetDlgItemTextW(hWnd
, uID
, lpBuffer
);
1039 HeapFree(GetProcessHeap(), 0, lpBuffer
);
1045 INT_PTR CALLBACK
AboutAuthorsDlgProc( HWND hWnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
1051 const char* const *pstr
= SHELL_Authors
;
1053 // Add the authors to the list
1054 SendDlgItemMessageW( hWnd
, IDC_ABOUT_AUTHORS_LISTBOX
, WM_SETREDRAW
, FALSE
, 0 );
1060 /* authors list is in utf-8 format */
1061 MultiByteToWideChar( CP_UTF8
, 0, *pstr
, -1, name
, sizeof(name
)/sizeof(WCHAR
) );
1062 SendDlgItemMessageW( hWnd
, IDC_ABOUT_AUTHORS_LISTBOX
, LB_ADDSTRING
, (WPARAM
)-1, (LPARAM
)name
);
1066 SendDlgItemMessageW( hWnd
, IDC_ABOUT_AUTHORS_LISTBOX
, WM_SETREDRAW
, TRUE
, 0 );
1074 /*************************************************************************
1075 * AboutDlgProc (internal)
1077 INT_PTR CALLBACK
AboutDlgProc( HWND hWnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
1079 static DWORD cxLogoBmp
;
1080 static DWORD cyLogoBmp
;
1081 static HBITMAP hLogoBmp
;
1082 static HWND hWndAuthors
;
1088 ABOUT_INFO
*info
= (ABOUT_INFO
*)lParam
;
1092 const WCHAR szRegKey
[] = L
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
1094 MEMORYSTATUSEX MemStat
;
1095 WCHAR szAppTitle
[512];
1096 WCHAR szAppTitleTemplate
[512];
1097 WCHAR szAuthorsText
[20];
1099 // Preload the ROS bitmap
1100 hLogoBmp
= (HBITMAP
)LoadImage(shell32_hInstance
, MAKEINTRESOURCE(IDB_SHELL_ABOUT_LOGO_24BPP
), IMAGE_BITMAP
, 0, 0, LR_DEFAULTCOLOR
);
1106 GetObject( hLogoBmp
, sizeof(BITMAP
), &bmpLogo
);
1108 cxLogoBmp
= bmpLogo
.bmWidth
;
1109 cyLogoBmp
= bmpLogo
.bmHeight
;
1112 // Set App-specific stuff (icon, app name, szOtherStuff string)
1113 SendDlgItemMessageW(hWnd
, IDC_ABOUT_ICON
, STM_SETICON
, (WPARAM
)info
->hIcon
, 0);
1115 GetWindowTextW( hWnd
, szAppTitleTemplate
, sizeof(szAppTitleTemplate
) / sizeof(WCHAR
) );
1116 swprintf( szAppTitle
, szAppTitleTemplate
, info
->szApp
);
1117 SetWindowTextW( hWnd
, szAppTitle
);
1119 SetDlgItemTextW( hWnd
, IDC_ABOUT_APPNAME
, info
->szApp
);
1120 SetDlgItemTextW( hWnd
, IDC_ABOUT_OTHERSTUFF
, info
->szOtherStuff
);
1122 // Set the registered user and organization name
1123 if(RegOpenKeyExW( HKEY_LOCAL_MACHINE
, szRegKey
, 0, KEY_QUERY_VALUE
, &hRegKey
) == ERROR_SUCCESS
)
1125 SetRegTextData( hWnd
, hRegKey
, L
"RegisteredOwner", IDC_ABOUT_REG_USERNAME
);
1126 SetRegTextData( hWnd
, hRegKey
, L
"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME
);
1128 RegCloseKey( hRegKey
);
1131 // Set the value for the installed physical memory
1132 MemStat
.dwLength
= sizeof(MemStat
);
1133 if( GlobalMemoryStatusEx(&MemStat
) )
1137 if (MemStat
.ullTotalPhys
> 1024 * 1024 * 1024)
1140 WCHAR szDecimalSeparator
[4];
1143 // We're dealing with GBs or more
1144 MemStat
.ullTotalPhys
/= 1024 * 1024;
1146 if (MemStat
.ullTotalPhys
> 1024 * 1024)
1148 // We're dealing with TBs or more
1149 MemStat
.ullTotalPhys
/= 1024;
1151 if (MemStat
.ullTotalPhys
> 1024 * 1024)
1153 // We're dealing with PBs or more
1154 MemStat
.ullTotalPhys
/= 1024;
1156 dTotalPhys
= (double)MemStat
.ullTotalPhys
/ 1024;
1157 wcscpy( szUnits
, L
"PB" );
1161 dTotalPhys
= (double)MemStat
.ullTotalPhys
/ 1024;
1162 wcscpy( szUnits
, L
"TB" );
1167 dTotalPhys
= (double)MemStat
.ullTotalPhys
/ 1024;
1168 wcscpy( szUnits
, L
"GB" );
1171 // We need the decimal point of the current locale to display the RAM size correctly
1172 if (GetLocaleInfoW(LOCALE_USER_DEFAULT
, LOCALE_SDECIMAL
,
1174 sizeof(szDecimalSeparator
) / sizeof(WCHAR
)) > 0)
1179 uIntegral
= (UINT
)dTotalPhys
;
1180 uDecimals
= (UCHAR
)((UINT
)(dTotalPhys
* 100) - uIntegral
* 100);
1182 // Display the RAM size with 2 decimals
1183 swprintf(szBuf
, L
"%u%s%02u %s", uIntegral
, szDecimalSeparator
, uDecimals
, szUnits
);
1188 // We're dealing with MBs, don't show any decimals
1189 swprintf( szBuf
, L
"%u MB", (UINT
)MemStat
.ullTotalPhys
/ 1024 / 1024 );
1192 SetDlgItemTextW( hWnd
, IDC_ABOUT_PHYSMEM
, szBuf
);
1195 // Add the Authors dialog
1196 hWndAuthors
= CreateDialogW( shell32_hInstance
, MAKEINTRESOURCEW(IDD_ABOUT_AUTHORS
), hWnd
, AboutAuthorsDlgProc
);
1197 LoadStringW( shell32_hInstance
, IDS_SHELL_ABOUT_AUTHORS
, szAuthorsText
, sizeof(szAuthorsText
) / sizeof(WCHAR
) );
1198 SetDlgItemTextW( hWnd
, IDC_ABOUT_AUTHORS
, szAuthorsText
);
1212 hdc
= BeginPaint(hWnd
, &ps
);
1213 hdcMem
= CreateCompatibleDC(hdc
);
1217 SelectObject(hdcMem
, hLogoBmp
);
1218 BitBlt(hdc
, 0, 0, cxLogoBmp
, cyLogoBmp
, hdcMem
, 0, 0, SRCCOPY
);
1223 EndPaint(hWnd
, &ps
);
1233 EndDialog(hWnd
, TRUE
);
1236 case IDC_ABOUT_AUTHORS
:
1238 static BOOL bShowingAuthors
= FALSE
;
1239 WCHAR szAuthorsText
[20];
1243 LoadStringW( shell32_hInstance
, IDS_SHELL_ABOUT_AUTHORS
, szAuthorsText
, sizeof(szAuthorsText
) / sizeof(WCHAR
) );
1244 ShowWindow( hWndAuthors
, SW_HIDE
);
1248 LoadStringW( shell32_hInstance
, IDS_SHELL_ABOUT_BACK
, szAuthorsText
, sizeof(szAuthorsText
) / sizeof(WCHAR
) );
1249 ShowWindow( hWndAuthors
, SW_SHOW
);
1252 SetDlgItemTextW( hWnd
, IDC_ABOUT_AUTHORS
, szAuthorsText
);
1253 bShowingAuthors
= !bShowingAuthors
;
1260 EndDialog(hWnd
, TRUE
);
1268 /*************************************************************************
1269 * ShellAboutA [SHELL32.288]
1271 BOOL WINAPI
ShellAboutA( HWND hWnd
, LPCSTR szApp
, LPCSTR szOtherStuff
, HICON hIcon
)
1274 LPWSTR appW
= NULL
, otherW
= NULL
;
1279 len
= MultiByteToWideChar(CP_ACP
, 0, szApp
, -1, NULL
, 0);
1280 appW
= (LPWSTR
)HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
1281 MultiByteToWideChar(CP_ACP
, 0, szApp
, -1, appW
, len
);
1285 len
= MultiByteToWideChar(CP_ACP
, 0, szOtherStuff
, -1, NULL
, 0);
1286 otherW
= (LPWSTR
)HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
1287 MultiByteToWideChar(CP_ACP
, 0, szOtherStuff
, -1, otherW
, len
);
1290 ret
= ShellAboutW(hWnd
, appW
, otherW
, hIcon
);
1292 HeapFree(GetProcessHeap(), 0, otherW
);
1293 HeapFree(GetProcessHeap(), 0, appW
);
1298 /*************************************************************************
1299 * ShellAboutW [SHELL32.289]
1301 BOOL WINAPI
ShellAboutW( HWND hWnd
, LPCWSTR szApp
, LPCWSTR szOtherStuff
,
1306 DLGTEMPLATE
*DlgTemplate
;
1311 // DialogBoxIndirectParamW will be called with the hInstance of the calling application, so we have to preload the dialog template
1312 hRes
= FindResourceW(shell32_hInstance
, MAKEINTRESOURCEW(IDD_ABOUT
), (LPWSTR
)RT_DIALOG
);
1316 DlgTemplate
= (DLGTEMPLATE
*)LoadResource(shell32_hInstance
, hRes
);
1321 info
.szOtherStuff
= szOtherStuff
;
1322 info
.hIcon
= hIcon
? hIcon
: LoadIconW( 0, (LPWSTR
)IDI_WINLOGO
);
1324 bRet
= DialogBoxIndirectParamW((HINSTANCE
)GetWindowLongPtrW( hWnd
, GWLP_HINSTANCE
),
1325 DlgTemplate
, hWnd
, AboutDlgProc
, (LPARAM
)&info
);
1329 /*************************************************************************
1330 * FreeIconList (SHELL32.@)
1332 EXTERN_C
void WINAPI
FreeIconList( DWORD dw
)
1334 FIXME("%x: stub\n",dw
);
1337 /*************************************************************************
1338 * SHLoadNonloadedIconOverlayIdentifiers (SHELL32.@)
1340 EXTERN_C HRESULT WINAPI
SHLoadNonloadedIconOverlayIdentifiers(VOID
)
1346 class CShell32Module
: public CComModule
1352 BEGIN_OBJECT_MAP(ObjectMap
)
1353 OBJECT_ENTRY(CLSID_ShellFSFolder
, CFSFolder
)
1354 OBJECT_ENTRY(CLSID_MyComputer
, CDrivesFolder
)
1355 OBJECT_ENTRY(CLSID_ShellDesktop
, CDesktopFolder
)
1356 OBJECT_ENTRY(CLSID_ShellItem
, CShellItem
)
1357 OBJECT_ENTRY(CLSID_ShellLink
, CShellLink
)
1358 OBJECT_ENTRY(CLSID_DragDropHelper
, CDropTargetHelper
)
1359 OBJECT_ENTRY(CLSID_ControlPanel
, CControlPanelFolder
)
1360 OBJECT_ENTRY(CLSID_AutoComplete
, CAutoComplete
)
1361 OBJECT_ENTRY(CLSID_MyDocuments
, CMyDocsFolder
)
1362 OBJECT_ENTRY(CLSID_NetworkPlaces
, CNetFolder
)
1363 OBJECT_ENTRY(CLSID_FontsFolderShortcut
, CFontsFolder
)
1364 OBJECT_ENTRY(CLSID_Printers
, CPrinterFolder
)
1365 OBJECT_ENTRY(CLSID_AdminFolderShortcut
, CAdminToolsFolder
)
1366 OBJECT_ENTRY(CLSID_RecycleBin
, CRecycleBin
)
1367 OBJECT_ENTRY(CLSID_OpenWithMenu
, COpenWithMenu
)
1368 OBJECT_ENTRY(CLSID_NewMenu
, CNewMenu
)
1369 OBJECT_ENTRY(CLSID_StartMenu
, CStartMenu
)
1370 OBJECT_ENTRY(CLSID_MenuBandSite
, CMenuBandSite
)
1371 OBJECT_ENTRY(CLSID_MenuBand
, CMenuBand
)
1372 OBJECT_ENTRY(CLSID_MenuDeskBar
, CMenuDeskBar
)
1375 CShell32Module gModule
;
1378 /***********************************************************************
1379 * DllGetVersion [SHELL32.@]
1381 * Retrieves version information of the 'SHELL32.DLL'
1384 * pdvi [O] pointer to version information structure.
1388 * Failure: E_INVALIDARG
1391 * Returns version of a shell32.dll from IE4.01 SP1.
1394 STDAPI
DllGetVersion(DLLVERSIONINFO
*pdvi
)
1396 /* FIXME: shouldn't these values come from the version resource? */
1397 if (pdvi
->cbSize
== sizeof(DLLVERSIONINFO
) ||
1398 pdvi
->cbSize
== sizeof(DLLVERSIONINFO2
))
1400 pdvi
->dwMajorVersion
= WINE_FILEVERSION_MAJOR
;
1401 pdvi
->dwMinorVersion
= WINE_FILEVERSION_MINOR
;
1402 pdvi
->dwBuildNumber
= WINE_FILEVERSION_BUILD
;
1403 pdvi
->dwPlatformID
= WINE_FILEVERSION_PLATFORMID
;
1404 if (pdvi
->cbSize
== sizeof(DLLVERSIONINFO2
))
1406 DLLVERSIONINFO2
*pdvi2
= (DLLVERSIONINFO2
*)pdvi
;
1409 pdvi2
->ullVersion
= MAKEDLLVERULL(WINE_FILEVERSION_MAJOR
,
1410 WINE_FILEVERSION_MINOR
,
1411 WINE_FILEVERSION_BUILD
,
1412 WINE_FILEVERSION_PLATFORMID
);
1414 TRACE("%u.%u.%u.%u\n",
1415 pdvi
->dwMajorVersion
, pdvi
->dwMinorVersion
,
1416 pdvi
->dwBuildNumber
, pdvi
->dwPlatformID
);
1421 WARN("wrong DLLVERSIONINFO size from app\n");
1422 return E_INVALIDARG
;
1426 /*************************************************************************
1427 * global variables of the shell32.dll
1428 * all are once per process
1431 HINSTANCE shell32_hInstance
;
1432 HIMAGELIST ShellSmallIconList
= 0;
1433 HIMAGELIST ShellBigIconList
= 0;
1435 void *operator new (size_t, void *buf
)
1440 /*************************************************************************
1444 * calling oleinitialize here breaks sone apps.
1446 STDAPI_(BOOL
) DllMain(HINSTANCE hInstance
, DWORD dwReason
, LPVOID fImpLoad
)
1448 TRACE("%p 0x%x %p\n", hInstance
, dwReason
, fImpLoad
);
1449 if (dwReason
== DLL_PROCESS_ATTACH
)
1451 /* HACK - the global constructors don't run, so I placement new them here */
1452 new (&gModule
) CShell32Module
;
1453 new (&_AtlWinModule
) CAtlWinModule
;
1454 new (&_AtlBaseModule
) CAtlBaseModule
;
1455 new (&_AtlComModule
) CAtlComModule
;
1457 shell32_hInstance
= hInstance
;
1458 gModule
.Init(ObjectMap
, hInstance
, NULL
);
1460 DisableThreadLibraryCalls (hInstance
);
1462 /* get full path to this DLL for IExtractIconW_fnGetIconLocation() */
1463 GetModuleFileNameW(hInstance
, swShell32Name
, MAX_PATH
);
1464 swShell32Name
[MAX_PATH
- 1] = '\0';
1466 /* Initialize comctl32 */
1467 INITCOMMONCONTROLSEX InitCtrls
;
1468 InitCtrls
.dwSize
= sizeof(INITCOMMONCONTROLSEX
);
1469 InitCtrls
.dwICC
= ICC_WIN95_CLASSES
| ICC_DATE_CLASSES
| ICC_USEREX_CLASSES
;
1470 InitCommonControlsEx(&InitCtrls
);
1473 InitChangeNotifications();
1476 else if (dwReason
== DLL_PROCESS_DETACH
)
1478 shell32_hInstance
= NULL
;
1480 FreeChangeNotifications();
1486 /***********************************************************************
1487 * DllCanUnloadNow (SHELL32.@)
1489 STDAPI
DllCanUnloadNow()
1491 return gModule
.DllCanUnloadNow();
1494 /*************************************************************************
1495 * DllGetClassObject [SHELL32.@]
1496 * SHDllGetClassObject [SHELL32.128]
1498 STDAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
1502 TRACE("CLSID:%s,IID:%s\n", shdebugstr_guid(&rclsid
), shdebugstr_guid(&riid
));
1504 hResult
= gModule
.DllGetClassObject(rclsid
, riid
, ppv
);
1505 TRACE("-- pointer to class factory: %p\n", *ppv
);
1509 /***********************************************************************
1510 * DllRegisterServer (SHELL32.@)
1512 STDAPI
DllRegisterServer()
1516 hr
= gModule
.DllRegisterServer(FALSE
);
1520 hr
= gModule
.UpdateRegistryFromResource(IDR_FOLDEROPTIONS
, TRUE
, NULL
);
1524 hr
= SHELL_RegisterShellFolders();
1531 /***********************************************************************
1532 * DllUnregisterServer (SHELL32.@)
1534 STDAPI
DllUnregisterServer()
1538 hr
= gModule
.DllUnregisterServer(FALSE
);
1542 hr
= gModule
.UpdateRegistryFromResource(IDR_FOLDEROPTIONS
, FALSE
, NULL
);
1549 /*************************************************************************
1550 * DllInstall [SHELL32.@]
1554 * BOOL bInstall - TRUE for install, FALSE for uninstall
1555 * LPCWSTR pszCmdLine - command line (unused by shell32?)
1558 HRESULT WINAPI
DllInstall(BOOL bInstall
, LPCWSTR cmdline
)
1560 FIXME("%s %s: stub\n", bInstall
? "TRUE":"FALSE", debugstr_w(cmdline
));
1561 return S_OK
; /* indicate success */