source: trunk/src/shell32/shell32.cpp@ 4

Last change on this file since 4 was 4, checked in by ktk, 26 years ago

Import

File size: 64.8 KB
Line 
1/* $Id: shell32.cpp,v 1.1 1999-05-24 20:19:57 ktk Exp $ */
2
3/*
4 * Win32 SHELL32 for OS/2
5 *
6 * 1998/06/15 Patrick Haller (haller@zebra.fh-weingarten.de)
7 *
8 * @(#) shell32.c 1.0.0 1998/06/15 PH Merge WINE/SHELLORD.C
9 *
10 *
11 * Copyright 1997 Marcus Meissner
12 * Copyright 1988 Patrick Haller (adapted for win32os2)
13 *
14 * Project Odin Software License can be found in LICENSE.TXT
15 *
16 */
17
18
19/*****************************************************************************
20 * Includes *
21 *****************************************************************************/
22
23#include <os2win.h>
24#include <shellapi.h>
25#include <winreg.h>
26#include "shell32.h"
27
28#include <stdarg.h>
29//#include <builtin.h>
30#include <stdio.h>
31#include <stdlib.h>
32#include <string.h>
33
34#include <misc.h>
35#include <nameid.h>
36#include <unicode.h>
37
38
39//static const char* lpstrMsgWndCreated = "OTHERWINDOWCREATED";
40//static const char* lpstrMsgWndDestroyed = "OTHERWINDOWDESTROYED";
41//static const char* lpstrMsgShellActivate = "ACTIVATESHELLWINDOW";
42
43//static HWND SHELL_hWnd = 0;
44//static HHOOK SHELL_hHook = 0;
45//static USHORT uMsgWndCreated = 0;
46//static USHORT uMsgWndDestroyed = 0;
47//static USHORT uMsgShellActivate = 0;
48
49
50
51/*****************************************************************************
52 * Types & Defines *
53 *****************************************************************************/
54
55//******************************************************************************
56//******************************************************************************
57VOID WIN32API DragAcceptFiles(HWND hwnd,
58 BOOL fAccept)
59{
60 dprintf(("SHELL32: DragAcceptFiles (%0uxh, %08xh) not implemented.\n",
61 hwnd,
62 fAccept));
63}
64//******************************************************************************
65//******************************************************************************
66VOID WIN32API DragFinish(HDROP hDrop)
67{
68 dprintf(("SHELL32: DragFinish(%08xh) not implemented.\n",
69 hDrop));
70}
71//******************************************************************************
72//******************************************************************************
73UINT WIN32API DragQueryFileA(HDROP hDrop,
74 UINT iFile,
75 LPTSTR lpszFile,
76 UINT cch)
77{
78 dprintf(("SHELL32: DragQueryFileA(%08xh,%08xh,%s,%08xh) not implemented.\n",
79 hDrop,
80 iFile,
81 lpszFile,
82 cch));
83
84 return(0);
85}
86//******************************************************************************
87//******************************************************************************
88UINT WIN32API DragQueryFileAorW(HDROP hDrop,
89 UINT iFile,
90 LPTSTR lpszFile,
91 UINT cch)
92{
93 dprintf(("SHELL32: DragQueryFileAorW(%08xh,%08xh,%s,%08xh) not implemented.\n",
94 hDrop,
95 iFile,
96 lpszFile,
97 cch));
98
99 return(0);
100}
101//******************************************************************************
102//******************************************************************************
103UINT WIN32API DragQueryFileW(HDROP hDrop,
104 UINT iFile,
105 LPWSTR lpszFile,
106 UINT cch)
107{
108 dprintf(("SHELL32: DragQueryFileW(%08xh,%08xh,%s,%08xh) not implemented.\n",
109 hDrop,
110 iFile,
111 lpszFile,
112 cch));
113
114 return(0);
115}
116//******************************************************************************
117//******************************************************************************
118BOOL WIN32API DragQueryPoint(HDROP hDrop,
119 LPPOINT lppt)
120{
121 dprintf(("SHELL32: DragQueryPoint (%08xh,%08xh) not implemented.\n",
122 hDrop,
123 lppt));
124
125 return(FALSE);
126}
127//******************************************************************************
128//******************************************************************************
129//******************************************************************************
130//******************************************************************************
131HINSTANCE WIN32API ShellExecuteA(HWND hwnd,
132 LPCTSTR lpOperation,
133 LPCTSTR lpFile,
134 LPCTSTR lpParameters,
135 LPCTSTR lpDirectory,
136 INT nShowCmd)
137{
138 dprintf (("SHELL32: ShellExecuteA(%08xh,%s,%s,%s,%s,%08xh) not implemented.\n",
139 hwnd,
140 lpOperation,
141 lpFile,
142 lpParameters,
143 lpDirectory,
144 nShowCmd));
145
146 return(0); //out of memory
147}
148//******************************************************************************
149//TODO: Make nice dialog window
150//******************************************************************************
151int WIN32API ShellAboutA(HWND hwnd,
152 LPCTSTR szApp,
153 LPCTSTR szOtherStuff,
154 HICON hIcon)
155{
156 dprintf(("SHELL32: ShellAboutA(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
157 hwnd,
158 szApp,
159 szOtherStuff,
160 hIcon));
161
162 /* @@@PH 98/06/07 */
163 if (szOtherStuff == NULL) szOtherStuff = "";
164 if (szApp == NULL) szApp = "";
165
166 MessageBoxA(NULL,
167 szOtherStuff,
168 szApp,
169 MB_OK); /*PLF Sun 97-11-23 22:58:49*/
170
171 return(TRUE);
172}
173//******************************************************************************
174//******************************************************************************
175int WIN32API ShellAboutW(HWND hwnd,
176 LPCWSTR szApp,
177 LPCWSTR szOtherStuff,
178 HICON hIcon)
179{
180 dprintf(("SHELL32: ShellAboutW(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
181 hwnd,
182 szApp,
183 szOtherStuff,
184 hIcon));
185
186 return(TRUE);
187}
188//******************************************************************************
189//Borrowed from Wine
190//******************************************************************************
191LPWSTR * WIN32API CommandLineToArgvW(LPCWSTR lpCmdLine,
192 int *pNumArgs)
193{
194 LPWSTR *argv, s, t;
195 int i;
196
197 dprintf(("SHELL32: CommandLineToArgvW(%s,%08xh)\n",
198 lpCmdLine,
199 pNumArgs));
200
201 s = (LPWSTR)lpCmdLine;
202 i = 0;
203 while (*s) {
204 /* space */
205 if (*s==0x0020) {
206 i++;
207 s++;
208 while (*s && *s==0x0020)
209 s++;
210 continue;
211 }
212 s++;
213 }
214 argv = (LPWSTR *)LocalAlloc(LPTR, sizeof(LPWSTR)*(i+1));
215 s = t = (LPWSTR)lpCmdLine;
216 i = 0;
217 while(*s) {
218 if (*s==0x0020) {
219 *s=0;
220 argv[i++] = t;
221 *s=0x0020;
222 while (*s && *s==0x0020)
223 s++;
224 if(*s)
225 t=s+1;
226 else t=s;
227 continue;
228 }
229 s++;
230 }
231 if(*t)
232 argv[i++] = t;
233
234 argv[i]=NULL;
235 *pNumArgs = i;
236 return argv;
237}
238//******************************************************************************
239//******************************************************************************
240HICON WIN32API ExtractIconA(HINSTANCE hInst,
241 LPCSTR lpszExeFileName,
242 UINT nIconIndex)
243{
244 dprintf(("SHELL32: ExtractIconA(%08xh,%s,%08xh) not implemented.\n",
245 hInst,
246 lpszExeFileName,
247 nIconIndex));
248
249 return(NULL);
250}
251//******************************************************************************
252//******************************************************************************
253HICON WIN32API ExtractIconW(HINSTANCE hInst,
254 LPCWSTR lpszExeFileName,
255 UINT nIconIndex)
256{
257 HICON hicon = NULL;
258 char *astring = UnicodeToAsciiString((LPWSTR)lpszExeFileName);
259
260 dprintf(("SHELL32: ExtractIconW(%08xh,%s,%08xh) not implemented.\n",
261 hInst,
262 lpszExeFileName,
263 nIconIndex));
264
265
266 FreeAsciiString(astring);
267 return(hicon);
268}
269/*****************************************************************************
270 * Name : UINT WIN32API ExtractIconExA
271 * Purpose :
272 * Parameters:
273 * Variables :
274 * Result :
275 * Remark :
276 * Status : UNTESTED STUB
277 *
278 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
279 *****************************************************************************/
280
281DWORD WIN32API ExtractIconExA(LPCSTR lpszFile,
282 int nIconIndex,
283 HICON *phiconLarge,
284 HICON *phiconSmall,
285 UINT nIcons)
286{
287 dprintf(("SHELL32: ExtractIconExA(%s,%08xh,%08xh,%08xh,%u) not implemented.\n",
288 lpszFile,
289 nIconIndex,
290 phiconLarge,
291 phiconSmall,
292 nIcons));
293
294 return (0);
295}
296
297
298/*****************************************************************************
299 * Name : UINT WIN32API ExtractIconExW
300 * Purpose :
301 * Parameters:
302 * Variables :
303 * Result :
304 * Remark :
305 * Status : UNTESTED STUB
306 *
307 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
308 *****************************************************************************/
309
310DWORD WIN32API ExtractIconExW(LPCWSTR lpszFile,
311 int nIconIndex,
312 HICON *phiconLarge,
313 HICON *phiconSmall,
314 UINT nIcons)
315{
316 dprintf(("SHELL32: ExtractIconExW(%s,%08xh,%08xh,%08xh,%u) not implemented.\n",
317 lpszFile,
318 nIconIndex,
319 phiconLarge,
320 phiconSmall,
321 nIcons));
322
323 return (0);
324}
325
326
327//******************************************************************************
328HINSTANCE WIN32API FindExecutableA(LPCSTR lpszFile,
329 LPCSTR lpszDir,
330 LPTSTR lpszResult)
331{
332 dprintf(("SHELL32: FindExecutableA (%s,%s,%s) not implemented.\n",
333 lpszFile,
334 lpszDir,
335 lpszResult));
336
337 return(NULL);
338}
339//******************************************************************************
340//******************************************************************************
341HINSTANCE WIN32API FindExecutableW(LPCWSTR lpszFile,
342 LPCWSTR lpszDir,
343 LPWSTR lpszResult)
344{
345 dprintf(("SHELL32: FindExecutableW (%s,%s,%s) not implemented.\n",
346 lpszFile,
347 lpszDir,
348 lpszResult));
349
350 return(NULL);
351}
352//******************************************************************************
353//******************************************************************************
354HRESULT WIN32API SHGetMalloc(LPMALLOC *ppMalloc)
355{
356 dprintf(("SHELL32: SHGetMalloc(%08xh) not implemented.\n",
357 ppMalloc));
358
359 return(0);
360}
361//******************************************************************************
362//******************************************************************************
363DWORD WIN32API SHGetFileInfoA(LPCSTR pszPath,
364 DWORD dwFileAttributes,
365 SHFILEINFOA *psfi,
366 UINT cbFileInfo,
367 UINT uFlags)
368{
369 dprintf(("SHELL32: SHGetFileInfoA (%s,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
370 pszPath,
371 dwFileAttributes,
372 psfi,
373 cbFileInfo,
374 uFlags));
375
376 return(0);
377}
378//******************************************************************************
379//******************************************************************************
380DWORD WIN32API SHGetFileInfoW(LPCWSTR pszPath,
381 DWORD dwFileAttributes,
382 SHFILEINFOW *psfi,
383 UINT cbFileInfo,
384 UINT uFlags)
385{
386 char *astring = UnicodeToAsciiString((LPWSTR)pszPath);
387
388 dprintf(("SHELL32: SHGetFileInfoW (%s,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
389 astring,
390 dwFileAttributes,
391 psfi,
392 cbFileInfo,
393 uFlags));
394
395 FreeAsciiString(astring);
396 return(0);
397}
398//******************************************************************************
399//******************************************************************************
400HRESULT WIN32API SHGetDesktopFolder(LPSHELLFOLDER *ppshf)
401{
402 dprintf(("SHELL32: SHGetDesktopFolder(%08xh) not implemented.\n",
403 ppshf));
404
405 return(1);
406}
407//******************************************************************************
408//******************************************************************************
409void WIN32API SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
410{
411 dprintf(("SHELL32: SHAddToRecentDocs(%08xh,%08xh) not implemented.\n",
412 uFlags,
413 pv));
414}
415//******************************************************************************
416//******************************************************************************
417void WIN32API SHChangeNotify(LONG wEventId,
418 UINT uFlags,
419 LPCVOID dwItem1,
420 LPCVOID dwItem2)
421{
422 dprintf(("SHELL32: SHChangeNotify(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
423 wEventId,
424 uFlags,
425 dwItem1,
426 dwItem2));
427}
428//******************************************************************************
429//******************************************************************************
430DWORD WIN32API SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
431{
432 dprintf(("SHELL32: SHFileOperationA(%08xh) not implemented.\n",
433 lpFileOp));
434
435 return(0);
436}
437//******************************************************************************
438
439//******************************************************************************
440DWORD WIN32API SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
441{
442 dprintf(("SHELL32: SHFileOperationW(%08xh) not implemented.\n",
443 lpFileOp));
444
445 return(0);
446}
447//******************************************************************************
448
449//******************************************************************************
450BOOL WIN32API SHGetPathFromIDListA(LPCITEMIDLIST pidl,
451 LPSTR pszPath)
452{
453 dprintf(("SHELL32: SHGetPathFromIDListA(%08xh,%s) not implemented.\n",
454 pidl,
455 pszPath));
456
457 return(FALSE);
458}
459//******************************************************************************
460//******************************************************************************
461HRESULT WIN32API SHGetSpecialFolderLocation(HWND hwndOwner,
462 int nFolder,
463 LPITEMIDLIST * ppidl)
464{
465 dprintf(("SHELL32: SHGetSpecialFolderLocation(%08xh,%08xh,%08xh) not implemented.\n",
466 hwndOwner,
467 nFolder,
468 ppidl));
469
470 return(1);
471}
472//******************************************************************************
473//******************************************************************************
474LPITEMIDLIST WIN32API SHBrowseForFolder(LPBROWSEINFOA lpbi)
475{
476 dprintf(("SHELL32: SHBrowseForFolder(%08xh) not implemented.\n",
477 lpbi));
478
479 return(NULL);
480}
481//******************************************************************************
482
483
484/*************************************************************************
485 * Shell_NotifyIcon [SHELL32.240]
486 * FIXME
487 * This function is supposed to deal with the systray.
488 * Any ideas on how this is to be implimented?
489 */
490BOOL WIN32API Shell_NotifyIconA(DWORD dwMessage,
491 PNOTIFYICONDATAA pnid )
492{
493 dprintf(("SHELL32: Shell_NotifyIconA(%08xh,%08xh) not implemented.\n",
494 dwMessage,
495 pnid));
496
497 return FALSE;
498}
499
500
501/*************************************************************************
502 * Shell_NotifyIcon [SHELL32.240]
503 * FIXME
504 * This function is supposed to deal with the systray.
505 * Any ideas on how this is to be implimented?
506 */
507BOOL WIN32API Shell_NotifyIconW(DWORD dwMessage,
508 PNOTIFYICONDATAW pnid )
509{
510 dprintf(("SHELL32: Shell_NotifyIconW(%08xh,%08xh) not implemented.\n",
511 dwMessage,
512 pnid));
513
514 return FALSE;
515}
516
517
518/*****************************************************************************
519 *
520 * Code merged from WINE
521 *
522 * Patrick Haller 98/06/15
523 *
524 *****************************************************************************/
525
526
527/*************************************************************************
528 * SHELL32_2 [SHELL32.2]
529 */
530DWORD WIN32API SHELL32_2(HWND hwnd,
531 DWORD x2,
532 DWORD x3,
533 DWORD x4,
534 DWORD x5,
535 DWORD x6)
536{
537 dprintf(("SHELL32: .2 (0x%04x,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx) not implemented.\n",
538 hwnd,
539 x2,
540 x3,
541 x4,
542 x5,
543 x6));
544 return 0;
545}
546
547
548/*************************************************************************
549 * SHELL32_16 [SHELL32.16]
550 * find_lastitem_in_itemidlist()
551 */
552LPSHITEMID WIN32API SHELL32_16(LPITEMIDLIST iil)
553{
554 LPSHITEMID lastsii,
555 sii;
556
557 dprintf(("SHELL32: .16 (%08xh)\n",
558 iil));
559
560 if (!iil)
561 return NULL;
562
563 sii = &(iil->mkid);
564 lastsii = sii;
565
566 while (sii->cb)
567 {
568 lastsii = sii;
569 sii = (LPSHITEMID)(((char*)sii)+sii->cb);
570 }
571
572 return lastsii;
573}
574
575
576/*************************************************************************
577 * SHELL32_29 [SHELL32.29]
578 * is_rootdir(const char*path)
579 */
580BOOL WIN32API SHELL32_29(LPCSTR x)
581{
582 dprintf(("SHELL32: .29 (%s)\n",
583 x));
584
585
586 if (!lstrcmpA(x+1,":\\")) /* "X:\" */
587 return 1;
588
589 if (!lstrcmpA(x,"\\")) /* "\" */
590 return 1;
591
592 if (x[0]=='\\' && x[1]=='\\')
593 { /* UNC "\\<xx>\" */
594 int foundbackslash = 0;
595
596 x=x+2;
597 while (*x)
598 {
599 if (*x++=='\\')
600 foundbackslash++;
601 }
602
603 if (foundbackslash<=1) /* max 1 \ more ... */
604 return 1;
605 }
606 return 0;
607}
608
609
610/*************************************************************************
611 * SHELL32_30 [SHELL32.30]
612 * get_rootdir(char*path,int drive)
613 */
614LPSTR WIN32API SHELL32_30(LPSTR root,
615 BYTE drive)
616{
617 dprintf(("SHELL32: .30 (%s, %u)\n",
618 root,
619 drive));
620
621
622 strcpy(root,
623 "A:\\");
624 root[0]+=drive;
625
626 return root;
627}
628
629
630/*************************************************************************
631 * SHELL32_31 [SHELL32.31]
632 * returns pointer to last . in last pathcomponent or at \0.
633 */
634LPSTR WIN32API SHELL32_31(LPSTR path)
635{
636 LPSTR lastpoint = NULL;
637
638 dprintf(("SHELL32: .31 (%s)\n",
639 path));
640
641
642 while (*path)
643 {
644 if (*path=='\\'||*path==' ')
645 lastpoint=NULL;
646
647 if (*path=='.')
648 lastpoint=path;
649
650 path++;
651 }
652
653 return lastpoint ? lastpoint : path;
654}
655
656
657/*************************************************************************
658 * SHELL32_32 [SHELL32.32]
659 * append \ if there is none
660 */
661LPSTR WIN32API SHELL32_32(LPSTR path)
662{
663 int len;
664
665 dprintf(("SHELL32: .31 (%s)\n",
666 path));
667
668
669 len = lstrlenA(path);
670
671 if (len && path[len-1]!='\\')
672 {
673 path[len+0]='\\';
674 path[len+1]='\0';
675 return path+len+1;
676 }
677 else
678 return path+len;
679}
680
681
682/*************************************************************************
683 * SHELL32_33 [SHELL32.33]
684 * remove spaces from beginning and end of passed string
685 */
686LPSTR WIN32API SHELL32_33(LPSTR str)
687{
688 LPSTR x = str;
689
690 dprintf(("SHELL32: .33 (%s)\n",
691 str));
692
693
694 while (*x==' ')
695 x++;
696
697 if (x!=str)
698 lstrcpyA(str,
699 x);
700
701 if (!*str)
702 return str;
703
704 x=str+strlen(str)-1;
705
706 while (*x==' ')
707 x--;
708
709 if (*x==' ')
710 *x='\0';
711
712 return x;
713}
714
715
716/*************************************************************************
717 * SHELL32_34 [SHELL32.34]
718 * basename(char *fn);
719 */
720LPSTR WIN32API SHELL32_34(LPSTR fn)
721{
722 LPSTR basefn;
723
724 dprintf(("SHELL32: .34 (%s)\n",
725 fn));
726
727
728 basefn = fn;
729 while (fn[0])
730 {
731 if (( (fn[0]=='\\') ||
732 (fn[0]==':')) && fn[1] && fn[1]!='\\')
733 basefn = fn+1;
734
735 fn++;
736 }
737
738 return basefn;
739}
740
741/*************************************************************************
742 * SHELL32_35 [SHELL32.35]
743 * bool getpath(char *pathname); truncates passed argument to a valid path
744 * returns if the string was modified or not.
745 * "\foo\xx\foo"-> "\foo\xx"
746 * "\" -> "\"
747 * "a:\foo" -> "a:\"
748 */
749DWORD WIN32API SHELL32_35(LPSTR fn)
750{
751 LPSTR x,cutplace;
752
753 dprintf(("SHELL32: .35 (%s)\n",
754 fn));
755
756
757 if (!fn[0])
758 return 0;
759 x=fn;
760 cutplace = fn;
761 while (*x) {
762 if (*x=='\\') {
763 cutplace=x++;
764 continue;
765 }
766 if (*x==':') {
767 x++;
768 if (*x=='\\')
769 cutplace=++x;
770 continue; /* already x++ed */
771 }
772 x++;
773 }
774 if (!*cutplace)
775 return 0;
776 if (cutplace==fn) {
777 if (fn[0]=='\\') {
778 if (!fn[1])
779 return 0;
780 fn[0]='\0';
781 return 1;
782 }
783 }
784 *cutplace='\0';
785 return 1;
786}
787
788/*************************************************************************
789 * SHELL32_37 [SHELL32.37]
790 * concat_paths(char*target,const char*add);
791 * concats "target\\add" and writes them to target
792 */
793LPSTR WIN32API SHELL32_37(LPSTR target,
794 LPSTR x1,
795 LPSTR x2)
796{
797 char buf[260];
798
799 dprintf(("SHELL32: .37 (%s, %s, %s)\n",
800 target,
801 x1,
802 x2));
803
804
805 if (!x2 || !x2[0])
806 {
807 lstrcpyA(target,x1);
808
809 return target;
810 }
811
812 lstrcpyA(buf,x1);
813 SHELL32_32(buf); /* append \ if not there */
814 lstrcatA(buf,x2);
815 lstrcpyA(target,buf);
816
817 return target;
818}
819
820/*************************************************************************
821 * SHELL32_36 [SHELL32.36]
822 * concat_paths(char*target,const char*add);
823 * concats "target\\add" and writes them to target
824 */
825LPSTR WIN32API SHELL32_36(LPSTR x1,
826 LPSTR x2)
827{
828 dprintf(("SHELL32: .36 (%s, %s)\n",
829 x1,
830 x2));
831
832
833 while (x2[0]=='\\')
834 x2++;
835
836 return SHELL32_37(x1,
837 x1,
838 x2);
839}
840
841/*************************************************************************
842 * SHELL32_39 [SHELL32.39]
843 * isUNC(const char*path);
844 */
845BOOL WIN32API SHELL32_39(LPCSTR path)
846{
847 dprintf (("SHELL32: .39 (%s)\n",
848 path));
849
850
851 if ((path[0]=='\\') &&
852 (path[1]=='\\'))
853 return TRUE;
854
855 return FALSE;
856}
857
858
859/*************************************************************************
860 * SHELL32_45 [SHELL32.45]
861 * file_exists(char *fn);
862 */
863BOOL WIN32API SHELL32_45(LPSTR fn)
864{
865 dprintf(("SHELL32: .45 (%s)\n",
866 fn));
867
868
869 if (GetFileAttributesA(fn)==-1)
870 return FALSE;
871 else
872 return TRUE;
873}
874
875/*************************************************************************
876 * SHELL32_52 [SHELL32.52]
877 * look for next arg in string. handle "quoted" strings
878 * returns pointer to argument *AFTER* the space. Or to the \0.
879 */
880LPSTR WIN32API SHELL32_52(LPSTR cmdline)
881{
882 BOOL qflag = FALSE;
883
884 dprintf (("SHELL32: .52 (%s)\n",
885 cmdline));
886
887
888 while (*cmdline)
889 {
890 if ((*cmdline==' ') && !qflag)
891 return cmdline+1;
892
893 if (*cmdline=='"')
894 qflag=!qflag;
895
896 cmdline++;
897 }
898 return cmdline;
899}
900
901
902/*************************************************************************
903 * SHELL32_56 [SHELL32.56]
904 * unquote string (remove ")
905 */
906VOID WIN32API SHELL32_56(LPSTR str)
907{
908 DWORD len = lstrlenA(str);
909
910 dprintf (("SHELL32: .56 (%s)\n",
911 str));
912
913
914 if (*str!='"')
915 return;
916
917 if (str[len-1]!='"')
918 return;
919
920 str[len-1]='\0';
921 lstrcpyA(str,
922 str+1);
923 return;
924}
925
926
927/*************************************************************************
928 * SHELL32_58 [SHELL32.58]
929 */
930DWORD WIN32API SHELL32_58(LPCSTR src,
931 DWORD x2,
932 LPSTR target,
933 DWORD pathlen)
934{
935 dprintf (("SHELL32: .58 (%s, %08xh, %08xh, %08xh) not implemented\n",
936 src,
937 x2,
938 target,
939 pathlen));
940
941 return 0;
942}
943
944
945/*************************************************************************
946 * SHELL32_62 [SHELL32.62]
947 */
948DWORD WIN32API SHELL32_62(DWORD x,
949 DWORD y,
950 DWORD z,
951 DWORD a)
952{
953 dprintf(("SHELL32: .62 (%08xh, %08xh, %08xh, %08xh) not implemented.\n",
954 x,
955 y,
956 z,
957 a));
958
959 return 0xffffffff;
960}
961
962
963/*************************************************************************
964 * SHELL32_63 [SHELL32.63]
965 */
966DWORD WIN32API SHELL32_63(HWND howner,
967 LPSTR targetbuf,
968 DWORD len,
969 DWORD x,
970 LPCSTR suffix,
971 LPCSTR y,
972 LPCSTR cmd)
973{
974 dprintf (("SHELL32: .63 (%08xh, %08x, %08xh, %08xh, %08xh, %08xh, %s) not implemented.\n",
975 howner,
976 targetbuf,
977 len,
978 x,
979 suffix,
980 y,
981 cmd));
982
983 /* puts up a Open Dialog and requests input into targetbuf */
984 /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
985 lstrcpyA(targetbuf,"x:\\s3.exe");
986 return 1;
987}
988
989
990/*************************************************************************
991 * SHELL32_68 [SHELL32.68]
992 */
993DWORD WIN32API SHELL32_68(DWORD x,
994 DWORD y,
995 DWORD z)
996{
997 dprintf(("SHELL32: .68 (%08xh, %08xh, %08xh) not implemented.\n",
998 x,
999 y,
1000 z));
1001
1002 return 0;
1003}
1004
1005
1006/*************************************************************************
1007 * SHELL32_71 [SHELL32.71]
1008 * returns internal shell values in the passed pointers
1009 */
1010BOOL WIN32API SHELL32_71(LPDWORD x,
1011 LPDWORD y)
1012{
1013 dprintf(("SHELL32: .71 (%08xh, %08xh) not implemented.\n",
1014 x,
1015 y));
1016
1017 return TRUE;
1018}
1019
1020
1021/*************************************************************************
1022 * SHELL32_72 [SHELL32.72]
1023 * dunno. something with icons
1024 */
1025void WIN32API SHELL32_72(LPSTR x,
1026 DWORD y,
1027 DWORD z)
1028{
1029 dprintf (("SHELL32: .27 (%08xh, %08xh, %08xh) not implemented.\n",
1030 x,
1031 y,
1032 z));
1033}
1034
1035
1036/*************************************************************************
1037 * SHELL32_89 [SHELL32.89]
1038 */
1039DWORD WIN32API SHELL32_89(DWORD x1,
1040 DWORD x2,
1041 DWORD x3)
1042{
1043 dprintf(("SHELL32: .89 (%08xh, %08xh, %08xh) not implemented.\n",
1044 x1,
1045 x2,
1046 x3));
1047
1048 return 0;
1049}
1050
1051
1052/*************************************************************************
1053 * SHELL32_119 [SHELL32.119]
1054 * unknown
1055 */
1056void WIN32API SHELL32_119(LPVOID x)
1057{
1058 dprintf(("SHELL32: .119 (%08xh) not implemented.\n",
1059 x));
1060}
1061
1062
1063/*************************************************************************
1064 * SHELL32_175 [SHELL32.175]
1065 * unknown
1066 */
1067void WIN32API SHELL32_175(DWORD x1,
1068 DWORD x2,
1069 DWORD x3,
1070 DWORD x4)
1071{
1072 dprintf (("SHELL32: .175 (%08x, %08xh, %08xh, %08xh not implemented.\n",
1073 x1,
1074 x2,
1075 x3,
1076 x4));
1077}
1078
1079
1080/*************************************************************************
1081 * SHELL32_181 [SHELL32.181]
1082 * unknown
1083 */
1084void WIN32API SHELL32_181(DWORD x,
1085 DWORD y)
1086{
1087 dprintf(("SHELL32: .181 (%08xh, %08xh) not implemented.\n",
1088 x,
1089 y));
1090}
1091
1092
1093/*************************************************************************
1094 * SHELL32_75 [SHELL32.75]
1095 * unknown
1096 */
1097BOOL WIN32API SHELL32_75(LPDWORD x,
1098 LPDWORD y)
1099{
1100 dprintf(("SHELL32: .75 (%08xh, %08xh) not implemented.\n",
1101 x,
1102 y));
1103
1104 return TRUE;
1105}
1106
1107
1108/*************************************************************************
1109 * SHELL32_77 [SHELL32.77]
1110 */
1111DWORD WIN32API SHELL32_77(DWORD x,
1112 DWORD y,
1113 DWORD z)
1114{
1115 dprintf(("SHELL32: .77 (%08xh, %08xh, %08xh) not implemented.\n",
1116 x,
1117 y,
1118 z));
1119
1120 return 0;
1121}
1122
1123
1124/*************************************************************************
1125 * SHELL32_79 [SHELL32.79]
1126 * create_directory_and_notify(...)
1127 */
1128DWORD WIN32API SHELL32_79(LPCSTR dir,
1129 LPVOID xvoid)
1130{
1131 dprintf(("SHELL32: .79 (%s, %08xh)\n",
1132 dir,
1133 xvoid));
1134
1135 if (!CreateDirectoryA(dir,
1136 (PSECURITY_ATTRIBUTES)xvoid))
1137 return FALSE;
1138
1139 /* @@@PH: SHChangeNotify(8,1,dir,0); */
1140 return TRUE;
1141}
1142
1143
1144/*************************************************************************
1145 * SHELL32_183 [SHELL32.183]
1146 * Format and output errormessage.
1147 */
1148//void __cdecl SHELL32_183(HMODULE hmod,
1149// CDECL ? really ?
1150void WIN32API SHELL32_183(HMODULE hmod,
1151 HWND hwnd,
1152 DWORD id,
1153 DWORD x,
1154 DWORD type,
1155 LPVOID arglist)
1156{
1157 char buf[100],
1158 buf2[100],
1159 *buf3;
1160 LPVOID args = &arglist;
1161
1162 dprintf(("SHELL32: .183 (%08xh, %08xh, %08xh, %08xh, %08xh, %08xh) not implemented.\n",
1163 hmod,
1164 hwnd,
1165 id,
1166 x,
1167 type,
1168 arglist));
1169
1170 if (!LoadStringA(hmod,
1171 x,
1172 buf,
1173 100))
1174 strcpy(buf,
1175 "Desktop");
1176
1177 LoadStringA(hmod,
1178 id,
1179 buf2,
1180 100);
1181
1182 /* FIXME: the varargs handling doesn't. */
1183 FormatMessageA(0x500,
1184 buf2,
1185 0,
1186 0,
1187 (LPSTR)&buf3,
1188 256,
1189 (LPDWORD)&args);
1190
1191 MessageBoxA(hwnd,
1192 buf3,
1193 buf,
1194 id|0x10000);
1195}
1196
1197
1198/*************************************************************************
1199 * SHELL32_100 [SHELL32.100]
1200 * walks through policy table, queries <app> key, <type> value, returns
1201 * queried (DWORD) value.
1202 * {0x00001,Explorer,NoRun}
1203 * {0x00002,Explorer,NoClose}
1204 * {0x00004,Explorer,NoSaveSettings}
1205 * {0x00008,Explorer,NoFileMenu}
1206 * {0x00010,Explorer,NoSetFolders}
1207 * {0x00020,Explorer,NoSetTaskbar}
1208 * {0x00040,Explorer,NoDesktop}
1209 * {0x00080,Explorer,NoFind}
1210 * {0x00100,Explorer,NoDrives}
1211 * {0x00200,Explorer,NoDriveAutoRun}
1212 * {0x00400,Explorer,NoDriveTypeAutoRun}
1213 * {0x00800,Explorer,NoNetHood}
1214 * {0x01000,Explorer,NoStartBanner}
1215 * {0x02000,Explorer,RestrictRun}
1216 * {0x04000,Explorer,NoPrinterTabs}
1217 * {0x08000,Explorer,NoDeletePrinter}
1218 * {0x10000,Explorer,NoAddPrinter}
1219 * {0x20000,Explorer,NoStartMenuSubFolders}
1220 * {0x40000,Explorer,MyDocsOnNet}
1221 * {0x80000,WinOldApp,NoRealMode}
1222 */
1223DWORD WIN32API SHELL32_100(DWORD pol)
1224{
1225 HKEY xhkey;
1226
1227 dprintf (("SHELL32: .100 (%08xh) not implemented.\n",
1228 pol));
1229
1230 if (RegOpenKeyA((HKEY)HKEY_CURRENT_USER,
1231 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies",
1232 &xhkey))
1233 return 0;
1234
1235 /* FIXME: do nothing for now, just return 0 (== "allowed") */
1236 RegCloseKey(xhkey);
1237
1238 return 0;
1239}
1240
1241
1242/*************************************************************************
1243 * SHELL32_152 [SHELL32.152]
1244 * itemlist_length
1245 */
1246DWORD WIN32API SHELL32_152(LPITEMIDLIST iil)
1247{
1248 LPSHITEMID si;
1249 DWORD len;
1250
1251 dprintf(("SHELL32: .152 (%08xh)\n",
1252 iil));
1253
1254
1255 si = &(iil->mkid);
1256 len = 2;
1257
1258 while (si->cb)
1259 {
1260 len += si->cb;
1261 si = (LPSHITEMID)(((char*)si)+si->cb);
1262 }
1263
1264 return len;
1265}
1266
1267
1268/*************************************************************************
1269 * SHELL32_158 [SHELL32.158]
1270 */
1271LPSTR WIN32API SHELL32_158(LPSTR path,
1272 DWORD y,
1273 DWORD z)
1274{
1275 dprintf(("SHELL32: .158 (%s, %08xh, %08xh)\n",
1276 path,
1277 y,
1278 z));
1279
1280 path = SHELL32_31(path);
1281
1282 return *path ? (path+1) : path;
1283}
1284
1285
1286/*************************************************************************
1287 * SHELL32_165 [SHELL32.165]
1288 * create_path_and_notify(...)
1289 */
1290DWORD WIN32API SHELL32_165(DWORD x,
1291 LPCSTR path)
1292{
1293 dprintf (("SHELL32 .165 (%08x, %08xh) not implemented.\n",
1294 x,
1295 path));
1296
1297 if (SHELL32_79(path,
1298 (LPVOID)x))
1299 return 0;
1300
1301 return 0;
1302}
1303
1304
1305/*************************************************************************
1306 * SHELL32_195 [SHELL32.195]
1307 * free_ptr() - frees memory using IMalloc
1308 */
1309DWORD WIN32API SHELL32_195(LPVOID x)
1310{
1311 dprintf (("SHELL32: .195 (%08xh) (LocalFree)\n",
1312 x));
1313
1314 return (DWORD)LocalFree((HLOCAL)x);
1315}
1316
1317
1318/*************************************************************************
1319 * SHELL32_196 [SHELL32.196]
1320 * void *task_alloc(DWORD len), uses SHMalloc allocator
1321 */
1322LPVOID WIN32API SHELL32_196(DWORD len)
1323{
1324 dprintf(("SHELL32: .196 (%08xh) (LocalAlloc)\n",
1325 len));
1326
1327 return (LPVOID)LocalAlloc(len,
1328 LMEM_ZEROINIT); /* FIXME */
1329}
1330
1331
1332/*************************************************************************
1333 * SHELL32_18 [SHELL32.18]
1334 * copy_itemidlist()
1335 */
1336LPITEMIDLIST WIN32API SHELL32_18(LPITEMIDLIST iil)
1337{
1338 DWORD len;
1339 LPITEMIDLIST newiil;
1340
1341 dprintf(("SHELL32: .18 (%08xh)\n",
1342 iil));
1343
1344
1345 len = SHELL32_152(iil);
1346 newiil = (LPITEMIDLIST)SHELL32_196(len);
1347 memcpy(newiil,
1348 iil,
1349 len);
1350
1351 return newiil;
1352}
1353
1354
1355/*************************************************************************
1356 * SHELL32_25 [SHELL32.25]
1357 * merge_itemidlist()
1358 */
1359LPITEMIDLIST WIN32API SHELL32_25(LPITEMIDLIST iil1,
1360 LPITEMIDLIST iil2)
1361{
1362 DWORD len1,len2;
1363 LPITEMIDLIST newiil;
1364
1365 dprintf(("SHELL32: .25 (%08xh, %08xh)\n",
1366 iil1,
1367 iil2));
1368
1369
1370 len1 = SHELL32_152(iil1)-2;
1371 len2 = SHELL32_152(iil2);
1372 newiil = (LPITEMIDLIST)SHELL32_196(len1+len2);
1373
1374 memcpy(newiil,
1375 iil1,
1376 len1);
1377
1378 memcpy(((char*)newiil)+len1,
1379 iil2,
1380 len2);
1381
1382 return newiil;
1383}
1384
1385
1386/*************************************************************************
1387 * SHELL32_155 [SHELL32.155]
1388 * free_check_ptr - frees memory (if not NULL) allocated by SHMalloc allocator
1389 */
1390DWORD WIN32API SHELL32_155(LPVOID x)
1391{
1392 dprintf(("SHELL32: .155 (%08xh)\n",
1393 x));
1394
1395 if (!x)
1396 return 0;
1397
1398 return SHELL32_195(x);
1399}
1400
1401
1402/*************************************************************************
1403 * SHELL32_85 [SHELL32.85]
1404 * unknown
1405 */
1406DWORD WIN32API SHELL32_85(DWORD x1,
1407 DWORD x2,
1408 DWORD x3,
1409 DWORD x4)
1410{
1411 dprintf(("SHELL32: .85 (%08x, %08xh, %08xh, %08xh) not implemented.\n",
1412 x1,
1413 x2,
1414 x3,
1415 x4));
1416
1417 return 0;
1418}
1419
1420
1421/*****************************************************************************
1422 * Name : .4
1423 * Purpose :
1424 * Parameters:
1425 * Variables :
1426 * Result :
1427 * Remark : unknown
1428 * Status : UNTESTED UNKNOWN STUB
1429 *
1430 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1431 *****************************************************************************/
1432
1433DWORD WIN32API SHELL32_4(DWORD x1)
1434{
1435 dprintf(("SHELL32: .4 (%08xh) not implemented.\n",
1436 x1));
1437
1438 return (0);
1439}
1440
1441
1442/*****************************************************************************
1443 * Name : .59
1444 * Purpose :
1445 * Parameters:
1446 * Variables :
1447 * Result :
1448 * Remark : unknown
1449 * Status : UNTESTED UNKNOWN STUB
1450 *
1451 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1452 *****************************************************************************/
1453
1454DWORD WIN32API SHELL32_59(void)
1455{
1456 dprintf(("SHELL32: .59 () not implemented.\n"));
1457
1458 return (0);
1459}
1460
1461
1462/*****************************************************************************
1463 * Name : .162
1464 * Purpose :
1465 * Parameters:
1466 * Variables :
1467 * Result :
1468 * Remark : unknown
1469 * Status : UNTESTED UNKNOWN STUB
1470 *
1471 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1472 *****************************************************************************/
1473
1474DWORD WIN32API SHELL32_162(DWORD x1)
1475{
1476 dprintf(("SHELL32: .162 (%08xh) not implemented.\n",
1477 x1));
1478
1479 return (0);
1480}
1481
1482
1483/*****************************************************************************
1484 * Name : .145
1485 * Purpose :
1486 * Parameters:
1487 * Variables :
1488 * Result :
1489 * Remark : unknown
1490 * Status : UNTESTED UNKNOWN STUB
1491 *
1492 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1493 *****************************************************************************/
1494
1495DWORD WIN32API SHELL32_145(DWORD x1,
1496 DWORD x2)
1497{
1498 dprintf(("SHELL32: .145 (%08xh, %08xh) not implemented.\n",
1499 x1,
1500 x2));
1501
1502 return (0);
1503}
1504
1505
1506/*****************************************************************************
1507 * Name : .43
1508 * Purpose :
1509 * Parameters:
1510 * Variables :
1511 * Result :
1512 * Remark : unknown
1513 * Status : UNTESTED UNKNOWN STUB
1514 *
1515 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1516 *****************************************************************************/
1517
1518DWORD WIN32API SHELL32_43(DWORD x1)
1519{
1520 dprintf(("SHELL32: .43 (%08xh) not implemented.\n",
1521 x1));
1522
1523 return (0);
1524}
1525
1526
1527/*****************************************************************************
1528 * Name : .51
1529 * Purpose :
1530 * Parameters:
1531 * Variables :
1532 * Result :
1533 * Remark : unknown
1534 * Status : UNTESTED UNKNOWN STUB
1535 *
1536 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1537 *****************************************************************************/
1538
1539DWORD WIN32API SHELL32_51(DWORD x1,
1540 DWORD x2,
1541 DWORD x3)
1542{
1543 dprintf(("SHELL32: .51 (%08xh, %08xh, %08xh) not implemented.\n",
1544 x1,
1545 x2,
1546 x3));
1547
1548 return (0);
1549}
1550
1551
1552/*****************************************************************************
1553 * Name : .55
1554 * Purpose :
1555 * Parameters:
1556 * Variables :
1557 * Result :
1558 * Remark : unknown
1559 * Status : UNTESTED UNKNOWN STUB
1560 *
1561 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1562 *****************************************************************************/
1563
1564DWORD WIN32API SHELL32_55(DWORD x1)
1565{
1566 dprintf(("SHELL32: .55 (%08xh) not implemented.\n",
1567 x1));
1568
1569 return (0);
1570}
1571
1572
1573/*****************************************************************************
1574 * Name : .102
1575 * Purpose :
1576 * Parameters:
1577 * Variables :
1578 * Result :
1579 * Remark : unknown
1580 * Status : UNTESTED UNKNOWN STUB
1581 *
1582 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1583 *****************************************************************************/
1584
1585DWORD WIN32API SHELL32_102(DWORD x1,
1586 DWORD x2,
1587 DWORD x3,
1588 DWORD x4,
1589 DWORD x5)
1590{
1591 dprintf(("SHELL32: .102 (%08xh, %08xh, %08xh, %08xh, %08xh) not implemented.\n",
1592 x1,
1593 x2,
1594 x3,
1595 x4,
1596 x5));
1597
1598 return (0);
1599}
1600
1601
1602/*****************************************************************************
1603 * Name : BOOL ShellExecuteEx
1604 * Purpose :
1605 * Parameters:
1606 * Variables :
1607 * Result :
1608 * Remark :
1609 * Status : UNTESTED STUB
1610 *
1611 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1612 *****************************************************************************/
1613
1614BOOL WIN32API ShellExecuteEx(LPSHELLEXECUTEINFOA lpExecInfo)
1615{
1616 dprintf(("SHELL32: ShellExecuteEx (%08xh) not implemented.\n",
1617 lpExecInfo));
1618
1619 return (0);
1620}
1621
1622
1623
1624/*****************************************************************************
1625 * Name : BOOL ShellExecuteExA
1626 * Purpose :
1627 * Parameters:
1628 * Variables :
1629 * Result :
1630 * Remark :
1631 * Status : UNTESTED STUB
1632 *
1633 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1634 *****************************************************************************/
1635
1636BOOL WIN32API ShellExecuteExA(LPSHELLEXECUTEINFOA lpExecInfo)
1637{
1638 dprintf(("SHELL32: ShellExecuteExA (%08xh) not implemented.\n",
1639 lpExecInfo));
1640
1641 return (0);
1642}
1643
1644
1645/*****************************************************************************
1646 * Name : BOOL ShellExecuteExW
1647 * Purpose :
1648 * Parameters:
1649 * Variables :
1650 * Result :
1651 * Remark :
1652 * Status : UNTESTED STUB
1653 *
1654 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1655 *****************************************************************************/
1656
1657BOOL WIN32API ShellExecuteExW(LPSHELLEXECUTEINFOW lpExecInfo)
1658{
1659 dprintf(("SHELL32: ShellExecuteExW (%08xh) not implemented.\n",
1660 lpExecInfo));
1661
1662 return (0);
1663}
1664
1665
1666
1667
1668
1669
1670#if 0
1671typedef DWORD (* WIN32API GetClassPtr)(REFCLSID,REFIID,LPVOID);
1672
1673static GetClassPtr SH_find_moduleproc(LPSTR dllname,
1674 HMODULE *xhmod,
1675 LPSTR name)
1676{
1677 HMODULE hmod;
1678 FARPROC dllunload,
1679 nameproc;
1680
1681 if (xhmod)
1682 *xhmod = 0;
1683
1684 if (!lstrcmpi32A(SHELL32_34(dllname),
1685 "shell32.dll"))
1686 return (GetClassPtr)SHELL32_DllGetClassObject;
1687
1688 hmod = LoadLibraryEx32A(dllname,
1689 0,
1690 LOAD_WITH_ALTERED_SEARCH_PATH);
1691 if (!hmod)
1692 return NULL;
1693
1694 dllunload = GetProcAddress32(hmod,
1695 "DllCanUnloadNow");
1696 if (!dllunload)
1697 if (xhmod)
1698 *xhmod = hmod;
1699
1700 nameproc = GetProcAddress32(hmod,
1701 name);
1702 if (!nameproc)
1703 {
1704 FreeLibrary32(hmod);
1705 return NULL;
1706 }
1707
1708 /* register unloadable dll with unloadproc ... */
1709 return (GetClassPtr)nameproc;
1710}
1711
1712
1713static DWORD SH_get_instance(REFCLSID clsid,
1714 LPSTR dllname,
1715 LPVOID unknownouter,
1716 REFIID refiid,
1717 LPVOID inst)
1718{
1719 GetClassPtr dllgetclassob;
1720 DWORD hres;
1721 LPCLASSFACTORY classfac;
1722
1723 dllgetclassob = SH_find_moduleproc(dllname,
1724 NULL,
1725 "DllGetClassObject");
1726 if (!dllgetclassob)
1727 return 0x80070000|GetLastError();
1728
1729/* FIXME */
1730/*
1731 hres = (*dllgetclassob)(clsid,(REFIID)&IID_IClassFactory,inst);
1732 if (hres<0)
1733 return hres;
1734
1735*/
1736 hres = (*dllgetclassob)(clsid,
1737 (REFIID)&IID_IClassFactory,
1738 &classfac);
1739 if (hres<0)
1740 return hres;
1741
1742 classfac->lpvtbl->fnCreateInstance(classfac,
1743 unknownouter,
1744 refiid,
1745 inst);
1746 classfac->lpvtbl->fnRelease(classfac);
1747
1748 return 0;
1749}
1750
1751
1752/*************************************************************************
1753 * SHELL32_102 [SHELL32.102]
1754 * unknown
1755 */
1756LRESULT WIN32API SHELL32_102(LPSTR aclsid,
1757 CLSID *clsid,
1758 LPUNKNOWN unknownouter,
1759 REFIID refiid,
1760 LPVOID inst)
1761{
1762 char buffer[256],
1763 xclsid[48],
1764 xiid[48],
1765 path[260],
1766 tmodel[100];
1767 HKEY inprockey;
1768 DWORD pathlen,
1769 type,
1770 tmodellen;
1771 DWORD hres;
1772
1773
1774 WINE_StringFromCLSID(refiid,
1775 xiid);
1776
1777 if (clsid)
1778 WINE_StringFromCLSID(clsid,
1779 xclsid);
1780 else
1781 {
1782 if (!aclsid)
1783 return 0x80040154;
1784
1785 strcpy(xclsid,
1786 aclsid);
1787 }
1788
1789 dprintf(("SHELL32: .102 (%s. %08xh, %08xh, %08x, %08xh)\n",
1790 aclsid,
1791 clsid,
1792 unknownouter,
1793 refiid,
1794 inst));
1795
1796
1797 sprintf(buffer,
1798 "CLSID\\%s\\InProcServer32",
1799 xclsid);
1800
1801 if (RegOpenKeyEx32A(HKEY_CLASSES_ROOT,
1802 buffer,
1803 0,
1804 0x02000000,
1805 &inprockey))
1806 return SH_get_instance(clsid,
1807 "shell32.dll",
1808 unknownouter,
1809 refiid,
1810 inst);
1811
1812 pathlen=sizeof(path);
1813 if (RegQueryValue32A(inprockey,
1814 NULL,
1815 path,
1816 &pathlen))
1817 {
1818 RegCloseKey(inprockey);
1819 return SH_get_instance(clsid,
1820 "shell32.dll",
1821 unknownouter,
1822 refiid,
1823 inst);
1824 }
1825
1826 dprintf (("SHELL32: .102 Server dll is %s\n",
1827 path));
1828
1829 tmodellen=sizeof(tmodel);
1830 type=REG_SZ;
1831
1832 if (RegQueryValueEx32A(inprockey,
1833 "ThreadingModel",
1834 NULL,
1835 &type,
1836 tmodel,
1837 &tmodellen))
1838 {
1839 RegCloseKey(inprockey);
1840 return SH_get_instance(clsid,
1841 "shell32.dll",
1842 unknownouter,
1843 refiid,
1844 inst);
1845 }
1846
1847
1848 dprintf (("SHELL32: .102 Threading model is %s\n",
1849 tmodel));
1850
1851 hres=SH_get_instance(clsid,
1852 path,
1853 unknownouter,
1854 refiid,
1855 inst);
1856 if (hres<0)
1857 hres=SH_get_instance(clsid,
1858 "shell32.dll",
1859 unknownouter,
1860 refiid,
1861 inst);
1862
1863 RegCloseKey(inprockey);
1864
1865 return hres;
1866}
1867
1868
1869/*************************************************************************
1870 * SHELL_FindExecutable
1871 * Utility for code sharing between FindExecutable and ShellExecute
1872 */
1873static HINSTANCE32 SHELL_FindExecutable( LPCSTR lpFile,
1874 LPCSTR lpOperation,
1875 LPSTR lpResult)
1876{
1877 char *extension = NULL; /* pointer to file extension */
1878 char tmpext[5]; /* local copy to mung as we please */
1879 char filetype[256]; /* registry name for this filetype */
1880 LONG filetypelen=256; /* length of above */
1881 char command[256]; /* command from registry */
1882 LONG commandlen=256; /* This is the most DOS can handle :) */
1883 char buffer[256]; /* Used to GetProfileString */
1884 HINSTANCE32 retval=31; /* default - 'No association was found' */
1885 char *tok; /* token pointer */
1886 int i; /* random counter */
1887 char xlpFile[256]; /* result of SearchPath */
1888
1889 TRACE(exec, "%s\n",
1890 (lpFile != NULL?lpFile:"-") );
1891 lpResult[0]='\0'; /* Start off with an empty return string */
1892
1893 /* trap NULL parameters on entry */
1894 if (( lpFile == NULL ) || ( lpResult == NULL ) || ( lpOperation == NULL ))
1895 {
1896 /* FIXME - should throw a warning, perhaps! */
1897 return 2; /* File not found. Close enough, I guess. */
1898 }
1899
1900 if (SearchPath32A( NULL, lpFile,".exe",sizeof(xlpFile),xlpFile,NULL))
1901 lpFile = xlpFile;
1902
1903 /* First thing we need is the file's extension */
1904 extension = strrchr( xlpFile, '.' ); /* Assume last "." is the one; */
1905 /* File->Run in progman uses */
1906 /* .\FILE.EXE :( */
1907 if ((extension == NULL) || (extension == &xlpFile[strlen(xlpFile)]))
1908 {
1909 return 31; /* no association */
1910 }
1911
1912 /* Make local copy & lowercase it for reg & 'programs=' lookup */
1913 lstrcpyn32A( tmpext, extension, 5 );
1914 CharLower32A( tmpext );
1915 TRACE(exec, "%s file\n", tmpext);
1916
1917 /* Three places to check: */
1918 /* 1. win.ini, [windows], programs (NB no leading '.') */
1919 /* 2. Registry, HKEY_CLASS_ROOT\<filetype>\shell\open\command */
1920 /* 3. win.ini, [extensions], extension (NB no leading '.' */
1921 /* All I know of the order is that registry is checked before */
1922 /* extensions; however, it'd make sense to check the programs */
1923 /* section first, so that's what happens here. */
1924
1925 /* See if it's a program - if GetProfileString fails, we skip this
1926 * section. Actually, if GetProfileString fails, we've probably
1927 * got a lot more to worry about than running a program... */
1928 if ( GetProfileString32A("windows", "programs", "exe pif bat com",
1929 buffer, sizeof(buffer)) > 0 )
1930 {
1931 for (i=0;i<strlen(buffer); i++) buffer[i]=tolower(buffer[i]);
1932
1933 tok = strtok(buffer, " \t"); /* ? */
1934 while( tok!= NULL)
1935 {
1936 if (strcmp(tok, &tmpext[1])==0) /* have to skip the leading "." */
1937 {
1938 strcpy(lpResult, xlpFile);
1939 /* Need to perhaps check that the file has a path
1940 * attached */
1941 TRACE(exec, "found %s\n",
1942 lpResult);
1943 return 33;
1944
1945 /* Greater than 32 to indicate success FIXME According to the
1946 * docs, I should be returning a handle for the
1947 * executable. Does this mean I'm supposed to open the
1948 * executable file or something? More RTFM, I guess... */
1949 }
1950 tok=strtok(NULL, " \t");
1951 }
1952 }
1953
1954 /* Check registry */
1955 if (RegQueryValue16( (HKEY)HKEY_CLASSES_ROOT, tmpext, filetype,
1956 &filetypelen ) == SHELL_ERROR_SUCCESS )
1957 {
1958 filetype[filetypelen]='\0';
1959 TRACE(exec, "File type: %s\n",
1960 filetype);
1961
1962 /* Looking for ...buffer\shell\lpOperation\command */
1963 strcat( filetype, "\\shell\\" );
1964 strcat( filetype, lpOperation );
1965 strcat( filetype, "\\command" );
1966
1967 if (RegQueryValue16( (HKEY)HKEY_CLASSES_ROOT, filetype, command,
1968 &commandlen ) == SHELL_ERROR_SUCCESS )
1969 {
1970 /* Is there a replace() function anywhere? */
1971 command[commandlen]='\0';
1972 strcpy( lpResult, command );
1973 tok=strstr( lpResult, "%1" );
1974 if (tok != NULL)
1975 {
1976 tok[0]='\0'; /* truncate string at the percent */
1977 strcat( lpResult, xlpFile ); /* what if no dir in xlpFile? */
1978 tok=strstr( command, "%1" );
1979 if ((tok!=NULL) && (strlen(tok)>2))
1980 {
1981 strcat( lpResult, &tok[2] );
1982 }
1983 }
1984 retval=33; /* FIXME see above */
1985 }
1986 }
1987 else /* Check win.ini */
1988 {
1989 /* Toss the leading dot */
1990 extension++;
1991 if ( GetProfileString32A( "extensions", extension, "", command,
1992 sizeof(command)) > 0)
1993 {
1994 if (strlen(command)!=0)
1995 {
1996 strcpy( lpResult, command );
1997 tok=strstr( lpResult, "^" ); /* should be ^.extension? */
1998 if (tok != NULL)
1999 {
2000 tok[0]='\0';
2001 strcat( lpResult, xlpFile ); /* what if no dir in xlpFile? */
2002 tok=strstr( command, "^" ); /* see above */
2003 if ((tok != NULL) && (strlen(tok)>5))
2004 {
2005 strcat( lpResult, &tok[5]);
2006 }
2007 }
2008 retval=33; /* FIXME - see above */
2009 }
2010 }
2011 }
2012
2013 TRACE(exec, "returning %s\n", lpResult);
2014 return retval;
2015}
2016
2017/*************************************************************************
2018 * ShellExecute16 [SHELL.20]
2019 */
2020HINSTANCE16 WIN32API ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
2021 LPCSTR lpFile, LPCSTR lpParameters,
2022 LPCSTR lpDirectory, INT16 iShowCmd )
2023{
2024 HINSTANCE16 retval=31;
2025 char old_dir[1024];
2026 char cmd[256];
2027
2028 TRACE(exec, "(%04x,'%s','%s','%s','%s',%x)\n",
2029 hWnd, lpOperation ? lpOperation:"<null>", lpFile ? lpFile:"<null>",
2030 lpParameters ? lpParameters : "<null>",
2031 lpDirectory ? lpDirectory : "<null>", iShowCmd);
2032
2033 if (lpFile==NULL) return 0; /* should not happen */
2034 if (lpOperation==NULL) /* default is open */
2035 lpOperation="open";
2036
2037 if (lpDirectory)
2038 {
2039 GetCurrentDirectory32A( sizeof(old_dir), old_dir );
2040 SetCurrentDirectory32A( lpDirectory );
2041 }
2042
2043 retval = SHELL_FindExecutable( lpFile, lpOperation, cmd );
2044
2045 if (retval > 32) /* Found */
2046 {
2047 if (lpParameters)
2048 {
2049 strcat(cmd," ");
2050 strcat(cmd,lpParameters);
2051 }
2052
2053 TRACE(exec,"starting %s\n",cmd);
2054 retval = WinExec32( cmd, iShowCmd );
2055 }
2056 if (lpDirectory) SetCurrentDirectory32A( old_dir );
2057 return retval;
2058}
2059
2060
2061/*************************************************************************
2062 * ShellExecute32A (SHELL32.245)
2063 */
2064HINSTANCE32 WIN32API ShellExecute32A( HWND hWnd, LPCSTR lpOperation,
2065 LPCSTR lpFile, LPCSTR lpParameters,
2066 LPCSTR lpDirectory, INT32 iShowCmd )
2067{
2068 return ShellExecute16( hWnd, lpOperation, lpFile, lpParameters,
2069 lpDirectory, iShowCmd );
2070}
2071
2072
2073/*************************************************************************
2074 * FindExecutable32A (SHELL32.184)
2075 */
2076HINSTANCE32 WIN32API FindExecutable32A( LPCSTR lpFile, LPCSTR lpDirectory,
2077 LPSTR lpResult )
2078{
2079 HINSTANCE32 retval=31; /* default - 'No association was found' */
2080 char old_dir[1024];
2081
2082 TRACE(exec, "File %s, Dir %s\n",
2083 (lpFile != NULL?lpFile:"-"),
2084 (lpDirectory != NULL?lpDirectory:"-"));
2085
2086 lpResult[0]='\0'; /* Start off with an empty return string */
2087
2088 /* trap NULL parameters on entry */
2089 if (( lpFile == NULL ) || ( lpResult == NULL ))
2090 {
2091 /* FIXME - should throw a warning, perhaps! */
2092 return 2; /* File not found. Close enough, I guess. */
2093 }
2094
2095 if (lpDirectory)
2096 {
2097 GetCurrentDirectory32A( sizeof(old_dir), old_dir );
2098 SetCurrentDirectory32A( lpDirectory );
2099 }
2100
2101 retval = SHELL_FindExecutable( lpFile, "open", lpResult );
2102
2103 TRACE(exec, "returning %s\n", lpResult);
2104 if (lpDirectory) SetCurrentDirectory32A( old_dir );
2105 return retval;
2106}
2107
2108
2109
2110
2111
2112/*************************************************************************
2113 * ExtractIcon32A (SHELL32.133)
2114 */
2115HICON32 WIN32API ExtractIcon32A( HINSTANCE32 hInstance, LPCSTR lpszExeFileName,
2116 UINT32 nIconIndex )
2117{
2118 HGLOBAL16 handle = InternalExtractIcon(hInstance,lpszExeFileName,nIconIndex, 1);
2119
2120 if( handle )
2121 {
2122 HICON16* ptr = (HICON16*)GlobalLock16(handle);
2123 HICON16 hIcon = *ptr;
2124
2125 GlobalFree16(handle);
2126 return hIcon;
2127 }
2128 return 0;
2129}
2130
2131/*************************************************************************
2132 * ExtractIcon32W (SHELL32.180)
2133 */
2134HICON32 WIN32API ExtractIcon32W( HINSTANCE32 hInstance, LPCWSTR lpszExeFileName,
2135 UINT32 nIconIndex )
2136{
2137 LPSTR exefn = HEAP_strdupWtoA(GetProcessHeap(),0,lpszExeFileName);
2138 HICON32 ret = ExtractIcon32A(hInstance,exefn,nIconIndex);
2139
2140 HeapFree(GetProcessHeap(),0,exefn);
2141 return ret;
2142}
2143
2144
2145/*************************************************************************
2146 * ExtractAssociatedIcon [SHELL.36]
2147 *
2148 * Return icon for given file (either from file itself or from associated
2149 * executable) and patch parameters if needed.
2150 */
2151HICON32 WIN32API ExtractAssociatedIcon32A(HINSTANCE32 hInst,LPSTR lpIconPath,
2152 LPWORD lpiIcon)
2153{
2154 return ExtractAssociatedIcon16(hInst,lpIconPath,lpiIcon);
2155}
2156
2157HICON16 WIN32API ExtractAssociatedIcon16(HINSTANCE16 hInst,LPSTR lpIconPath,
2158 LPWORD lpiIcon)
2159{
2160 HICON16 hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon);
2161
2162 if( hIcon < 2 )
2163 {
2164
2165 if( hIcon == 1 ) /* no icons found in given file */
2166 {
2167 char tempPath[0x80];
2168 USHORT uRet = FindExecutable16(lpIconPath,NULL,tempPath);
2169
2170 if( uRet > 32 && tempPath[0] )
2171 {
2172 strcpy(lpIconPath,tempPath);
2173 hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon);
2174
2175 if( hIcon > 2 ) return hIcon;
2176 }
2177 else hIcon = 0;
2178 }
2179
2180 if( hIcon == 1 )
2181 *lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */
2182 else
2183 *lpiIcon = 6; /* generic icon - found nothing */
2184
2185 GetModuleFileName16(hInst, lpIconPath, 0x80);
2186 hIcon = LoadIcon16( hInst, MAKEINTRESOURCE16(*lpiIcon));
2187 }
2188
2189 return hIcon;
2190}
2191
2192/*************************************************************************
2193 * FindEnvironmentString [SHELL.38]
2194 *
2195 * Returns a pointer into the DOS environment... Ugh.
2196 */
2197LPSTR SHELL_FindString(LPSTR lpEnv, LPCSTR entry)
2198{
2199 USHORT l = strlen(entry);
2200 for( ; *lpEnv ; lpEnv+=strlen(lpEnv)+1 )
2201 {
2202 if( lstrncmpi32A(lpEnv, entry, l) ) continue;
2203
2204 if( !*(lpEnv+l) )
2205 return (lpEnv + l); /* empty entry */
2206 else if ( *(lpEnv+l)== '=' )
2207 return (lpEnv + l + 1);
2208 }
2209 return NULL;
2210}
2211
2212SEGPTR WIN32API FindEnvironmentString(LPSTR str)
2213{
2214 SEGPTR spEnv = GetDOSEnvironment();
2215 LPSTR lpEnv = (LPSTR)PTR_SEG_TO_LIN(spEnv);
2216
2217 LPSTR lpString = (spEnv)?SHELL_FindString(lpEnv, str):NULL;
2218
2219 if( lpString ) /* offset should be small enough */
2220 return spEnv + (lpString - lpEnv);
2221
2222 return (SEGPTR)NULL;
2223}
2224
2225/*************************************************************************
2226 * DoEnvironmentSubst [SHELL.37]
2227 *
2228 * Replace %KEYWORD% in the str with the value of variable KEYWORD
2229 * from "DOS" environment.
2230 */
2231DWORD WIN32API DoEnvironmentSubst(LPSTR str,WORD length)
2232{
2233 LPSTR lpEnv = (LPSTR)PTR_SEG_TO_LIN(GetDOSEnvironment());
2234 LPSTR lpBuffer = (LPSTR)HeapAlloc( GetProcessHeap(), 0, length);
2235 LPSTR lpstr = str;
2236 LPSTR lpbstr = lpBuffer;
2237
2238 CharToOem32A(str,str);
2239
2240 TRACE(reg,"accept %s\n", str);
2241
2242 while( *lpstr && lpbstr - lpBuffer < length )
2243 {
2244 LPSTR lpend = lpstr;
2245
2246 if( *lpstr == '%' )
2247 {
2248 do { lpend++; } while( *lpend && *lpend != '%' );
2249 if( *lpend == '%' && lpend - lpstr > 1 ) /* found key */
2250 {
2251 LPSTR lpKey;
2252 *lpend = '\0';
2253 lpKey = SHELL_FindString(lpEnv, lpstr+1);
2254 if( lpKey ) /* found key value */
2255 {
2256 int l = strlen(lpKey);
2257
2258 if( l > length - (lpbstr - lpBuffer) - 1 )
2259 {
2260 WARN(reg,"Env subst aborted - string too short\n");
2261 *lpend = '%';
2262 break;
2263 }
2264 strcpy(lpbstr, lpKey);
2265 lpbstr += l;
2266 }
2267 else break;
2268 *lpend = '%';
2269 lpstr = lpend + 1;
2270 }
2271 else break; /* back off and whine */
2272
2273 continue;
2274 }
2275
2276 *lpbstr++ = *lpstr++;
2277 }
2278
2279 *lpbstr = '\0';
2280 if( lpstr - str == strlen(str) )
2281 {
2282 strncpy(str, lpBuffer, length);
2283 length = 1;
2284 }
2285 else
2286 length = 0;
2287
2288 TRACE(reg," return %s\n", str);
2289
2290 OemToChar32A(str,str);
2291 HeapFree( GetProcessHeap(), 0, lpBuffer);
2292
2293 /* Return str length in the LOWORD
2294 * and 1 in HIWORD if subst was successful.
2295 */
2296 return (DWORD)MAKELONG(strlen(str), length);
2297}
2298
2299/*************************************************************************
2300 * ShellHookProc [SHELL.103]
2301 * System-wide WH_SHELL hook.
2302 */
2303LRESULT WIN32API ShellHookProc(INT16 code, WPARAM16 wParam, LPARAM lParam)
2304{
2305 TRACE(reg,"%i, %04x, %08x\n", code, wParam,
2306 (unsigned)lParam );
2307 if( SHELL_hHook && SHELL_hWnd )
2308 {
2309 USHORT uMsg = 0;
2310 switch( code )
2311 {
2312 case HSHELL_WINDOWCREATED: uMsg = uMsgWndCreated; break;
2313 case HSHELL_WINDOWDESTROYED: uMsg = uMsgWndDestroyed; break;
2314 case HSHELL_ACTIVATESHELLWINDOW: uMsg = uMsgShellActivate;
2315 }
2316 PostMessage16( SHELL_hWnd, uMsg, wParam, 0 );
2317 }
2318 return CallNextHookEx16( WH_SHELL, code, wParam, lParam );
2319}
2320
2321/*************************************************************************
2322 * RegisterShellHook [SHELL.102]
2323 */
2324BOOL WIN32API RegisterShellHook(HWND16 hWnd, USHORT uAction)
2325{
2326 TRACE(reg,"%04x [%u]\n", hWnd, uAction );
2327
2328 switch( uAction )
2329 {
2330 case 2: /* register hWnd as a shell window */
2331
2332 if( !SHELL_hHook )
2333 {
2334 HMODULE16 hShell = GetModuleHandle16( "SHELL" );
2335
2336 SHELL_hHook = SetWindowsHookEx16( WH_SHELL, ShellHookProc,
2337 hShell, 0 );
2338 if( SHELL_hHook )
2339 {
2340 uMsgWndCreated = RegisterWindowMessage32A( lpstrMsgWndCreated );
2341 uMsgWndDestroyed = RegisterWindowMessage32A( lpstrMsgWndDestroyed );
2342 uMsgShellActivate = RegisterWindowMessage32A( lpstrMsgShellActivate );
2343 }
2344 else WARN(reg, "unable to install ShellHookProc()!\n");
2345 }
2346
2347 if( SHELL_hHook ) return ((SHELL_hWnd = hWnd) != 0);
2348 break;
2349
2350 default:
2351
2352 WARN(reg, "unknown code %i\n", uAction );
2353
2354 /* just in case */
2355
2356 SHELL_hWnd = 0;
2357 }
2358 return FALSE;
2359}
2360
2361
2362/*************************************************************************
2363 * SHAppBarMessage32 [SHELL32.207]
2364 */
2365UINT32 WIN32API SHAppBarMessage32(DWORD msg, PAPPBARDATA data)
2366{
2367 FIXME(shell,"(0x%08lx,%p): stub\n", msg, data);
2368#if 0
2369 switch (msg) {
2370 case ABM_ACTIVATE:
2371 case ABM_GETAUTOHIDEBAR:
2372 case ABM_GETSTATE:
2373 case ABM_GETTASKBARPOS:
2374 case ABM_NEW:
2375 case ABM_QUERYPOS:
2376 case ABM_REMOVE:
2377 case ABM_SETAUTOHIDEBAR:
2378 case ABM_SETPOS:
2379 case ABM_WINDOWPOSCHANGED:
2380 ;
2381 }
2382#endif
2383 return 0;
2384}
2385
2386
2387/*************************************************************************
2388 * Control_RunDLL [SHELL32.12]
2389 *
2390 * Wild speculation in the following!
2391 *
2392 * http://premium.microsoft.com/msdn/library/techart/msdn193.htm
2393 */
2394
2395void WIN32API Control_RunDLL (HWND hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4)
2396{
2397 TRACE(exec, "(%08x, %p, \"%s\", %08lx)\n",
2398 hwnd, code ? code : "(null)", cmd ? cmd : "(null)", arg4);
2399}
2400
2401/*************************************************************************
2402 */
2403
2404void WIN32API FreeIconList( DWORD dw )
2405{
2406 FIXME(reg, "empty stub\n" );
2407}
2408
2409/*************************************************************************
2410 * SHELL32_DllGetClassObject [SHELL32.14]
2411 *
2412 * http://premium.microsoft.com/msdn/library/sdkdoc/api2_48fo.htm
2413 */
2414DWORD WIN32API SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv)
2415{
2416 char xclsid[50],xiid[50];
2417 HRESULT hres = E_OUTOFMEMORY;
2418
2419
2420 WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
2421 WINE_StringFromCLSID((LPCLSID)iid,xiid);
2422 TRACE(shell,"(%s,%s,%p)\n",xclsid,xiid,ppv);
2423
2424 *ppv = NULL;
2425/* SDK example code looks like this:
2426 *
2427 HRESULT hres = E_OUTOFMEMORY;
2428
2429 *ppv = NULL;
2430 CClassFactory *pClassFactory = new CClassFactory(rclsid);
2431
2432 if (pClassFactory) {
2433 hRes = pClassFactory->QueryInterface(riid,ppv);
2434 pClassFactory->Release();
2435 }
2436 return hRes;
2437 *
2438 * The magic of the whole stuff is still unclear to me, so just hack together
2439 * something.
2440 */
2441
2442 if (!memcmp(rclsid,&CLSID_ShellDesktop,sizeof(CLSID_ShellDesktop))) {
2443 TRACE(shell," requested CLSID_ShellDesktop, creating it.\n");
2444 *ppv = IShellFolder_Constructor();
2445 FIXME(shell,"Initialize this folder to be the shell desktop folder\n");
2446 return 0;
2447 }
2448
2449 FIXME(shell, " -> clsid not found. returning E_OUTOFMEMORY.\n");
2450 return hres;
2451}
2452
2453#endif
2454
2455
2456
2457
2458#if 0
2459
2460WINSHELLAPI HICON APIENTRY DuplicateIcon(HINSTANCE hInst, HICON hIcon);
2461WINSHELLAPI HICON APIENTRY ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon);
2462WINSHELLAPI HICON APIENTRY ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon);
2463WINSHELLAPI UINT APIENTRY SHAppBarMessage(DWORD dwMessage, PAPPBARDATA pData);
2464WINSHELLAPI DWORD APIENTRY DoEnvironmentSubstA(LPSTR szString, UINT cbString);
2465WINSHELLAPI DWORD APIENTRY DoEnvironmentSubstW(LPWSTR szString, UINT cbString);
2466WINSHELLAPI LPSTR APIENTRY FindEnvironmentStringA(LPSTR szEnvVar);
2467WINSHELLAPI LPWSTR APIENTRY FindEnvironmentStringW(LPWSTR szEnvVar);
2468WINSHELLAPI void WINAPI SHFreeNameMappings(HANDLE hNameMappings);
2469WINSHELLAPI void WINAPI WinExecErrorA(HWND hwnd, int error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
2470WINSHELLAPI void WINAPI WinExecErrorW(HWND hwnd, int error, LPCWSTR lpstrFileName, LPCWSTR lpstrTitle);
2471WINSHELLAPI BOOL WINAPI SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName,
2472 BOOL FAR * pfMustCopy, UINT uFlags);
2473WINSHELLAPI BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
2474 BOOL FAR * pfMustCopy, UINT uFlags);
2475
2476#endif
2477
Note: See TracBrowser for help on using the repository browser.