ReactOS 0.4.15-dev-8434-g155a7c7
shell32_main.c
Go to the documentation of this file.
1/*
2 * Shell basics
3 *
4 * Copyright 1998 Marcus Meissner
5 * Copyright 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
6 * Copyright 2017 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
7 *
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.
12 *
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.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#include <wine/config.h>
24
25#define WIN32_NO_STATUS
26#define _INC_WINDOWS
27#define COBJMACROS
28
29#include <windef.h>
30#include <winbase.h>
31#include <shellapi.h>
32#include <shlobj.h>
33#include <shlwapi.h>
34#include <strsafe.h>
35#include <winnls.h>
36
37#include "undocshell.h"
38#include "pidl.h"
39#include "shell32_main.h"
40#include "shresdef.h"
41
42#include <wine/debug.h>
43#include <wine/unicode.h>
44
45#include <reactos/version.h>
46#include <reactos/buildno.h>
47
48#include <versionhelpers.h>
50
51const char * const SHELL_Authors[] = { "Copyright 1993-"COPYRIGHT_YEAR" WINE team", "Copyright 1998-"COPYRIGHT_YEAR" ReactOS Team", 0 };
52
53/*************************************************************************
54 * CommandLineToArgvW [SHELL32.@]
55 *
56 * We must interpret the quotes in the command line to rebuild the argv
57 * array correctly:
58 * - arguments are separated by spaces or tabs
59 * - quotes serve as optional argument delimiters
60 * '"a b"' -> 'a b'
61 * - escaped quotes must be converted back to '"'
62 * '\"' -> '"'
63 * - consecutive backslashes preceding a quote see their number halved with
64 * the remainder escaping the quote:
65 * 2n backslashes + quote -> n backslashes + quote as an argument delimiter
66 * 2n+1 backslashes + quote -> n backslashes + literal quote
67 * - backslashes that are not followed by a quote are copied literally:
68 * 'a\b' -> 'a\b'
69 * 'a\\b' -> 'a\\b'
70 * - in quoted strings, consecutive quotes see their number divided by three
71 * with the remainder modulo 3 deciding whether to close the string or not.
72 * Note that the opening quote must be counted in the consecutive quotes,
73 * that's the (1+) below:
74 * (1+) 3n quotes -> n quotes
75 * (1+) 3n+1 quotes -> n quotes plus closes the quoted string
76 * (1+) 3n+2 quotes -> n+1 quotes plus closes the quoted string
77 * - in unquoted strings, the first quote opens the quoted string and the
78 * remaining consecutive quotes follow the above rule.
79 */
80LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
81{
82 DWORD argc;
83 LPWSTR *argv;
84 LPCWSTR s;
85 LPWSTR d;
87 int qcount,bcount;
88
89 if(!numargs)
90 {
92 return NULL;
93 }
94
95 if (*lpCmdline==0)
96 {
97 /* Return the path to the executable */
98 DWORD len, deslen=MAX_PATH, size;
99
100 size = sizeof(LPWSTR)*2 + deslen*sizeof(WCHAR);
101 for (;;)
102 {
103 if (!(argv = LocalAlloc(LMEM_FIXED, size))) return NULL;
104 len = GetModuleFileNameW(0, (LPWSTR)(argv+2), deslen);
105 if (!len)
106 {
108 return NULL;
109 }
110 if (len < deslen) break;
111 deslen*=2;
112 size = sizeof(LPWSTR)*2 + deslen*sizeof(WCHAR);
113 LocalFree( argv );
114 }
115 argv[0]=(LPWSTR)(argv+2);
116 argv[1]=NULL;
117 *numargs=1;
118
119 return argv;
120 }
121
122 /* --- First count the arguments */
123 argc=1;
124 s=lpCmdline;
125 /* The first argument, the executable path, follows special rules */
126 if (*s=='"')
127 {
128 /* The executable path ends at the next quote, no matter what */
129 s++;
130 while (*s)
131 if (*s++=='"')
132 break;
133 }
134 else
135 {
136 /* The executable path ends at the next space, no matter what */
137 while (*s && !isspace(*s))
138 s++;
139 }
140 /* skip to the first argument, if any */
141 while (isblank(*s))
142 s++;
143 if (*s)
144 argc++;
145
146 /* Analyze the remaining arguments */
147 qcount=bcount=0;
148 while (*s)
149 {
150 if (isblank(*s) && qcount==0)
151 {
152 /* skip to the next argument and count it if any */
153 while (isblank(*s))
154 s++;
155 if (*s)
156 argc++;
157 bcount=0;
158 }
159 else if (*s=='\\')
160 {
161 /* '\', count them */
162 bcount++;
163 s++;
164 }
165 else if (*s=='"')
166 {
167 /* '"' */
168 if ((bcount & 1)==0)
169 qcount++; /* unescaped '"' */
170 s++;
171 bcount=0;
172 /* consecutive quotes, see comment in copying code below */
173 while (*s=='"')
174 {
175 qcount++;
176 s++;
177 }
178 qcount=qcount % 3;
179 if (qcount==2)
180 qcount=0;
181 }
182 else
183 {
184 /* a regular character */
185 bcount=0;
186 s++;
187 }
188 }
189
190 /* Allocate in a single lump, the string array, and the strings that go
191 * with it. This way the caller can make a single LocalFree() call to free
192 * both, as per MSDN.
193 */
194 argv=LocalAlloc(LMEM_FIXED, (argc+1)*sizeof(LPWSTR)+(strlenW(lpCmdline)+1)*sizeof(WCHAR));
195 if (!argv)
196 return NULL;
197 cmdline=(LPWSTR)(argv+argc+1);
198 strcpyW(cmdline, lpCmdline);
199
200 /* --- Then split and copy the arguments */
201 argv[0]=d=cmdline;
202 argc=1;
203 /* The first argument, the executable path, follows special rules */
204 if (*d=='"')
205 {
206 /* The executable path ends at the next quote, no matter what */
207 s=d+1;
208 while (*s)
209 {
210 if (*s=='"')
211 {
212 s++;
213 break;
214 }
215 *d++=*s++;
216 }
217 }
218 else
219 {
220 /* The executable path ends at the next space, no matter what */
221 while (*d && !isspace(*d))
222 d++;
223 s=d;
224 if (*s)
225 s++;
226 }
227 /* close the executable path */
228 *d++=0;
229 /* skip to the first argument and initialize it if any */
230 while (isblank(*s))
231 s++;
232
233 if (!*s)
234 {
235 /* There are no parameters so we are all done */
236 argv[argc]=NULL;
237 *numargs=argc;
238 return argv;
239 }
240
241 /* Split and copy the remaining arguments */
242 argv[argc++]=d;
243 qcount=bcount=0;
244 while (*s)
245 {
246 if (isblank(*s) && qcount==0)
247 {
248 /* close the argument */
249 *d++=0;
250 bcount=0;
251
252 /* skip to the next one and initialize it if any */
253 do {
254 s++;
255 } while (isblank(*s));
256 if (*s)
257 argv[argc++]=d;
258 }
259 else if (*s=='\\')
260 {
261 *d++=*s++;
262 bcount++;
263 }
264 else if (*s=='"')
265 {
266 if ((bcount & 1)==0)
267 {
268 /* Preceded by an even number of '\', this is half that
269 * number of '\', plus a quote which we erase.
270 */
271 d-=bcount/2;
272 qcount++;
273 }
274 else
275 {
276 /* Preceded by an odd number of '\', this is half that
277 * number of '\' followed by a '"'
278 */
279 d=d-bcount/2-1;
280 *d++='"';
281 }
282 s++;
283 bcount=0;
284 /* Now count the number of consecutive quotes. Note that qcount
285 * already takes into account the opening quote if any, as well as
286 * the quote that lead us here.
287 */
288 while (*s=='"')
289 {
290 if (++qcount==3)
291 {
292 *d++='"';
293 qcount=0;
294 }
295 s++;
296 }
297 if (qcount==2)
298 qcount=0;
299 }
300 else
301 {
302 /* a regular character */
303 *d++=*s++;
304 bcount=0;
305 }
306 }
307 *d='\0';
308 argv[argc]=NULL;
309 *numargs=argc;
310
311 return argv;
312}
313
315{
316 BOOL status = FALSE;
317 HANDLE hfile;
318 DWORD BinaryType;
319 IMAGE_DOS_HEADER mz_header;
321 DWORD len;
322 char magic[4];
323
324 status = GetBinaryTypeW (szFullPath, &BinaryType);
325 if (!status)
326 return 0;
327 if (BinaryType == SCS_DOS_BINARY || BinaryType == SCS_PIF_BINARY)
328 return 0x4d5a;
329
330 hfile = CreateFileW( szFullPath, GENERIC_READ, FILE_SHARE_READ,
331 NULL, OPEN_EXISTING, 0, 0 );
332 if ( hfile == INVALID_HANDLE_VALUE )
333 return 0;
334
335 /*
336 * The next section is adapted from MODULE_GetBinaryType, as we need
337 * to examine the image header to get OS and version information. We
338 * know from calling GetBinaryTypeA that the image is valid and either
339 * an NE or PE, so much error handling can be omitted.
340 * Seek to the start of the file and read the header information.
341 */
342
343 SetFilePointer( hfile, 0, NULL, SEEK_SET );
344 ReadFile( hfile, &mz_header, sizeof(mz_header), &len, NULL );
345
346 SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
347 ReadFile( hfile, magic, sizeof(magic), &len, NULL );
348 if ( *(DWORD*)magic == IMAGE_NT_SIGNATURE )
349 {
350 SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
351 ReadFile( hfile, &nt, sizeof(nt), &len, NULL );
352 CloseHandle( hfile );
353 /* DLL files are not executable and should return 0 */
355 return 0;
357 {
358 return IMAGE_NT_SIGNATURE |
361 }
362 return IMAGE_NT_SIGNATURE;
363 }
364 else if ( *(WORD*)magic == IMAGE_OS2_SIGNATURE )
365 {
367 SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
368 ReadFile( hfile, &ne, sizeof(ne), &len, NULL );
369 CloseHandle( hfile );
370 if (ne.ne_exetyp == 2)
371 return IMAGE_OS2_SIGNATURE | (ne.ne_expver << 16);
372 return 0;
373 }
374 CloseHandle( hfile );
375 return 0;
376}
377
378/*************************************************************************
379 * SHELL_IsShortcut [internal]
380 *
381 * Decide if an item id list points to a shell shortcut
382 */
384{
385 WCHAR szTemp[MAX_PATH];
386 HKEY keyCls;
387 BOOL ret = FALSE;
388
389 if (_ILGetExtension(pidlLast, szTemp, _countof(szTemp)) &&
390 HCR_MapTypeToValueW(szTemp, szTemp, _countof(szTemp), TRUE))
391 {
393 {
394 if (ERROR_SUCCESS == RegQueryValueExW(keyCls, L"IsShortcut", NULL, NULL, NULL, NULL))
395 ret = TRUE;
396
397 RegCloseKey(keyCls);
398 }
399 }
400
401 return ret;
402}
403
404#define SHGFI_KNOWN_FLAGS \
405 (SHGFI_SMALLICON | SHGFI_OPENICON | SHGFI_SHELLICONSIZE | SHGFI_PIDL | \
406 SHGFI_USEFILEATTRIBUTES | SHGFI_ADDOVERLAYS | SHGFI_OVERLAYINDEX | \
407 SHGFI_ICON | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ATTRIBUTES | \
408 SHGFI_ICONLOCATION | SHGFI_EXETYPE | SHGFI_SYSICONINDEX | \
409 SHGFI_LINKOVERLAY | SHGFI_SELECTED | SHGFI_ATTR_SPECIFIED)
410
411/*************************************************************************
412 * SHGetFileInfoW [SHELL32.@]
413 *
414 */
416 SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags )
417{
418 WCHAR szLocation[MAX_PATH], szFullPath[MAX_PATH];
419 int iIndex;
422 IShellFolder * psfParent = NULL;
423 IExtractIconW * pei = NULL;
424 LPITEMIDLIST pidlLast = NULL, pidl = NULL;
425 HRESULT hr = S_OK;
426 BOOL IconNotYetLoaded=TRUE;
427 UINT uGilFlags = 0;
428 HIMAGELIST big_icons, small_icons;
429
430 TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n",
432 psfi, psfi ? psfi->dwAttributes : 0, sizeofpsfi, flags);
433
434 if (!path)
435 return FALSE;
436
437 /* windows initializes these values regardless of the flags */
438 if (psfi != NULL)
439 {
440 psfi->szDisplayName[0] = '\0';
441 psfi->szTypeName[0] = '\0';
442 psfi->hIcon = NULL;
443 }
444
445 if (!(flags & SHGFI_PIDL))
446 {
447 /* SHGetFileInfo should work with absolute and relative paths */
449 {
450 GetCurrentDirectoryW(MAX_PATH, szLocation);
451 PathCombineW(szFullPath, szLocation, path);
452 }
453 else
454 {
455 lstrcpynW(szFullPath, path, MAX_PATH);
456 }
457 }
458 else
459 {
461 }
462
463 if (flags & SHGFI_EXETYPE)
464 {
465 if (!(flags & SHGFI_SYSICONINDEX))
466 {
468 {
469 return TRUE;
470 }
471 else if (GetFileAttributesW(szFullPath) != INVALID_FILE_ATTRIBUTES)
472 {
473 return shgfi_get_exe_type(szFullPath);
474 }
475 }
476 }
477
478 /*
479 * psfi is NULL normally to query EXE type. If it is NULL, none of the
480 * below makes sense anyway. Windows allows this and just returns FALSE
481 */
482 if (psfi == NULL)
483 return FALSE;
484
485 /*
486 * translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES
487 * is not specified.
488 * The pidl functions fail on not existing file names
489 */
490
491 if (flags & SHGFI_PIDL)
492 {
493 pidl = ILClone((LPCITEMIDLIST)path);
494 }
495 else if (!(flags & SHGFI_USEFILEATTRIBUTES))
496 {
497 hr = SHILCreateFromPathW(szFullPath, &pidl, &dwAttributes);
498 }
499
501 {
502 /* get the parent shellfolder */
503 if (pidl)
504 {
505 hr = SHBindToParent( pidl, &IID_IShellFolder, (LPVOID*)&psfParent,
506 (LPCITEMIDLIST*)&pidlLast );
507 if (SUCCEEDED(hr))
508 pidlLast = ILClone(pidlLast);
509 else
510 hr = S_OK;
511 ILFree(pidl);
512 }
513 else
514 {
515 ERR("pidl is null!\n");
516 return FALSE;
517 }
518 }
519
520 /* get the attributes of the child */
522 {
524 {
525 psfi->dwAttributes = 0xffffffff;
526 }
527 if (psfParent)
528 {
529 IShellFolder_GetAttributesOf(psfParent, 1, (LPCITEMIDLIST*)&pidlLast,
530 &(psfi->dwAttributes));
531 }
532 }
533
535 {
536 if (flags & SHGFI_ICON)
537 {
538 psfi->dwAttributes = 0;
539 }
540 }
541
542 /* get the displayname */
544 {
546 {
547 lstrcpyW (psfi->szDisplayName, PathFindFileNameW(szFullPath));
548 }
549 else if (psfParent)
550 {
551 STRRET str;
552 hr = IShellFolder_GetDisplayNameOf( psfParent, pidlLast,
553 SHGDN_INFOLDER, &str);
554 StrRetToStrNW (psfi->szDisplayName, MAX_PATH, &str, pidlLast);
555 }
556 }
557
558 /* get the type name */
559 if (SUCCEEDED(hr) && (flags & SHGFI_TYPENAME))
560 {
562 {
563 _ILGetFileType(pidlLast, psfi->szTypeName, _countof(psfi->szTypeName));
564 }
565 else
566 {
568 strcatW (psfi->szTypeName, L"Folder");
569 else
570 {
571 WCHAR sTemp[64];
572
573 lstrcpyW(sTemp,PathFindExtensionW(szFullPath));
574 if (sTemp[0] == 0 || (sTemp[0] == '.' && sTemp[1] == 0))
575 {
576 /* "name" or "name." => "File" */
577 lstrcpynW (psfi->szTypeName, L"File", 64);
578 }
579 else if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) &&
580 HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE )))
581 {
582 if (sTemp[0])
583 {
584 lstrcpynW (psfi->szTypeName, sTemp, 64);
585 strcatW (psfi->szTypeName, L" file");
586 }
587 else
588 {
589 lstrcpynW (psfi->szTypeName, L"File", 64);
590 }
591 }
592 }
593 }
594 }
595
596 /* ### icons ###*/
597
598 Shell_GetImageLists( &big_icons, &small_icons );
599
600 if (flags & SHGFI_OPENICON)
601 uGilFlags |= GIL_OPENICON;
602
604 uGilFlags |= GIL_FORSHORTCUT;
605 else if ((flags&SHGFI_ADDOVERLAYS) ||
607 {
608 if (SHELL_IsShortcut(pidlLast))
609 uGilFlags |= GIL_FORSHORTCUT;
610 }
611
613 FIXME("SHGFI_OVERLAYINDEX unhandled\n");
614
615 if (flags & SHGFI_SELECTED)
616 FIXME("set icon to selected, stub\n");
617
619 FIXME("set icon to shell size, stub\n");
620
621 /* get the iconlocation */
623 {
624 UINT uDummy,uFlags;
625
627 {
629 {
631 psfi->iIcon = -IDI_SHELL_FOLDER;
632 }
633 else
634 {
635 WCHAR* szExt;
636 WCHAR sTemp [MAX_PATH];
637
638 szExt = PathFindExtensionW(szFullPath);
639 TRACE("szExt=%s\n", debugstr_w(szExt));
640 if ( szExt &&
641 HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
642 HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &psfi->iIcon))
643 {
644 if (lstrcmpW(L"%1", sTemp))
645 strcpyW(psfi->szDisplayName, sTemp);
646 else
647 {
648 /* the icon is in the file */
649 strcpyW(psfi->szDisplayName, szFullPath);
650 }
651 }
652 else
653 ret = FALSE;
654 }
655 }
656 else if (psfParent)
657 {
658 hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1,
659 (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconW,
660 &uDummy, (LPVOID*)&pei);
661 if (SUCCEEDED(hr))
662 {
663 hr = IExtractIconW_GetIconLocation(pei, uGilFlags,
664 szLocation, MAX_PATH, &iIndex, &uFlags);
665
666 if (uFlags & GIL_NOTFILENAME)
667 ret = FALSE;
668 else
669 {
670 lstrcpyW (psfi->szDisplayName, szLocation);
671 psfi->iIcon = iIndex;
672 }
673 IExtractIconW_Release(pei);
674 }
675 }
676 }
677
678 /* get icon index (or load icon)*/
680 {
682 {
683 WCHAR sTemp [MAX_PATH];
684 WCHAR * szExt;
685 int icon_idx=0;
686
687 lstrcpynW(sTemp, szFullPath, MAX_PATH);
688
691 else
692 {
693 psfi->iIcon = 0;
694 szExt = PathFindExtensionW(sTemp);
695 if ( szExt &&
696 HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
697 HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &icon_idx))
698 {
699 if (!lstrcmpW(L"%1",sTemp)) /* icon is in the file */
700 strcpyW(sTemp, szFullPath);
701
703 {
704 psfi->iIcon = SIC_GetIconIndex(sTemp,icon_idx,0);
705 if (psfi->iIcon == -1)
706 psfi->iIcon = 0;
707 }
708 else
709 {
710 UINT ret;
712 ret = PrivateExtractIconsW( sTemp,icon_idx,
715 &psfi->hIcon, 0, 1, 0);
716 else
717 ret = PrivateExtractIconsW( sTemp, icon_idx,
720 &psfi->hIcon, 0, 1, 0);
721 if (ret != 0 && ret != (UINT)-1)
722 {
723 IconNotYetLoaded=FALSE;
724 psfi->iIcon = icon_idx;
725 }
726 }
727 }
728 }
729 }
730 else if (psfParent)
731 {
732 if (!(PidlToSicIndex(psfParent, pidlLast, !(flags & SHGFI_SMALLICON),
733 uGilFlags, &(psfi->iIcon))))
734 {
735 ret = FALSE;
736 }
737 }
738 if (ret && (flags & SHGFI_SYSICONINDEX))
739 {
741 ret = (DWORD_PTR)small_icons;
742 else
743 ret = (DWORD_PTR)big_icons;
744 }
745 }
746
747 /* icon handle */
748 if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded)
749 {
751 psfi->hIcon = ImageList_GetIcon( small_icons, psfi->iIcon, ILD_NORMAL);
752 else
753 psfi->hIcon = ImageList_GetIcon( big_icons, psfi->iIcon, ILD_NORMAL);
754 }
755
757 FIXME("unknown flags %08x\n", flags & ~SHGFI_KNOWN_FLAGS);
758
759 if (psfParent)
760 IShellFolder_Release(psfParent);
761
762 if (hr != S_OK)
763 ret = FALSE;
764
765 SHFree(pidlLast);
766
767 TRACE ("icon=%p index=0x%08x attr=0x%08x name=%s type=%s ret=0x%08lx\n",
768 psfi->hIcon, psfi->iIcon, psfi->dwAttributes,
770
771 return ret;
772}
773
774/*************************************************************************
775 * SHGetFileInfoA [SHELL32.@]
776 *
777 * Note:
778 * MSVBVM60.__vbaNew2 expects this function to return a value in range
779 * 1 .. 0x7fff when the function succeeds and flags does not contain
780 * SHGFI_EXETYPE or SHGFI_SYSICONINDEX (see bug 7701)
781 */
783 SHFILEINFOA *psfi, UINT sizeofpsfi,
784 UINT flags )
785{
786 INT len;
787 LPWSTR temppath = NULL;
788 LPCWSTR pathW;
790 SHFILEINFOW temppsfi;
791
792 if (flags & SHGFI_PIDL)
793 {
794 /* path contains a pidl */
795 pathW = (LPCWSTR)path;
796 }
797 else
798 {
799 len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0);
800 temppath = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
801 MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len);
802 pathW = temppath;
803 }
804
805 if (psfi)
806 {
807 temppsfi.hIcon = psfi->hIcon;
808 temppsfi.iIcon = psfi->iIcon;
809 temppsfi.dwAttributes = psfi->dwAttributes;
810
811 ret = SHGetFileInfoW(pathW, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
812 psfi->hIcon = temppsfi.hIcon;
813 psfi->iIcon = temppsfi.iIcon;
814 psfi->dwAttributes = temppsfi.dwAttributes;
815
817 psfi->szDisplayName, sizeof(psfi->szDisplayName), NULL, NULL);
818
819 WideCharToMultiByte(CP_ACP, 0, temppsfi.szTypeName, -1,
820 psfi->szTypeName, sizeof(psfi->szTypeName), NULL, NULL);
821 }
822 else
824
825 HeapFree(GetProcessHeap(), 0, temppath);
826
827 return ret;
828}
829
830/*************************************************************************
831 * DuplicateIcon [SHELL32.@]
832 */
834{
836 HICON hDupIcon = 0;
837
838 TRACE("%p %p\n", hInstance, hIcon);
839
841 {
842 hDupIcon = CreateIconIndirect(&IconInfo);
843
844 /* clean up hbmMask and hbmColor */
847 }
848
849 return hDupIcon;
850}
851
852/*************************************************************************
853 * ExtractIconA [SHELL32.@]
854 */
856{
857 HICON ret;
858 INT len = MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, NULL, 0);
859 LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
860
861 TRACE("%p %s %d\n", hInstance, lpszFile, nIconIndex);
862
863 MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len);
864 ret = ExtractIconW(hInstance, lpwstrFile, nIconIndex);
865 HeapFree(GetProcessHeap(), 0, lpwstrFile);
866
867 return ret;
868}
869
870/*************************************************************************
871 * ExtractIconW [SHELL32.@]
872 */
874{
875 HICON hIcon = NULL;
876 UINT ret;
878
879 TRACE("%p %s %d\n", hInstance, debugstr_w(lpszFile), nIconIndex);
880
881 if (nIconIndex == (UINT)-1)
882 {
883 ret = PrivateExtractIconsW(lpszFile, 0, cx, cy, NULL, NULL, 0, LR_DEFAULTCOLOR);
884 if (ret != (UINT)-1 && ret)
885 return (HICON)(UINT_PTR)ret;
886 return NULL;
887 }
888 else
889 ret = PrivateExtractIconsW(lpszFile, nIconIndex, cx, cy, &hIcon, NULL, 1, LR_DEFAULTCOLOR);
890
891 if (ret == (UINT)-1)
892 return (HICON)1;
893 else if (ret > 0 && hIcon)
894 return hIcon;
895
896 return NULL;
897}
898
899/*************************************************************************
900 * Printer_LoadIconsW [SHELL32.205]
901 */
902VOID WINAPI Printer_LoadIconsW(LPCWSTR wsPrinterName, HICON * pLargeIcon, HICON * pSmallIcon)
903{
905
906 TRACE("(%s, %p, %p)\n", debugstr_w(wsPrinterName), pLargeIcon, pSmallIcon);
907
908 /* We should check if wsPrinterName is
909 1. the Default Printer or not
910 2. connected or not
911 3. a Local Printer or a Network-Printer
912 and use different Icons
913 */
914 if((wsPrinterName != NULL) && (wsPrinterName[0] != 0))
915 {
916 FIXME("(select Icon by PrinterName %s not implemented)\n", debugstr_w(wsPrinterName));
917 }
918
919 if(pLargeIcon != NULL)
920 *pLargeIcon = LoadImageW(shell32_hInstance,
921 (LPCWSTR) MAKEINTRESOURCE(iconindex), IMAGE_ICON,
923
924 if(pSmallIcon != NULL)
925 *pSmallIcon = LoadImageW(shell32_hInstance,
926 (LPCWSTR) MAKEINTRESOURCE(iconindex), IMAGE_ICON,
927 16, 16, LR_DEFAULTCOLOR);
928}
929
930/*************************************************************************
931 * Printers_RegisterWindowW [SHELL32.213]
932 * used by "printui.dll":
933 * find the Window of the given Type for the specific Printer and
934 * return the already existent hwnd or open a new window
935 */
937 HANDLE * phClassPidl, HWND * phwnd)
938{
939 FIXME("(%s, %x, %p (%p), %p (%p)) stub!\n", debugstr_w(wsPrinter), dwType,
940 phClassPidl, (phClassPidl != NULL) ? *(phClassPidl) : NULL,
941 phwnd, (phwnd != NULL) ? *(phwnd) : NULL);
942
943 return FALSE;
944}
945
946/*************************************************************************
947 * Printers_UnregisterWindow [SHELL32.214]
948 */
950{
951 FIXME("(%p, %p) stub!\n", hClassPidl, hwnd);
952}
953
954/*************************************************************************/
955
956typedef struct
957{
959#ifdef __REACTOS__
960 LPCWSTR szOSVersion;
961#endif
964} ABOUT_INFO;
965
966/*************************************************************************
967 * SHHelpShortcuts_RunDLLA [SHELL32.@]
968 *
969 */
971{
972 FIXME("(%x, %x, %x, %x) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4);
973 return 0;
974}
975
976/*************************************************************************
977 * SHHelpShortcuts_RunDLLA [SHELL32.@]
978 *
979 */
981{
982 FIXME("(%x, %x, %x, %x) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4);
983 return 0;
984}
985
986/*************************************************************************
987 * SHLoadInProc [SHELL32.@]
988 * Create an instance of specified object class from within
989 * the shell process and release it immediately
990 */
992{
993 void *ptr = NULL;
994
995 TRACE("%s\n", debugstr_guid(rclsid));
996
997 CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown,&ptr);
998 if(ptr)
999 {
1000 IUnknown * pUnk = ptr;
1001 IUnknown_Release(pUnk);
1002 return S_OK;
1003 }
1004 return DISP_E_MEMBERNOTFOUND;
1005}
1006
1008{
1009 DWORD dwBufferSize;
1010 DWORD dwType;
1012
1013 if( RegQueryValueExW(hKey, Value, NULL, &dwType, NULL, &dwBufferSize) == ERROR_SUCCESS )
1014 {
1015 if(dwType == REG_SZ)
1016 {
1017 lpBuffer = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, dwBufferSize);
1018
1019 if(lpBuffer)
1020 {
1021 if( RegQueryValueExW(hKey, Value, NULL, &dwType, (LPBYTE)lpBuffer, &dwBufferSize) == ERROR_SUCCESS )
1022 {
1024 }
1025
1027 }
1028 }
1029 }
1030}
1031
1033{
1034 switch(msg)
1035 {
1036 case WM_INITDIALOG:
1037 {
1038 const char* const *pstr = SHELL_Authors;
1039
1040 // Add the authors to the list
1042
1043 while (*pstr)
1044 {
1045 WCHAR name[64];
1046
1047 /* authors list is in utf-8 format */
1048 MultiByteToWideChar( CP_UTF8, 0, *pstr, -1, name, sizeof(name)/sizeof(WCHAR) );
1050 pstr++;
1051 }
1052
1054
1055 return TRUE;
1056 }
1057 }
1058
1059 return FALSE;
1060}
1061/*************************************************************************
1062 * AboutDlgProc (internal)
1063 */
1065{
1066#ifdef __REACTOS__
1067
1068 static DWORD cxLogoBmp;
1069 static DWORD cyLogoBmp, cyLineBmp;
1070 static HBITMAP hLogoBmp, hLineBmp;
1071 static HWND hWndAuthors;
1072
1073 switch (msg)
1074 {
1075 case WM_INITDIALOG:
1076 {
1078
1079 if (info)
1080 {
1081 HKEY hRegKey;
1082 MEMORYSTATUSEX MemStat;
1083 WCHAR szAppTitle[512];
1084 WCHAR szAppTitleTemplate[512];
1085 WCHAR szAuthorsText[20];
1086
1087 // Preload the ROS bitmap
1088 if (IsWindowsServer())
1089 {
1090 // Load Server Bitmap
1092 }
1093 else
1094 {
1095 // Load Workstation Bitmap
1097 }
1099
1100 if (hLogoBmp && hLineBmp)
1101 {
1102 BITMAP bmpLogo;
1103
1104 GetObject(hLogoBmp, sizeof(BITMAP), &bmpLogo);
1105
1106 cxLogoBmp = bmpLogo.bmWidth;
1107 cyLogoBmp = bmpLogo.bmHeight;
1108
1109 GetObject(hLineBmp, sizeof(BITMAP), &bmpLogo);
1110 cyLineBmp = bmpLogo.bmHeight;
1111 }
1112
1113 // Set App-specific stuff (icon, app name, szOtherStuff string)
1115
1116 GetWindowTextW(hWnd, szAppTitleTemplate, ARRAY_SIZE(szAppTitleTemplate));
1117 swprintf(szAppTitle, szAppTitleTemplate, info->szApp);
1119
1123
1124 // Set the registered user and organization name
1125 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
1126 0, KEY_QUERY_VALUE, &hRegKey) == ERROR_SUCCESS)
1127 {
1128 SetRegTextData(hWnd, hRegKey, L"RegisteredOwner", IDC_ABOUT_REG_USERNAME);
1129 SetRegTextData(hWnd, hRegKey, L"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME);
1130
1133 {
1135 }
1136
1137 RegCloseKey(hRegKey);
1138 }
1139
1140 // Set the value for the installed physical memory
1141 MemStat.dwLength = sizeof(MemStat);
1142 if (GlobalMemoryStatusEx(&MemStat))
1143 {
1144 WCHAR szBuf[12];
1145
1146 if (MemStat.ullTotalPhys > 1024 * 1024 * 1024)
1147 {
1148 double dTotalPhys;
1149 WCHAR szDecimalSeparator[4];
1150 WCHAR szUnits[3];
1151
1152 // We're dealing with GBs or more
1153 MemStat.ullTotalPhys /= 1024 * 1024;
1154
1155 if (MemStat.ullTotalPhys > 1024 * 1024)
1156 {
1157 // We're dealing with TBs or more
1158 MemStat.ullTotalPhys /= 1024;
1159
1160 if (MemStat.ullTotalPhys > 1024 * 1024)
1161 {
1162 // We're dealing with PBs or more
1163 MemStat.ullTotalPhys /= 1024;
1164
1165 dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
1166 wcscpy(szUnits, L"PB");
1167 }
1168 else
1169 {
1170 dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
1171 wcscpy(szUnits, L"TB");
1172 }
1173 }
1174 else
1175 {
1176 dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
1177 wcscpy(szUnits, L"GB");
1178 }
1179
1180 // We need the decimal point of the current locale to display the RAM size correctly
1182 szDecimalSeparator,
1183 ARRAY_SIZE(szDecimalSeparator)) > 0)
1184 {
1185 UCHAR uDecimals;
1186 UINT uIntegral;
1187
1188 uIntegral = (UINT)dTotalPhys;
1189 uDecimals = (UCHAR)((UINT)(dTotalPhys * 100) - uIntegral * 100);
1190
1191 // Display the RAM size with 2 decimals
1192 swprintf(szBuf, L"%u%s%02u %s", uIntegral, szDecimalSeparator, uDecimals, szUnits);
1193 }
1194 }
1195 else
1196 {
1197 // We're dealing with MBs, don't show any decimals
1198 swprintf(szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024);
1199 }
1200
1202 }
1203
1204 // Add the Authors dialog
1206 LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, ARRAY_SIZE(szAuthorsText));
1207 SetDlgItemTextW(hWnd, IDC_ABOUT_AUTHORS, szAuthorsText);
1208 }
1209
1210 return TRUE;
1211 }
1212
1213 case WM_PAINT:
1214 {
1215 if (hLogoBmp && hLineBmp)
1216 {
1217 PAINTSTRUCT ps;
1218 HDC hdc;
1219 HDC hdcMem;
1220 HGDIOBJ hOldObj;
1221
1222 hdc = BeginPaint(hWnd, &ps);
1224
1225 if (hdcMem)
1226 {
1227 hOldObj = SelectObject(hdcMem, hLogoBmp);
1228 BitBlt(hdc, 0, 0, cxLogoBmp, cyLogoBmp, hdcMem, 0, 0, SRCCOPY);
1229
1230 SelectObject(hdcMem, hLineBmp);
1231 BitBlt(hdc, 0, cyLogoBmp, cxLogoBmp, cyLineBmp, hdcMem, 0, 0, SRCCOPY);
1232
1233 SelectObject(hdcMem, hOldObj);
1235 }
1236
1237 EndPaint(hWnd, &ps);
1238 }
1239 break;
1240 }
1241
1242 case WM_COMMAND:
1243 {
1244 switch(wParam)
1245 {
1246 case IDOK:
1247 case IDCANCEL:
1249 return TRUE;
1250
1251 case IDC_ABOUT_AUTHORS:
1252 {
1253 static BOOL bShowingAuthors = FALSE;
1254 WCHAR szAuthorsText[20];
1255
1256 if (bShowingAuthors)
1257 {
1258 LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, ARRAY_SIZE(szAuthorsText));
1259 ShowWindow(hWndAuthors, SW_HIDE);
1260 }
1261 else
1262 {
1263 LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_BACK, szAuthorsText, ARRAY_SIZE(szAuthorsText));
1264 ShowWindow(hWndAuthors, SW_SHOW);
1265 }
1266
1267 SetDlgItemTextW(hWnd, IDC_ABOUT_AUTHORS, szAuthorsText);
1268 bShowingAuthors = !bShowingAuthors;
1269 return TRUE;
1270 }
1271 }
1272 break;
1273 }
1274
1275 case WM_CLOSE:
1277 break;
1278 }
1279
1280#endif // __REACTOS__
1281
1282 return 0;
1283}
1284
1285
1286/*************************************************************************
1287 * ShellAboutA [SHELL32.288]
1288 */
1290{
1291 BOOL ret;
1292 LPWSTR appW = NULL, otherW = NULL;
1293 int len;
1294
1295 if (szApp)
1296 {
1297 len = MultiByteToWideChar(CP_ACP, 0, szApp, -1, NULL, 0);
1298 appW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1299 MultiByteToWideChar(CP_ACP, 0, szApp, -1, appW, len);
1300 }
1301 if (szOtherStuff)
1302 {
1303 len = MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, NULL, 0);
1304 otherW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1305 MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, otherW, len);
1306 }
1307
1308 ret = ShellAboutW(hWnd, appW, otherW, hIcon);
1309
1310 HeapFree(GetProcessHeap(), 0, otherW);
1311 HeapFree(GetProcessHeap(), 0, appW);
1312 return ret;
1313}
1314
1315
1316/*************************************************************************
1317 * ShellAboutW [SHELL32.289]
1318 */
1320 HICON hIcon )
1321{
1323 HRSRC hRes;
1324 DLGTEMPLATE *DlgTemplate;
1325 BOOL bRet;
1326#ifdef __REACTOS__
1327 WCHAR szVersionString[256];
1328 WCHAR szFormat[256];
1329#endif
1330
1331 TRACE("\n");
1332
1333 // DialogBoxIndirectParamW will be called with the hInstance of the calling application, so we have to preload the dialog template
1335 if(!hRes)
1336 return FALSE;
1337
1338 DlgTemplate = (DLGTEMPLATE *)LoadResource(shell32_hInstance, hRes);
1339 if(!DlgTemplate)
1340 return FALSE;
1341
1342#ifdef __REACTOS__
1343 /* Output the version OS kernel strings */
1345 StringCchPrintfW(szVersionString, _countof(szVersionString), szFormat, KERNEL_VERSION_STR, KERNEL_VERSION_BUILD_STR);
1346#endif
1347
1348 info.szApp = szApp;
1349#ifdef __REACTOS__
1350 info.szOSVersion = szVersionString;
1351#endif
1352 info.szOtherStuff = szOtherStuff;
1353 info.hIcon = hIcon ? hIcon : LoadIconW( 0, (LPWSTR)IDI_WINLOGO );
1354
1356 DlgTemplate, hWnd, AboutDlgProc, (LPARAM)&info );
1357 return bRet;
1358}
1359
1360/*************************************************************************
1361 * FreeIconList (SHELL32.@)
1362 */
1364{
1365 FIXME("%x: stub\n",dw);
1366}
1367
1368/*************************************************************************
1369 * SHLoadNonloadedIconOverlayIdentifiers (SHELL32.@)
1370 */
1372{
1373 FIXME("stub\n");
1374 return S_OK;
1375}
static BOOL IsWindowsServer()
DWORD dwFileAttributes
static int argc
Definition: ServiceArgs.c:12
#define shell32_hInstance
#define isspace(c)
Definition: acclib.h:69
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define ARRAY_SIZE(A)
Definition: main.h:33
#define IDI_SHELL_FOLDER
Definition: treeview.c:36
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define RegCloseKey(hKey)
Definition: registry.h:49
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
UINT uFlags
Definition: api.c:59
HICON WINAPI ImageList_GetIcon(HIMAGELIST himl, INT i, UINT fStyle)
Definition: imagelist.c:1963
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define SetFilePointer
Definition: compat.h:743
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CreateFileW
Definition: compat.h:741
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define FILE_SHARE_READ
Definition: compat.h:136
#define lstrcpynW
Definition: compat.h:738
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
BOOL WINAPI GetBinaryTypeW(LPCWSTR lpApplicationName, LPDWORD lpBinaryType)
Definition: vdm.c:1243
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1665
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1579
#define IShellFolder_GetDisplayNameOf
Definition: utils.cpp:13
#define swprintf
Definition: precomp.h:40
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
#define SHGFI_ADDOVERLAYS
Definition: entries.h:77
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
FxAutoRegKey hKey
pKey DeleteObject()
GLdouble s
Definition: gl.h:2039
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
INT SIC_GetIconIndex(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
Definition: iconcache.cpp:440
BOOL PidlToSicIndex(IShellFolder *sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int *pIndex)
Definition: iconcache.cpp:709
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:683
_Out_opt_ PICONINFO IconInfo
Definition: ntuser.h:2294
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define SEEK_SET
Definition: jmemansi.c:26
#define d
Definition: ke_i.h:81
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define REG_SZ
Definition: layer.c:22
static PVOID ptr
Definition: dispmode.c:27
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
IMAGE_NT_HEADERS nt
Definition: module.c:50
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
TCHAR szAppTitle[256]
Definition: mplay32.c:27
#define argv
Definition: mplay32.c:18
HICON hIcon
Definition: msconfig.c:44
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
u32_t magic(void)
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define LOCALE_USER_DEFAULT
#define IMAGE_SUBSYSTEM_WINDOWS_GUI
Definition: ntimage.h:437
#define L(x)
Definition: ntvdm.h:50
#define PathCombineW
Definition: pathcch.h:317
#define IMAGE_NT_SIGNATURE
Definition: pedump.c:93
#define RT_DIALOG
Definition: pedump.c:367
#define IMAGE_FILE_DLL
Definition: pedump.c:169
#define IMAGE_OS2_SIGNATURE
Definition: pedump.c:90
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:940
HRESULT WINAPI SHILCreateFromPathW(LPCWSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
Definition: pidl.c:401
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1350
void _ILGetFileType(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
Definition: pidl.c:2500
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1342
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
Definition: pidl.c:2454
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define ILD_NORMAL
Definition: commctrl.h:417
_Out_opt_ int * cx
Definition: commctrl.h:585
#define REFCLSID
Definition: guiddef.h:117
#define strlenW(s)
Definition: unicode.h:34
#define strcatW(d, s)
Definition: unicode.h:36
#define strcpyW(d, s)
Definition: unicode.h:35
const WCHAR * str
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define CP_UTF8
Definition: nls.h:20
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:297
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:49
VOID WINAPI Printer_LoadIconsW(LPCWSTR wsPrinterName, HICON *pLargeIcon, HICON *pSmallIcon)
Definition: shell32_main.c:902
BOOL SHELL_IsShortcut(LPCITEMIDLIST pidlLast)
Definition: shell32_main.c:383
DWORD WINAPI SHHelpShortcuts_RunDLLW(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
Definition: shell32_main.c:980
#define SHGFI_KNOWN_FLAGS
Definition: shell32_main.c:404
static DWORD shgfi_get_exe_type(LPCWSTR szFullPath)
Definition: shell32_main.c:314
HRESULT WINAPI SHLoadNonloadedIconOverlayIdentifiers(VOID)
static INT_PTR CALLBACK AboutDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
const char *const SHELL_Authors[]
Definition: shell32_main.c:51
HRESULT WINAPI SHLoadInProc(REFCLSID rclsid)
Definition: shell32_main.c:991
HICON WINAPI DuplicateIcon(HINSTANCE hInstance, HICON hIcon)
Definition: shell32_main.c:833
HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex)
Definition: shell32_main.c:873
HICON WINAPI ExtractIconA(HINSTANCE hInstance, LPCSTR lpszFile, UINT nIconIndex)
Definition: shell32_main.c:855
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
Definition: shell32_main.c:80
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path, DWORD dwFileAttributes, SHFILEINFOA *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:782
VOID WINAPI Printers_UnregisterWindow(HANDLE hClassPidl, HWND hwnd)
Definition: shell32_main.c:949
BOOL WINAPI Printers_RegisterWindowW(LPCWSTR wsPrinter, DWORD dwType, HANDLE *phClassPidl, HWND *phwnd)
Definition: shell32_main.c:936
BOOL WINAPI ShellAboutA(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:415
INT_PTR CALLBACK AboutAuthorsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static VOID SetRegTextData(HWND hWnd, HKEY hKey, LPCWSTR Value, UINT uID)
DWORD WINAPI SHHelpShortcuts_RunDLLA(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
Definition: shell32_main.c:970
void WINAPI FreeIconList(DWORD dw)
#define SHGFI_ATTR_SPECIFIED
Definition: shellapi.h:174
#define SHGFI_OPENICON
Definition: shellapi.h:178
#define SHGFI_LINKOVERLAY
Definition: shellapi.h:172
#define SHGFI_SYSICONINDEX
Definition: shellapi.h:171
#define SHGFI_ICONLOCATION
Definition: shellapi.h:169
#define SHGFI_DISPLAYNAME
Definition: shellapi.h:166
#define SHGFI_ICON
Definition: shellapi.h:164
#define SHGFI_TYPENAME
Definition: shellapi.h:167
#define SHGFI_USEFILEATTRIBUTES
Definition: shellapi.h:181
#define SHGFI_ATTRIBUTES
Definition: shellapi.h:168
#define SHGFI_SMALLICON
Definition: shellapi.h:176
#define SHGFI_SELECTED
Definition: shellapi.h:173
#define SHGFI_OVERLAYINDEX
Definition: shellapi.h:163
#define SHGFI_PIDL
Definition: shellapi.h:180
#define SHGFI_EXETYPE
Definition: shellapi.h:170
#define SHGFI_SHELLICONSIZE
Definition: shellapi.h:179
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
HRESULT hr
Definition: shlfolder.c:183
#define IDC_ABOUT_REG_USERNAME
Definition: shresdef.h:380
#define IDC_ABOUT_REG_TO
Definition: shresdef.h:379
#define IDC_ABOUT_ICON
Definition: shresdef.h:374
#define IDB_REACTOS_SERVER
Definition: shresdef.h:32
#define IDC_ABOUT_PHYSMEM
Definition: shresdef.h:382
#define IDB_LINEBAR
Definition: shresdef.h:33
#define IDC_ABOUT_APPNAME
Definition: shresdef.h:375
#define IDC_ABOUT_AUTHORS_LISTBOX
Definition: shresdef.h:387
#define IDD_ABOUT
Definition: shresdef.h:373
#define IDC_ABOUT_AUTHORS
Definition: shresdef.h:386
#define IDS_ABOUT_VERSION_STRING
Definition: shresdef.h:376
#define IDC_ABOUT_REG_ORGNAME
Definition: shresdef.h:381
#define IDI_SHELL_PRINTERS_FOLDER
Definition: shresdef.h:593
#define IDB_REACTOS_WORKSTATION
Definition: shresdef.h:31
#define IDC_ABOUT_VERSION
Definition: shresdef.h:377
#define IDC_ABOUT_OTHERSTUFF
Definition: shresdef.h:378
#define IDD_ABOUT_AUTHORS
Definition: shresdef.h:385
#define IDS_SHELL_ABOUT_BACK
Definition: shresdef.h:139
#define IDS_SHELL_ABOUT_AUTHORS
Definition: shresdef.h:138
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
TCHAR * cmdline
Definition: stretchblt.cpp:32
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
LPCWSTR szOtherStuff
Definition: shell32_main.c:962
LPCWSTR szApp
Definition: shell32_main.c:958
Definition: bl.h:1331
HBITMAP hbmColor
Definition: winuser.h:3127
HBITMAP hbmMask
Definition: winuser.h:3126
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
CHAR szTypeName[80]
Definition: shellapi.h:369
HICON hIcon
Definition: shellapi.h:365
DWORD dwAttributes
Definition: shellapi.h:367
CHAR szDisplayName[MAX_PATH]
Definition: shellapi.h:368
WCHAR szTypeName[80]
Definition: shellapi.h:376
DWORD dwAttributes
Definition: shellapi.h:374
WCHAR szDisplayName[MAX_PATH]
Definition: shellapi.h:375
HICON hIcon
Definition: shellapi.h:372
Definition: name.c:39
Definition: ps.c:97
#define DWORD_PTR
Definition: treelist.c:76
#define isblank(x)
Definition: trio.c:93
int32_t INT_PTR
Definition: typedefs.h:64
uint32_t DWORD_PTR
Definition: typedefs.h:65
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
DWORD dwAttributes
Definition: vdmdbg.h:34
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int ret
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
HDC hdcMem
Definition: welcome.c:104
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1384
#define SCS_PIF_BINARY
Definition: winbase.h:240
#define SCS_DOS_BINARY
Definition: winbase.h:238
#define LMEM_FIXED
Definition: winbase.h:368
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
#define GetObject
Definition: wingdi.h:4468
BOOL WINAPI DeleteDC(_In_ HDC)
#define LOCALE_SDECIMAL
Definition: winnls.h:42
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define WM_PAINT
Definition: winuser.h:1620
#define SW_HIDE
Definition: winuser.h:768
#define WM_CLOSE
Definition: winuser.h:1621
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4829
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition: cursoricon.c:2625
INT_PTR WINAPI DialogBoxIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define STM_SETICON
Definition: winuser.h:2092
#define IDCANCEL
Definition: winuser.h:831
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2089
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
UINT WINAPI PrivateExtractIconsW(_In_reads_(MAX_PATH) LPCWSTR szFileName, _In_ int nIconIndex, _In_ int cxIcon, _In_ int cyIcon, _Out_writes_opt_(nIcons) HICON *phicon, _Out_writes_opt_(nIcons) UINT *piconid, _In_ UINT nIcons, _In_ UINT flags)
#define WM_COMMAND
Definition: winuser.h:1740
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2247
#define SM_CYSMICON
Definition: winuser.h:1013
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define WM_INITDIALOG
Definition: winuser.h:1739
#define LB_ADDSTRING
Definition: winuser.h:2031
#define GWLP_HINSTANCE
Definition: winuser.h:856
#define IDI_WINLOGO
Definition: winuser.h:709
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:830
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define SM_CXSMICON
Definition: winuser.h:1012
#define SM_CYICON
Definition: winuser.h:973
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define CreateDialogW(h, n, w, f)
Definition: winuser.h:4281
#define LoadImage
Definition: winuser.h:5824
#define LR_DEFAULTCOLOR
Definition: winuser.h:1087
#define SW_SHOW
Definition: winuser.h:775
#define LR_DEFAULTSIZE
Definition: winuser.h:1094
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SM_CXICON
Definition: winuser.h:972
#define MAKEINTRESOURCE
Definition: winuser.h:591
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2119
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define WM_SETREDRAW
Definition: winuser.h:1616
const char * LPCSTR
Definition: xmlstorage.h:183
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185