source: trunk/src/shell32/misc.cpp@ 505

Last change on this file since 505 was 505, checked in by phaller, 26 years ago

Add: more stubs for shell32

File size: 38.2 KB
Line 
1/* $Id: misc.cpp,v 1.3 1999-08-16 10:31:27 phaller Exp $ */
2
3/*
4 * Win32 SHELL32 for OS/2
5 * 1998/06/15 Patrick Haller (haller@zebra.fh-weingarten.de)
6 * Copyright 1997 Marcus Meissner
7 * Copyright 1988 Patrick Haller (adapted for win32os2)
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11
12
13/*****************************************************************************
14 * Includes *
15 *****************************************************************************/
16
17#include <os2win.h>
18#include <shellapi.h>
19#include <wchar.h>
20#include <wcstr.h>
21#include <winnls.h>
22#include "shell32.h"
23#include <misc.h>
24#include <string.h>
25#include "winbase.h"
26
27
28/*****************************************************************************
29 * Types & Defines *
30 *****************************************************************************/
31
32
33/*****************************************************************************
34 * Name : LPWSTR* WIN32API CommandLineToArgvW
35 * Purpose :
36 * Parameters:
37 * Variables :
38 * Result :
39 * Remark :
40 * Status : UNTESTED STUB
41 *
42 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
43 *****************************************************************************/
44
45LPWSTR * WIN32API CommandLineToArgvW(LPCWSTR lpCmdLine,
46 int *pNumArgs)
47{
48 LPWSTR *argv, s, t;
49 int i;
50
51 dprintf(("SHELL32: CommandLineToArgvW(%s,%08xh)\n",
52 lpCmdLine,
53 pNumArgs));
54
55 s = (LPWSTR)lpCmdLine;
56 i = 0;
57 while (*s) {
58 /* space */
59 if (*s==0x0020) {
60 i++;
61 s++;
62 while (*s && *s==0x0020)
63 s++;
64 continue;
65 }
66 s++;
67 }
68 argv = (LPWSTR *)LocalAlloc(LPTR, sizeof(LPWSTR)*(i+1));
69 s = t = (LPWSTR)lpCmdLine;
70 i = 0;
71 while(*s) {
72 if (*s==0x0020) {
73 *s=0;
74 argv[i++] = t;
75 *s=0x0020;
76 while (*s && *s==0x0020)
77 s++;
78 if(*s)
79 t=s+1;
80 else t=s;
81 continue;
82 }
83 s++;
84 }
85 if(*t)
86 argv[i++] = t;
87
88 argv[i]=NULL;
89 *pNumArgs = i;
90 return argv;
91}
92
93
94/*****************************************************************************
95 * Name : HICON WIN32API ExtractIconA
96 * Purpose :
97 * Parameters:
98 * Variables :
99 * Result :
100 * Remark :
101 * Status : UNTESTED STUB
102 *
103 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
104 *****************************************************************************/
105
106HICON WIN32API ExtractIconA(HINSTANCE hInst,
107 LPCSTR lpszExeFileName,
108 UINT nIconIndex)
109{
110 dprintf(("SHELL32: ExtractIconA(%08xh,%s,%08xh) not implemented.\n",
111 hInst,
112 lpszExeFileName,
113 nIconIndex));
114
115 return(NULL);
116}
117
118
119/*****************************************************************************
120 * Name : HICON WIN32API ExtractIconW
121 * Purpose :
122 * Parameters:
123 * Variables :
124 * Result :
125 * Remark :
126 * Status : UNTESTED STUB
127 *
128 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
129 *****************************************************************************/
130
131HICON WIN32API ExtractIconW(HINSTANCE hInst,
132 LPCWSTR lpszExeFileName,
133 UINT nIconIndex)
134{
135 HICON hicon = NULL;
136 char *astring = UnicodeToAsciiString((LPWSTR)lpszExeFileName);
137
138 dprintf(("SHELL32: ExtractIconW(%08xh,%s,%08xh) not implemented.\n",
139 hInst,
140 lpszExeFileName,
141 nIconIndex));
142
143
144 FreeAsciiString(astring);
145 return(hicon);
146}
147
148
149/*****************************************************************************
150 * Name : HICON WIN32API ExtractIconExA
151 * Purpose :
152 * Parameters:
153 * Variables :
154 * Result :
155 * Remark :
156 * Status : UNTESTED STUB
157 *
158 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
159 *****************************************************************************/
160
161DWORD WIN32API ExtractIconExA(LPCSTR lpszFile,
162 int nIconIndex,
163 HICON *phiconLarge,
164 HICON *phiconSmall,
165 UINT nIcons)
166{
167 dprintf(("SHELL32: ExtractIconExA(%s,%08xh,%08xh,%08xh,%u) not implemented.\n",
168 lpszFile,
169 nIconIndex,
170 phiconLarge,
171 phiconSmall,
172 nIcons));
173
174 return (0);
175}
176
177
178/*****************************************************************************
179 * Name : HICON WIN32API ExtractIconExW
180 * Purpose :
181 * Parameters:
182 * Variables :
183 * Result :
184 * Remark :
185 * Status : UNTESTED STUB
186 *
187 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
188 *****************************************************************************/
189
190HICON WIN32API ExtractIconExW(LPCWSTR lpszFile,
191 int nIconIndex,
192 HICON *phiconLarge,
193 HICON *phiconSmall,
194 UINT nIcons)
195{
196 dprintf(("SHELL32: ExtractIconExW(%s,%08xh,%08xh,%08xh,%u) not implemented.\n",
197 lpszFile,
198 nIconIndex,
199 phiconLarge,
200 phiconSmall,
201 nIcons));
202
203 return (0);
204}
205
206
207/*****************************************************************************
208 * Name : HINSTANCE WIN32API FindExecutableA
209 * Purpose :
210 * Parameters:
211 * Variables :
212 * Result :
213 * Remark :
214 * Status : UNTESTED STUB
215 *
216 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
217 *****************************************************************************/
218
219HINSTANCE WIN32API FindExecutableA(LPCSTR lpszFile,
220 LPCSTR lpszDir,
221 LPTSTR lpszResult)
222{
223 dprintf(("SHELL32: FindExecutableA (%s,%s,%s) not implemented.\n",
224 lpszFile,
225 lpszDir,
226 lpszResult));
227
228 return(NULL);
229}
230
231
232/*****************************************************************************
233 * Name : HINSTANCE WIN32API FindExecutableW
234 * Purpose :
235 * Parameters:
236 * Variables :
237 * Result :
238 * Remark :
239 * Status : UNTESTED STUB
240 *
241 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
242 *****************************************************************************/
243
244HINSTANCE WIN32API FindExecutableW(LPCWSTR lpszFile,
245 LPCWSTR lpszDir,
246 LPWSTR lpszResult)
247{
248 dprintf(("SHELL32: FindExecutableW (%s,%s,%s) not implemented.\n",
249 lpszFile,
250 lpszDir,
251 lpszResult));
252
253 return(NULL);
254}
255
256
257/*****************************************************************************
258 * Name : HICON WIN32API ExtractAssociatedIconA
259 * Purpose : Return icon for given file (either from file itself or from associated
260 * executable) and patch parameters if needed.
261 * Parameters:
262 * Variables :
263 * Result :
264 * Remark : SHELL.36
265 * Status : UNTESTED STUB
266 *
267 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
268 *****************************************************************************/
269
270HICON WIN32API ExtractAssociatedIconA(HINSTANCE hInst,
271 LPSTR lpIconPath,
272 LPWORD lpiIcon)
273{
274 HICON hIcon;
275
276 dprintf(("SHELL32: ExtractAssociatedIconA(%08xh,%s,%08xh)\n",
277 hInst,
278 lpIconPath,
279 lpiIcon));
280
281 hIcon = ExtractIconA(hInst,
282 lpIconPath,
283 *lpiIcon);
284
285 if( hIcon < 2 )
286 {
287 if( hIcon == 1 ) /* no icons found in given file */
288 {
289 char tempPath[0x80];
290 UINT uRet = FindExecutableA(lpIconPath,
291 NULL,
292 tempPath);
293
294 if(uRet > 32 && tempPath[0])
295 {
296 strcpy(lpIconPath,tempPath);
297 hIcon = ExtractIconA(hInst,
298 lpIconPath,
299 *lpiIcon);
300 if( hIcon > 2 )
301 return hIcon;
302 }
303 else
304 hIcon = 0;
305 }
306
307 if( hIcon == 1 )
308 *lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */
309 else
310 *lpiIcon = 6; /* generic icon - found nothing */
311
312 /* @@@PH - how is this supposed to work ?
313 GetModuleFileNameA(hInst,
314 lpIconPath,
315 0x80);
316 hIcon = LoadIconA(hInst,
317 *lpiIcon);
318 */
319 }
320 return hIcon;
321}
322
323/*****************************************************************************
324 * Name : HICON WIN32API ExtractAssociatedIconExA
325 * Purpose : Return icon for given file (either from file itself or from associated
326 * executable) and patch parameters if needed.
327 * Parameters: ???
328 * Variables :
329 * Result :
330 * Remark : SHELL.150
331 * Status : UNTESTED UNKNOWN STUB
332 *
333 * Author : Christoph Bratschi [Fri, 1999/08/6 20:00]
334 *****************************************************************************/
335
336HICON WIN32API ExtractAssociatedIconExA(HINSTANCE hInst,
337 LPSTR lpIconPath,
338 LPWORD lpiIcon)
339{
340 dprintf(("SHELL32: undoc ExtractAssociatedIconExA\n"));
341
342 return ExtractAssociatedIconA(hInst,lpIconPath,lpiIcon);
343}
344
345/*****************************************************************************
346 * Name : HICON WIN32API ExtractAssociatedIconW
347 * Purpose : Return icon for given file (either from file itself or from associated
348 * executable) and patch parameters if needed.
349 * Parameters:
350 * Variables :
351 * Result :
352 * Remark : SHELL.36
353 * Status : UNTESTED STUB
354 *
355 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
356 *****************************************************************************/
357
358HICON WIN32API ExtractAssociatedIconW(HINSTANCE hInst,
359 LPWSTR lpIconPath,
360 LPWORD lpiIcon)
361{
362 LPSTR lpIconPathAscii = UnicodeToAsciiString(lpIconPath);
363 HICON hIcon;
364
365 dprintf(("SHELL32: ExtractAssociatedIconW(%08xh,%s,%08xh)\n",
366 hInst,
367 lpIconPathAscii,
368 lpiIcon));
369
370 hIcon = ExtractAssociatedIconA(hInst,
371 lpIconPathAscii,
372 lpiIcon);
373
374 FreeAsciiString(lpIconPathAscii);
375
376 return (hIcon);
377}
378
379/*****************************************************************************
380 * Name : HICON WIN32API ExtractAssociatedIconExW
381 * Purpose : Return icon for given file (either from file itself or from associated
382 * executable) and patch parameters if needed.
383 * Parameters: ???
384 * Variables :
385 * Result :
386 * Remark : SHELL.186
387 * Status : UNTESTED UNKNOWN STUB
388 *
389 * Author : Christoph Bratschi [Fri, 1999/08/6 20:00]
390 *****************************************************************************/
391
392HICON WIN32API ExtractAssociatedIconExW(HINSTANCE hInst,
393 LPWSTR lpIconPath,
394 LPWORD lpiIcon)
395{
396 dprintf(("SHELL32: undoc ExtractAssociatedIconExW\n"));
397
398 return ExtractAssociatedIconW(hInst,lpIconPath,lpiIcon);
399}
400
401/*****************************************************************************
402 * Name : ParseField
403 * Purpose :
404 * Parameters:
405 * Variables :
406 * Result :
407 * Remark : SHELL32.58
408 * Status : UNTESTED UNKNOWN STUB
409 *
410 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
411 *****************************************************************************/
412
413DWORD WIN32API ParseFieldA(LPCSTR src,
414 DWORD field,
415 LPSTR dst,
416 DWORD len)
417{
418 dprintf(("SHELL32: ParseFieldA(%s,%08xh,%08xh,%08xh) not correctly implemented.\n",
419 src,
420 field,
421 dst,
422 len));
423
424 if (!src || !src[0] || !dst || !len)
425 return 0;
426
427 if (field >1)
428 {
429 field--;
430 while (field)
431 {
432 if (*src==0x0) return FALSE;
433 if (*src==',') field--;
434 src++;
435 }
436 }
437
438 while (*src!=0x00 && *src!=',' && len>0)
439 {
440 *dst=*src; dst++, src++; len--;
441 }
442 *dst=0x0;
443 return TRUE;
444}
445
446
447/*****************************************************************************
448 * Name : PickIconDlg
449 * Purpose :
450 * Parameters:
451 * Variables :
452 * Result :
453 * Remark : SHELL32.62
454 * Status : UNTESTED UNKNOWN STUB
455 *
456 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
457 *****************************************************************************/
458
459DWORD WIN32API PickIconDlg(DWORD x,DWORD y,DWORD z,DWORD a)
460{
461 dprintf(("SHELL32: PickIconDlg(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
462 x,
463 y,
464 z,
465 a));
466
467 return 0xffffffff;
468}
469
470
471/*****************************************************************************
472 * Name : GetFileNameFromBrowse
473 * Purpose :
474 * Parameters:
475 * Variables :
476 * Result :
477 * Remark : SHELL32.63
478 * Status : UNTESTED UNKNOWN STUB
479 *
480 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
481 *****************************************************************************/
482
483DWORD WIN32API GetFileNameFromBrowse(HWND howner,
484 LPSTR targetbuf,
485 DWORD len,
486 DWORD x,
487 LPCSTR suffix,
488 LPCSTR y,
489 LPCSTR cmd)
490{
491 dprintf(("SHELL32: GetFileNameFromBrowse(%08xh, %08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
492 howner,
493 targetbuf,
494 len,
495 x,
496 suffix,
497 y,
498 cmd));
499
500 /* puts up a Open Dialog and requests input into targetbuf */
501 /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
502 strcpy(targetbuf,
503 "x:\\dummy.exe");
504
505 return 1;
506}
507
508
509/*****************************************************************************
510 * Name : OleStrToStrN
511 * Purpose :
512 * Parameters:
513 * Variables :
514 * Result :
515 * Remark : SHELL32.78
516 * Status : UNTESTED UNKNOWN STUB
517 *
518 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
519 *****************************************************************************/
520
521BOOL WIN32API OleStrToStrN (LPSTR lpMulti,
522 INT nMulti,
523 LPCWSTR lpWide,
524 INT nWide)
525{
526 dprintf(("SHELL32: OleStrToStrN(%08xh,%08xh,%08xh,%08xh)\n",
527 lpMulti,
528 nMulti,
529 lpWide,
530 nWide));
531
532 return WideCharToMultiByte (0,
533 0,
534 lpWide,
535 nWide,
536 lpMulti,
537 nMulti,
538 NULL,
539 NULL);
540}
541
542
543/*****************************************************************************
544 * Name : StrToOleStrN
545 * Purpose :
546 * Parameters:
547 * Variables :
548 * Result :
549 * Remark : SHELL32.79
550 * Status : UNTESTED UNKNOWN STUB
551 *
552 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
553 *****************************************************************************/
554
555BOOL WIN32API StrToOleStrN (LPWSTR lpWide,
556 INT nWide,
557 LPCSTR lpMulti,
558 INT nMulti)
559{
560 dprintf(("SHELL32: StrToOleStrN(%08xh,%08xh,%08xh,%08xh)\n",
561 lpWide,
562 nWide,
563 lpMulti,
564 nMulti));
565
566 return MultiByteToWideChar (0,
567 0,
568 lpMulti,
569 nMulti,
570 lpWide,
571 nWide);
572}
573
574
575/*****************************************************************************
576 * Name : RegisterShellHook
577 * Purpose :
578 * Parameters:
579 * Variables :
580 * Result :
581 * Remark : SHELL32.181
582 * Status : UNTESTED UNKNOWN STUB
583 *
584 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
585 *
586 * PARAMS
587 * hwnd [I] window handle
588 * y [I] flag ????
589 *
590 * NOTES
591 * exported by ordinal
592 */
593
594void WIN32API RegisterShellHook(HWND hwnd,
595 DWORD y)
596{
597 dprintf(("SHELL32: RegisterShellHook(%08xh, %08xh) not implemented.\n",
598 hwnd,
599 y));
600}
601
602
603/*****************************************************************************
604 * Name : RunFileDlg
605 * Purpose :
606 * Parameters:
607 * Variables :
608 * Result :
609 * Remark : SHELL32.61
610 * Status : UNTESTED UNKNOWN STUB
611 *
612 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
613 *****************************************************************************/
614
615DWORD WIN32API RunFileDlg (HWND hwndOwner,
616 DWORD dwParam1,
617 DWORD dwParam2,
618 LPSTR lpszTitle,
619 LPSTR lpszPrompt,
620 UINT uFlags)
621{
622 dprintf(("SHELL32: RunFileDlg(%08xh,%08xh,%08xh,%s,%s,%08xh) not implemented.\n",
623 hwndOwner,
624 dwParam1,
625 dwParam2,
626 lpszTitle,
627 lpszPrompt,
628 uFlags));
629
630 return 0;
631}
632
633
634/*****************************************************************************
635 * Name : ExitWindowsDialog
636 * Purpose :
637 * Parameters:
638 * Variables :
639 * Result :
640 * Remark : SHELL32.60
641 * Status : UNTESTED UNKNOWN STUB
642 *
643 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
644 *****************************************************************************/
645
646void WIN32API ExitWindowsDialog (HWND hWndOwner)
647{
648 dprintf(("SHELL32: ExitWindowsDialog(%08xh)\n",
649 hWndOwner));
650
651 if (MessageBoxA(hWndOwner,
652 "Do you want to exit ODIN?",
653 "Shutdown",
654 MB_YESNO|MB_ICONQUESTION)
655 == IDOK)
656 {
657 SendMessageA (hWndOwner,
658 WM_QUIT,
659 0,
660 0);
661 }
662}
663
664
665/*****************************************************************************
666 * Name : ArrangeWindows
667 * Purpose :
668 * Parameters:
669 * Variables :
670 * Result :
671 * Remark : SHELL32.184
672 * Status : UNTESTED UNKNOWN STUB
673 *
674 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
675 *****************************************************************************/
676
677DWORD WIN32API ArrangeWindows (DWORD dwParam1,
678 DWORD dwParam2,
679 DWORD dwParam3,
680 DWORD dwParam4,
681 DWORD dwParam5)
682{
683 dprintf(("SHELL32: ArrangeWindows(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
684 dwParam1,
685 dwParam2,
686 dwParam3,
687 dwParam4,
688 dwParam5));
689
690 return 0;
691}
692
693
694/*****************************************************************************
695 * Name : SignalFileOpen
696 * Purpose :
697 * Parameters:
698 * Variables :
699 * Result :
700 * Remark : SHELL32.103
701 * Status : UNTESTED UNKNOWN STUB
702 *
703 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
704 *****************************************************************************/
705
706DWORD WIN32API SignalFileOpen (DWORD dwParam1)
707{
708 dprintf(("SHELL32: SignalFileOpen(%08xh) not implemented.\n",
709 dwParam1));
710
711 return 0;
712}
713
714
715/*****************************************************************************
716 * Name : DAD_ShowDrawImage
717 * Purpose :
718 * Parameters:
719 * Variables :
720 * Result :
721 * Remark : SHELL32.137
722 * Status : UNTESTED UNKNOWN STUB
723 *
724 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
725 *****************************************************************************/
726
727HRESULT WIN32API DAD_ShowDragImage (DWORD u)
728{
729 dprintf(("SHELL32: DAD_ShowDragImage(%08xh) not implemented.\n",
730 u));
731
732 return 0;
733}
734
735
736/*****************************************************************************
737 * Name : ReadCabinetState
738 * Purpose :
739 * Parameters:
740 * Variables :
741 * Result :
742 * Remark : SHELL32.651
743 * Status : UNTESTED UNKNOWN STUB
744 *
745 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
746 *****************************************************************************/
747
748HRESULT WIN32API ReadCabinetState(DWORD u,
749 DWORD v)
750{
751 dprintf(("SHELL32: ReadCabinetState(%08xh, %08xh) not implemented.\n",
752 u,
753 v));
754
755 return 0;
756}
757
758
759/*****************************************************************************
760 * Name : WriteCabinetState
761 * Purpose :
762 * Parameters:
763 * Variables :
764 * Result :
765 * Remark : SHELL32.652
766 * Status : UNTESTED UNKNOWN STUB
767 *
768 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
769 *****************************************************************************/
770
771HRESULT WIN32API WriteCabinetState(DWORD u)
772{
773 dprintf(("SHELL32: WriteCabinetState(%08xh) not implemented.\n",
774 u));
775
776 return 0;
777}
778
779
780/*****************************************************************************
781 * Name : FileIconInit
782 * Purpose :
783 * Parameters:
784 * Variables :
785 * Result :
786 * Remark : SHELL32.660
787 * Status : UNTESTED UNKNOWN STUB
788 *
789 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
790 *****************************************************************************/
791
792BOOL WIN32API FileIconInit(BOOL bFullInit)
793{
794 dprintf(("SHELL32: FileIconInit(%08xh) not implemented.\n",
795 bFullInit));
796
797 return 0;
798}
799
800
801/*****************************************************************************
802 * Name : IsUserAdmin
803 * Purpose :
804 * Parameters:
805 * Variables :
806 * Result :
807 * Remark : SHELL32.680
808 * Status : UNTESTED UNKNOWN STUB
809 *
810 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
811 *****************************************************************************/
812
813HRESULT WIN32API IsUserAdmin(void)
814{
815 dprintf(("SHELL32: IsUserAdmin() not implmented. Yes, user is admin ;-)\n"));
816
817 return TRUE;
818}
819
820
821/*****************************************************************************
822 * Name : StrRetToStrN
823 * Purpose : converts a STRRET to a normal string
824 * Parameters: the pidl is for STRRET OFFSET
825 * Variables :
826 * Result :
827 * Remark : SHELL32.96
828 * Status : UNTESTED UNKNOWN STUB
829 *
830 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
831 *****************************************************************************/
832
833HRESULT WIN32API StrRetToStrN (LPVOID dest,
834 DWORD len,
835 LPSTRRET src,
836 LPITEMIDLIST pidl)
837{
838 dprintf(("SHELL32: StrRetToStrN(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
839 dest,
840 len,
841 src,
842 pidl));
843
844 switch (src->uType)
845 {
846 case STRRET_WSTR:
847 WideCharToMultiByte(CP_ACP,
848 0,
849 src->u.pOleStr,
850 -1,
851 (LPSTR)dest,
852 len,
853 NULL,
854 NULL);
855 SHFree(src->u.pOleStr);
856 break;
857
858 case STRRET_CSTRA:
859 //if (VERSION_OsIsUnicode())
860 // lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
861 //else
862 strncpy((LPSTR)dest,
863 src->u.cStr,
864 len);
865 break;
866
867 case STRRET_OFFSETA:
868 if (pidl)
869 {
870 //if(VERSION_OsIsUnicode())
871 // lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
872 //else
873 strncpy((LPSTR)dest,
874 ((LPCSTR)&pidl->mkid)+src->u.uOffset,
875 len);
876 break;
877 }
878
879 default:
880 dprintf(("SHELL32: StrRetToStrN: unknown type!\n"));
881
882 if (len)
883 *(LPSTR)dest = '\0';
884
885 return(FALSE);
886 }
887 return(TRUE);
888}
889
890/*****************************************************************************
891 * Name : StrChrW
892 * Purpose :
893 * Parameters:
894 * Variables :
895 * Result :
896 * Remark : SHELL32.651
897 * Status : UNTESTED UNKNOWN STUB
898 *
899 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
900 *****************************************************************************/
901
902LPWSTR WIN32API StrChrW (LPWSTR str,
903 WCHAR x)
904{
905 dprintf (("SHELL32: StrChrW(%08xh, %08xh)\n",
906 str,
907 x));
908
909 return ((LPWSTR)wcschr((const wchar_t*)str,
910 x));
911}
912
913
914/*****************************************************************************
915 * Name : StrChrNIW
916 * Purpose :
917 * Parameters:
918 * Variables :
919 * Result :
920 * Remark : SHELL32.?
921 * Status : UNTESTED UNKNOWN STUB
922 *
923 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
924 *****************************************************************************/
925
926INT WIN32API StrCmpNIW (LPWSTR wstr1,
927 LPWSTR wstr2,
928 INT len)
929{
930 dprintf(("SHELL32: StrCmpNIW(%08xh,%08xh,%08xh) not correctly implemented.\n",
931 wstr1,
932 wstr2,
933 len));
934
935 return (wcsncmp((const wchar_t*)wstr1,
936 (const wchar_t*)wstr2,
937 len));
938}
939
940
941/*****************************************************************************
942 * Name : DriveType
943 * Purpose :
944 * Parameters:
945 * Variables :
946 * Result :
947 * Remark : SHELL32.64
948 * Status : UNTESTED UNKNOWN STUB
949 *
950 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
951 *****************************************************************************/
952
953HRESULT WIN32API DriveType(DWORD u)
954{
955 dprintf(("SHELL32: DriveType(%08xh) not implemented.\n",
956 u));
957
958 return 0;
959}
960
961
962/*****************************************************************************
963 * Name : StrRChrW
964 * Purpose :
965 * Parameters:
966 * Variables :
967 * Result :
968 * Remark : SHELL32.320, wcsrchr does not work?
969 * Status : UNTESTED UNKNOWN STUB
970 *
971 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
972 *****************************************************************************/
973
974LPWSTR WIN32API StrRChrW(LPWSTR lpStart,
975 LPWSTR lpEnd,
976 DWORD wMatch)
977{
978 LPWSTR wptr=NULL;
979
980 dprintf(("SHELL32: StrRChrW(%08xh,%08xh,%08xh)\n",
981 lpStart,
982 lpEnd,
983 wMatch));
984
985 /* if the end not given, search*/
986 if (!lpEnd)
987 {
988 lpEnd=lpStart;
989 while (*lpEnd)
990 lpEnd++;
991 }
992
993 do
994 {
995 if (*lpStart==(WCHAR)wMatch)
996 wptr = lpStart;
997 lpStart++;
998 }
999 while ( lpStart<=lpEnd );
1000 return wptr;
1001}
1002
1003
1004/*****************************************************************************
1005 * Name : Control_FillCache_RunDLL
1006 * Purpose :
1007 * Parameters:
1008 * Variables :
1009 * Result :
1010 * Remark : SHELL32.8
1011 * Status : UNTESTED UNKNOWN STUB
1012 *
1013 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1014 *****************************************************************************/
1015
1016HRESULT WIN32API Control_FillCache_RunDLL(HWND hWnd,
1017 HANDLE hModule,
1018 DWORD w,
1019 DWORD x)
1020{
1021 dprintf(("SHELL32: Control_FillCache_RunDLL(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
1022 hWnd,
1023 hModule,
1024 w,
1025 x));
1026
1027 return 0;
1028}
1029
1030
1031/*****************************************************************************
1032 * Name : RunDLL_CallEntry16
1033 * Purpose :
1034 * Parameters:
1035 * Variables :
1036 * Result :
1037 * Remark : SHELL32.122 - the name is propably wrong
1038 * Status : UNTESTED UNKNOWN STUB
1039 *
1040 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1041 *****************************************************************************/
1042
1043HRESULT WIN32API RunDLL_CallEntry16(DWORD v,
1044 DWORD w,
1045 DWORD x,
1046 DWORD y,
1047 DWORD z)
1048{
1049 dprintf(("SHELL32: RunDLL_CallEntry16(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
1050 v,
1051 w,
1052 x,
1053 y,
1054 z));
1055
1056 return 0;
1057}
1058
1059
1060/*****************************************************************************
1061 * Name : SHELL32_654
1062 * Purpose :
1063 * Parameters:
1064 * Variables :
1065 * Result :
1066 * Remark : SHELL32.654
1067 * Status : UNTESTED UNKNOWN STUB
1068 *
1069 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1070 *****************************************************************************/
1071
1072HRESULT WIN32API SHELL32_654 (DWORD x,
1073 DWORD y)
1074{
1075 dprintf(("SHELL32: SHELL32_654(%08xh,%08xh) not implemented.\n",
1076 x,
1077 y));
1078 return 0;
1079}
1080
1081
1082/*****************************************************************************
1083 * Name : RLBuildListOfPaths
1084 * Purpose :
1085 * Parameters:
1086 * Variables :
1087 * Result :
1088 * Remark : SHELL32.146 - builds a DPA
1089 * Status : UNTESTED UNKNOWN STUB
1090 *
1091 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1092 *****************************************************************************/
1093
1094DWORD WIN32API RLBuildListOfPaths ()
1095{
1096 dprintf(("SHELL32: RLBuildListOfPaths() not implemented.\n"));
1097 return 0;
1098}
1099
1100
1101/*****************************************************************************
1102 * Name : StrToOleStr
1103 * Purpose :
1104 * Parameters:
1105 * Variables :
1106 * Result :
1107 * Remark : SHELL32.163
1108 * Status : UNTESTED UNKNOWN STUB
1109 *
1110 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1111 *****************************************************************************/
1112
1113int WIN32API StrToOleStr (LPWSTR lpWideCharStr,
1114 LPCSTR lpMultiByteString)
1115{
1116 dprintf(("SHELL32: StrToOleStr(%08xh,%08xh)\n",
1117 lpWideCharStr,
1118 lpMultiByteString));
1119
1120 return MultiByteToWideChar(0,
1121 0,
1122 lpMultiByteString,
1123 -1,
1124 lpWideCharStr,
1125 MAX_PATH);
1126}
1127
1128
1129/*****************************************************************************
1130 * Name : SetAppStartingCursor
1131 * Purpose :
1132 * Parameters:
1133 * Variables :
1134 * Result :
1135 * Remark : SHELL32.99
1136 * Status : UNTESTED UNKNOWN STUB
1137 *
1138 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
1139 *****************************************************************************/
1140
1141HRESULT WIN32API SetAppStartingCursor(HWND u,
1142 DWORD v)
1143{
1144 dprintf(("SHELL32: SetAppStartingCursor (SHELL32.99): (%08xh,%08xh) not implemented.\n",
1145 u,
1146 v));
1147
1148 return 0;
1149}
1150
1151/*****************************************************************************
1152 * Name : StrCpyNW
1153 * Purpose :
1154 * Parameters:
1155 * Variables :
1156 * Result :
1157 * Remark : SHELL32.310 - used by winfile.exe
1158 * Status : UNTESTED UNKNOWN STUB
1159 *
1160 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1161 *****************************************************************************/
1162
1163LPWSTR WIN32API StrCpyNW(LPWSTR lpString1,LPWSTR lpString2,int iMaxLength)
1164{
1165 dprintf(("SHELL32: undoc StrCpyNW\n"));
1166
1167 return lstrcpynW(lpString1,lpString2,iMaxLength);
1168}
1169
1170/*****************************************************************************
1171 * Name : StrNCpyW
1172 * Purpose :
1173 * Parameters:
1174 * Variables :
1175 * Result :
1176 * Remark : SHELL32.316 - used by winfile.exe
1177 * Status : UNTESTED UNKNOWN STUB
1178 *
1179 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1180 *****************************************************************************/
1181
1182LPWSTR WIN32API StrNCpyW(LPWSTR lpString1,LPWSTR lpString2)
1183{
1184 dprintf(("SHELL32: undoc StrNCpyW\n"));
1185
1186 return lstrcpyW(lpString1,lpString2);
1187}
1188
1189/*****************************************************************************
1190 * Name : FreeIconList
1191 * Purpose :
1192 * Parameters:
1193 * Variables :
1194 * Result :
1195 * Remark : SHELL32.220 - used by progman.exe
1196 * Status : UNTESTED UNKNOWN STUB
1197 *
1198 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1199 *****************************************************************************/
1200
1201void WIN32API FreeIconList(DWORD dw)
1202{
1203 dprintf(("SHELL32: undoc FreeIconList %08xh\n",dw));
1204}
1205
1206/*****************************************************************************
1207 * Name : InternalExtractIconListA
1208 * Purpose :
1209 * Parameters: ???
1210 * Variables :
1211 * Result :
1212 * Remark : SHELL32.221 - used by progman.exe
1213 * Status : UNTESTED UNKNOWN STUB
1214 *
1215 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1216 *****************************************************************************/
1217
1218void WIN32API InternalExtractIconListA(VOID)
1219{
1220 dprintf(("SHELL32: undoc InternalExtractIconListA \n"));
1221}
1222
1223/*****************************************************************************
1224 * Name : InternalExtractIconListW
1225 * Purpose :
1226 * Parameters: ???
1227 * Variables :
1228 * Result :
1229 * Remark : SHELL32.222 - used by progman.exe
1230 * Status : UNTESTED UNKNOWN STUB
1231 *
1232 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1233 *****************************************************************************/
1234
1235void WIN32API InternalExtractIconListW(VOID)
1236{
1237 dprintf(("SHELL32: undoc InternalExtractIconListW\n"));
1238}
1239
1240/*****************************************************************************
1241 * Name : ExtractIconResInfoA
1242 * Purpose :
1243 * Parameters: ???
1244 * Variables :
1245 * Result :
1246 * Remark : SHELL32.192 - used by progman.exe
1247 * Status : UNTESTED UNKNOWN STUB
1248 *
1249 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1250 *****************************************************************************/
1251
1252void WIN32API ExtractIconResInfoA(VOID)
1253{
1254 dprintf(("SHELL32: undoc ExtractIconResInfoA\n"));
1255}
1256
1257/*****************************************************************************
1258 * Name : ExtractIconResInfoW
1259 * Purpose :
1260 * Parameters: ???
1261 * Variables :
1262 * Result :
1263 * Remark : SHELL32.193 - used by progman.exe
1264 * Status : UNTESTED UNKNOWN STUB
1265 *
1266 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1267 *****************************************************************************/
1268
1269void WIN32API ExtractIconResInfoW(VOID)
1270{
1271 dprintf(("SHELL32: undoc ExtractIconResInfoW\n"));
1272}
1273
1274INT WINAPI lstrncmpiA( LPCSTR str1, LPCSTR str2, INT n )
1275{
1276 //CB: implement!
1277 return 0;
1278}
1279
1280/*************************************************************************
1281 * FindEnvironmentString [SHELL.38]
1282 *
1283 * Returns a pointer into the DOS environment... Ugh.
1284 */
1285LPSTR SHELL_FindStringA(LPSTR lpEnv, LPCSTR entry)
1286{ UINT16 l;
1287
1288 //TRACE_(shell)("\n");
1289
1290 l = strlen(entry);
1291 for( ; *lpEnv ; lpEnv+=strlen(lpEnv)+1 )
1292 { if( lstrncmpiA(lpEnv, entry, l) )
1293 continue;
1294 if( !*(lpEnv+l) )
1295 return (lpEnv + l); /* empty entry */
1296 else if ( *(lpEnv+l)== '=' )
1297 return (lpEnv + l + 1);
1298 }
1299 return NULL;
1300}
1301
1302/*****************************************************************************
1303 * Name : DoEnvironmentSubstA
1304 * Purpose :
1305 * Parameters: ??? ported WINE 16 bit function
1306 * Variables :
1307 * Result :
1308 * Remark : SHELL32.44 - used by progman.exe
1309 * Status : UNTESTED UNKNOWN STUB
1310 *
1311 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1312 *****************************************************************************/
1313
1314DWORD WIN32API DoEnvironmentSubstA(LPSTR str,DWORD length)
1315{
1316 LPSTR lpEnv = (LPSTR)GetEnvironmentStringsA();
1317 LPSTR lpBuffer = (LPSTR)HeapAlloc( GetProcessHeap(), 0, length);
1318 LPSTR lpstr = str;
1319 LPSTR lpbstr = lpBuffer;
1320
1321 dprintf(("SHELL32: undoc DoEnvironmentSubstA\n"));
1322
1323 CharToOemA(str,str);
1324
1325 while( *lpstr && lpbstr - lpBuffer < length )
1326 {
1327 LPSTR lpend = lpstr;
1328
1329 if( *lpstr == '%' )
1330 {
1331 do { lpend++; } while( *lpend && *lpend != '%' );
1332 if( *lpend == '%' && lpend - lpstr > 1 ) /* found key */
1333 {
1334 LPSTR lpKey;
1335 *lpend = '\0';
1336 lpKey = SHELL_FindStringA(lpEnv, lpstr+1);
1337 if( lpKey ) /* found key value */
1338 {
1339 int l = strlen(lpKey);
1340
1341 if( l > length - (lpbstr - lpBuffer) - 1 )
1342 {
1343 //WARN_(shell)("-- Env subst aborted - string too short\n");
1344 *lpend = '%';
1345 break;
1346 }
1347 strcpy(lpbstr, lpKey);
1348 lpbstr += l;
1349 }
1350 else break;
1351 *lpend = '%';
1352 lpstr = lpend + 1;
1353 }
1354 else break; /* back off and whine */
1355
1356 continue;
1357 }
1358
1359 *lpbstr++ = *lpstr++;
1360 }
1361
1362 *lpbstr = '\0';
1363 if( lpstr - str == strlen(str) )
1364 {
1365 strncpy(str, lpBuffer, length);
1366 length = 1;
1367 }
1368 else
1369 length = 0;
1370
1371 //TRACE_(shell)("-- return %s\n", str);
1372
1373 OemToCharA(str,str);
1374 HeapFree( GetProcessHeap(), 0, lpBuffer);
1375
1376 FreeEnvironmentStringsA(lpEnv);
1377
1378 /* Return str length in the LOWORD
1379 * and 1 in HIWORD if subst was successful.
1380 */
1381
1382 return (DWORD)MAKELONG(strlen(str), length);
1383}
1384
1385/*****************************************************************************
1386 * Name : DoEnvironmentSubstW
1387 * Purpose :
1388 * Parameters: ???
1389 * Variables :
1390 * Result :
1391 * Remark : SHELL32.193 - used by progman.exe
1392 * Status : UNTESTED UNKNOWN STUB
1393 *
1394 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1395 *****************************************************************************/
1396
1397DWORD WIN32API DoEnvironmentSubstW(LPWSTR str,DWORD length)
1398{
1399 //CB: call DoEnvironmentSubstW
1400 dprintf(("SHELL32: undoc DoEnvironmentSubstW\n"));
1401
1402 return 0;
1403}
1404
1405/*****************************************************************************
1406 * Name : CheckEscapesA
1407 * Purpose :
1408 * Parameters: ???
1409 * Variables :
1410 * Result :
1411 * Remark : SHELL32.3 - used by progman.exe
1412 * Status : UNTESTED UNKNOWN STUB
1413 *
1414 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1415 *****************************************************************************/
1416
1417void WIN32API CheckEscapesA(DWORD x1,DWORD x2)
1418{
1419 dprintf(("SHELL32: undoc CheckEscapesA\n"));
1420}
1421
1422/*****************************************************************************
1423 * Name : CheckEscapesW
1424 * Purpose :
1425 * Parameters: ???
1426 * Variables :
1427 * Result :
1428 * Remark : SHELL32.6 - used by progman.exe
1429 * Status : UNTESTED UNKNOWN STUB
1430 *
1431 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1432 *****************************************************************************/
1433
1434void WIN32API CheckEscapesW(DWORD x1,DWORD x2)
1435{
1436 dprintf(("SHELL32: undoc CheckEscapesW\n"));
1437}
1438
1439/*****************************************************************************
1440 * Name : DuplicateIcon
1441 * Purpose :
1442 * Parameters: ???
1443 * Variables :
1444 * Result :
1445 * Remark : SHELL32.138 - used by progman.exe
1446 * Status : UNTESTED UNKNOWN STUB
1447 *
1448 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
1449 *****************************************************************************/
1450
1451DWORD WIN32API DuplicateIcon(DWORD x1)
1452{
1453 dprintf(("SHELL32: undoc DuplicateIcon\n"));
1454
1455 return 0;
1456}
Note: See TracBrowser for help on using the repository browser.