Many bugfixes, new stubs SHGetRealIDL, SHRegQueryValue32W,
[wine] / dlls / shell32 / shellord.c
1 /*
2  *                              Shell Ordinal Functions
3  *
4  * These are completely undocumented. The meaning of the functions changes
5  * between different OS versions (NT uses Unicode strings, 95 uses ASCII
6  * strings, etc. etc.)
7  * 
8  * They are just here so that explorer.exe and iexplore.exe can be tested.
9  *
10  * Copyright 1997 Marcus Meissner
11  *           1998 Jürgen Schmied
12  */
13 #include <stdlib.h>
14 #include <string.h>
15 #include <unistd.h>
16 #include <ctype.h>
17 #include "windows.h"
18 #include "winerror.h"
19 #include "file.h"
20 #include "shell.h"
21 #include "heap.h"
22 #include "module.h"
23 #include "neexe.h"
24 #include "resource.h"
25 #include "dlgs.h"
26 #include "win.h"
27 #include "graphics.h"
28 #include "cursoricon.h"
29 #include "interfaces.h"
30 #include "shlobj.h"
31 #include "debug.h"
32 #include "winreg.h"
33 #include "shell32_main.h"
34
35 /*************************************************************************
36  * SHChangeNotifyRegister [SHELL32.2]
37  * NOTES
38  *   Idlist is an array of structures and Count specifies how many items in the array
39  *   (usually just one I think).
40  */
41 DWORD WINAPI
42 SHChangeNotifyRegister(
43     HWND32 hwnd,
44     LONG events1,
45     LONG events2,
46     DWORD msg,
47     int count,
48     IDSTRUCT *idlist)
49 {       FIXME(shell,"(0x%04x,0x%08lx,0x%08lx,0x%08lx,0x%08x,%p):stub.\n",
50                 hwnd,events1,events2,msg,count,idlist);
51         return 0;
52 }
53 /*************************************************************************
54  * SHChangeNotifyDeregister [SHELL32.4]
55  */
56 DWORD WINAPI
57 SHChangeNotifyDeregister(LONG x1,LONG x2)
58 {       FIXME(shell,"(0x%08lx,0x%08lx):stub.\n",x1,x2);
59         return 0;
60 }
61
62 /*************************************************************************
63  * PathIsRoot [SHELL32.29]
64  */
65 BOOL32 WINAPI PathIsRoot(LPCSTR x) {
66   TRACE(shell,"%s\n",x);
67         if (!strcmp(x+1,":\\"))         /* "X:\" */
68                 return 1;
69         if (!strcmp(x,"\\"))            /* "\" */
70                 return 1;
71         if (x[0]=='\\' && x[1]=='\\') {         /* UNC "\\<xx>\" */
72                 int     foundbackslash = 0;
73                 x=x+2;
74                 while (*x) {
75                         if (*x++=='\\')
76                                 foundbackslash++;
77                 }
78                 if (foundbackslash<=1)  /* max 1 \ more ... */
79                         return 1;
80         }
81         return 0;
82 }
83
84 /*************************************************************************
85  * PathBuildRoot [SHELL32.30]
86  */
87 LPSTR WINAPI PathBuildRoot(LPSTR root,BYTE drive) {
88   TRACE(shell,"%p %i\n",root, drive);
89         strcpy(root,"A:\\");
90         root[0]+=drive;
91         return root;
92 }
93
94 /*************************************************************************
95  * PathFindExtension [SHELL32.31]
96  *
97  * NOTES
98  *     returns pointer to last . in last pathcomponent or at \0.
99  */
100 LPSTR WINAPI PathFindExtension(LPSTR path) {
101   LPSTR   lastpoint = NULL;
102   TRACE(shell,"%p %s\n",path,path);
103     while (*path) {
104         if (*path=='\\'||*path==' ')
105             lastpoint=NULL;
106         if (*path=='.')
107             lastpoint=path;
108         path++;
109     }
110     return lastpoint?lastpoint:path;
111 }
112
113 /*************************************************************************
114  * PathAddBackslash [SHELL32.32]
115  * 
116  * NOTES
117  *     append \ if there is none
118  */
119 LPSTR WINAPI PathAddBackslash(LPSTR path)
120 {       int len;
121         TRACE(shell,"%p->%s\n",path,path);
122
123         len = strlen(path);
124         if (len && path[len-1]!='\\') 
125         { path[len]  = '\\';
126           path[len+1]= 0x00;
127           return path+len+1;
128         }
129         return path+len;
130 }
131
132 /*************************************************************************
133  * PathRemoveBlanks [SHELL32.33]
134  * 
135  * NOTES
136  *     remove spaces from beginning and end of passed string
137  */
138 LPSTR WINAPI PathRemoveBlanks(LPSTR str)
139 { LPSTR x = str;
140   TRACE(shell,"%s\n",str);
141   while (*x==' ') x++;
142   if (x!=str)
143           strcpy(str,x);
144   if (!*str)
145           return str;
146   x=str+strlen(str)-1;
147   while (*x==' ')
148           x--;
149   if (*x==' ')
150           *x='\0';
151   return x;
152 }
153
154
155 /*************************************************************************
156  * PathFindFilename [SHELL32.34]
157  * 
158  * NOTES
159  *     basename(char *fn);
160  */
161 LPSTR WINAPI PathFindFilename(LPSTR fn)
162 {       LPSTR basefn;
163         TRACE(shell,"%s\n",fn);
164     basefn = fn;
165     while (fn[0]) 
166     { if (((fn[0]=='\\') || (fn[0]==':')) && fn[1] && fn[1]!='\\')
167           basefn = fn+1;
168           fn++;
169     }
170     return basefn;
171 }
172
173 /*************************************************************************
174  * PathRemoveFileSpec [SHELL32.35]
175  * 
176  * NOTES
177  *     bool getpath(char *pathname); truncates passed argument to a valid path
178  *     returns if the string was modified or not.
179  *     "\foo\xx\foo"-> "\foo\xx"
180  *     "\" -> "\"
181  *     "a:\foo" -> "a:\"
182  */
183 DWORD WINAPI PathRemoveFileSpec(LPSTR fn) {
184         LPSTR   x,cutplace;
185   TRACE(shell,"%s\n",fn);
186         if (!fn[0])
187                 return 0;
188         x=fn;
189         cutplace = fn;
190         while (*x) {
191                 if (*x=='\\') {
192                         cutplace=x++;
193                         continue;
194                 }
195                 if (*x==':') {
196                         x++;
197                         if (*x=='\\')
198                                 cutplace=++x;
199                         continue; /* already x++ed */
200                 }
201                 x++;
202         }
203         if (!*cutplace)
204                 return 0;
205         if (cutplace==fn) {
206                 if (fn[0]=='\\') {
207                         if (!fn[1])
208                                 return 0;
209                         fn[0]='\0';
210                         return 1;
211                 }
212         }
213         *cutplace='\0';
214         return 1;
215 }
216
217 /*************************************************************************
218  * PathAppend [SHELL32.36]
219  * 
220  * NOTES
221  *     concat_paths(char*target,const char*add);
222  *     concats "target\\add" and writes them to target
223  */
224 LPSTR WINAPI PathAppend(LPSTR x1,LPSTR x2) {
225   TRACE(shell,"%s %s\n",x1,x2);
226   while (x2[0]=='\\') x2++;
227   return PathCombine(x1,x1,x2);
228 }
229
230 /*************************************************************************
231  * PathCombine [SHELL32.37]
232  * 
233  * NOTES
234  *  if lpszFile='.' skip it
235  *  szDest can be equal to lpszFile. Thats why we use sTemp
236  */
237 LPSTR WINAPI PathCombine(LPSTR szDest, LPCSTR lpszDir, LPCSTR lpszFile) 
238 {       char sTemp[MAX_PATH];
239         TRACE(shell,"%p %p->%s %p->%s\n",szDest, lpszDir, lpszDir, lpszFile, lpszFile);
240
241         if (!lpszFile || !lpszFile[0] || (lpszFile[0]=='.' && !lpszFile[1]) ) 
242         { strcpy(szDest,lpszDir);
243           return szDest;
244         }
245
246         /*  if lpszFile is a complete path don't care about lpszDir */
247         if (PathIsRoot(lpszFile))
248         { strcpy(szDest,lpszFile);
249         }
250         strcpy(sTemp,lpszDir);
251         PathAddBackslash(sTemp);
252         strcat(sTemp,lpszFile);
253         strcpy(szDest,sTemp);
254         return szDest;
255 }
256
257 /*************************************************************************
258  * PathIsUNC [SHELL32.39]
259  * 
260  * NOTES
261  *     PathIsUNC(char*path);
262  */
263 BOOL32 WINAPI PathIsUNC(LPCSTR path) {
264   TRACE(shell,"%s\n",path);
265         if ((path[0]=='\\') && (path[1]=='\\'))
266                 return TRUE;
267         return FALSE;
268 }
269 /*************************************************************************
270  *  PathIsExe [SHELL32.43]
271  * 
272  */
273 BOOL32 WINAPI PathIsExe (LPCSTR path)
274 {  TRACE(shell,"path=%s\n",path);
275     return FALSE;
276 }
277
278 /*************************************************************************
279  * PathFileExists [SHELL32.45]
280  * 
281  * NOTES
282  *     file_exists(char *fn);
283  */
284 BOOL32 WINAPI PathFileExists(LPSTR fn) {
285   TRACE(shell,"%s\n",fn);
286    if (GetFileAttributes32A(fn)==-1)
287         return FALSE;
288     else
289         return TRUE;
290 }
291 /*************************************************************************
292  * PathMatchSpec [SHELL32.46]
293  * 
294  * NOTES
295  *     used from COMDLG32
296  */
297
298 BOOL32 WINAPI PathMatchSpec(LPSTR x, LPSTR y) 
299 {       FIXME(shell,"%s %s stub\n",x,y);
300         return TRUE;
301 }
302
303 /*************************************************************************
304  * PathResolve [SHELL32.51]
305  */
306 DWORD WINAPI PathResolve(LPCSTR s,DWORD x2,DWORD x3) {
307         FIXME(shell,"(%s,0x%08lx,0x%08lx),stub!\n",s,x2,x3);
308         return 0;
309 }
310
311 /*************************************************************************
312  * PathGetArgs [SHELL32.52]
313  *
314  * NOTES
315  *     look for next arg in string. handle "quoted" strings
316  *     returns pointer to argument *AFTER* the space. Or to the \0.
317  */
318 LPSTR WINAPI PathGetArgs(LPSTR cmdline) {
319     BOOL32      qflag = FALSE;
320   TRACE(shell,"%s\n",cmdline);
321     while (*cmdline) {
322         if ((*cmdline==' ') && !qflag)
323                 return cmdline+1;
324         if (*cmdline=='"')
325                 qflag=!qflag;
326         cmdline++;
327     }
328     return cmdline;
329 }
330
331 /*************************************************************************
332  * PathUnquoteSpaces [SHELL32.56]
333  * 
334  * NOTES
335  *     unquote string (remove ")
336  */
337 VOID WINAPI PathUnquoteSpaces(LPSTR str) {
338     DWORD      len = lstrlen32A(str);
339     TRACE(shell,"%s\n",str);
340     if (*str!='"') return;
341     if (str[len-1]!='"') return;
342     str[len-1]='\0';
343     lstrcpy32A(str,str+1);
344     return;
345 }
346
347 /*************************************************************************
348  * ParseField [SHELL32.58]
349  *
350  */
351 DWORD WINAPI ParseField(LPCSTR src,DWORD x2,LPSTR target,DWORD pathlen) {
352         FIXME(shell,"(%s,0x%08lx,%p,%ld):stub.\n",
353                 src,x2,target,pathlen
354         );
355         if (!src)
356                 return 0;
357         return 0;
358 }
359
360 /*************************************************************************
361  * PickIconDlg [SHELL32.62]
362  * 
363  */
364 DWORD WINAPI PickIconDlg(DWORD x,DWORD y,DWORD z,DWORD a) {
365         FIXME(shell,"(%08lx,%08lx,%08lx,%08lx):stub.\n",x,y,z,a);
366         return 0xffffffff;
367 }
368
369 /*************************************************************************
370  * GetFileNameFromBrowse [SHELL32.63]
371  * 
372  */
373 DWORD WINAPI GetFileNameFromBrowse(HWND32 howner, LPSTR targetbuf, DWORD len, DWORD x, LPCSTR suffix, LPCSTR y, LPCSTR cmd) {
374     FIXME(shell,"(%04x,%p,%ld,%08lx,%s,%s,%s):stub.\n",
375             howner,targetbuf,len,x,suffix,y,cmd
376     );
377     /* puts up a Open Dialog and requests input into targetbuf */
378     /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
379     lstrcpy32A(targetbuf,"x:\\s3.exe");
380     return 1;
381 }
382
383 /*************************************************************************
384  * SHGetSettings [SHELL32.68]
385  * 
386  */
387 DWORD WINAPI SHGetSettings(DWORD x,DWORD y,DWORD z) {
388         FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx):stub.\n",
389                 x,y,z
390         );
391         return 0;
392 }
393
394 /*************************************************************************
395  * Shell_GetCachedImageIndex [SHELL32.72]
396  *
397  */
398 void WINAPI Shell_GetCachedImageIndex(LPSTR x,DWORD y,DWORD z) 
399 { FIXME(shell,"(%s,%08lx,%08lx):stub.\n",x,y,z);
400 }
401
402 /*************************************************************************
403  * SHShellFolderView_Message [SHELL32.73]
404  *
405  * PARAMETERS
406  *  hwndCabinet defines the explorer cabinet window that contains the 
407  *              shellview you need to communicate with
408  *  uMsg        identifying the SFVM enum to perform
409  *  lParam
410  *
411  * NOTES
412  *  Message SFVM_REARRANGE = 1
413  *    This message gets sent when a column gets clicked to instruct the
414  *    shell view to re-sort the item list. lParam identifies the column
415  *    that was clicked.
416  */
417 int WINAPI SHShellFolderView_Message(HWND32 hwndCabinet,UINT32 uMsg,LPARAM lParam)
418 { FIXME(shell,"%04x %08ux %08lx stub\n",hwndCabinet,uMsg,lParam);
419   return 0;
420 }
421
422 /*************************************************************************
423  * PathYetAnotherMakeUniqueName [SHELL32.75]
424  * 
425  * NOTES
426  *     exported by ordinal
427  */
428 BOOL32 WINAPI PathYetAnotherMakeUniqueName(LPDWORD x,LPDWORD y) {
429     FIXME(shell,"(%p,%p):stub.\n",x,y);
430     return TRUE;
431 }
432
433 /*************************************************************************
434  * SHMapPIDLToSystemImageListIndex [SHELL32.77]
435  *
436  * PARAMETERS
437  * x  pointer to an instance of IShellFolder 
438  * 
439  * NOTES
440  *     exported by ordinal
441  *
442  */
443 DWORD WINAPI
444 SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh,DWORD y,DWORD z)
445 { FIXME(shell,"(SF=%p,pidl=%08lx,%08lx):stub.\n",sh,y,z);
446   return 0;
447 }
448
449 /*************************************************************************
450  * OleStrToStrN  [SHELL32.78]
451  * 
452  * NOTES
453  *     exported by ordinal
454  * FIXME
455  *  wrong implemented OleStr is NOT wide string !!!! (jsch)
456  */
457 BOOL32 WINAPI
458 OleStrToStrN (LPSTR lpMulti, INT32 nMulti, LPCWSTR lpWide, INT32 nWide) {
459     return WideCharToMultiByte (0, 0, lpWide, nWide,
460         lpMulti, nMulti, NULL, NULL);
461 }
462
463 /*************************************************************************
464  * StrToOleStrN  [SHELL32.79]
465  *
466  * NOTES
467  *     exported by ordinal
468  * FIXME
469  *  wrong implemented OleStr is NOT wide string !!!! (jsch)
470 */
471 BOOL32 WINAPI
472 StrToOleStrN (LPWSTR lpWide, INT32 nWide, LPCSTR lpMulti, INT32 nMulti) {
473     return MultiByteToWideChar (0, 0, lpMulti, nMulti, lpWide, nWide);
474 }
475
476 /*************************************************************************
477  * SHCloneSpecialIDList [SHELL32.89]
478  * 
479  * PARAMETERS
480  *  hwndOwner   [in] 
481  *  nFolder     [in]    CSIDL_xxxxx ??
482  *
483  * RETURNS
484  *  pidl ??
485  * NOTES
486  *     exported by ordinal
487  */
488 LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND32 hwndOwner,DWORD nFolder,DWORD x3)
489 {       LPITEMIDLIST ppidl;
490         WARN(shell,"(hwnd=0x%x,csidl=0x%lx,0x%lx):semi-stub.\n",
491                                          hwndOwner,nFolder,x3);
492
493         SHGetSpecialFolderLocation(hwndOwner, nFolder, &ppidl);
494
495         return ppidl;
496 }
497
498 /*************************************************************************
499  * IsLFNDrive [SHELL32.119]
500  * 
501  * NOTES
502  *     exported by ordinal Name
503  */
504 BOOL32 WINAPI IsLFNDrive(LPCSTR path) {
505     DWORD       fnlen;
506
507     if (!GetVolumeInformation32A(path,NULL,0,NULL,&fnlen,NULL,NULL,0))
508         return FALSE;
509     return fnlen>12;
510 }
511
512 /*************************************************************************
513  * SHGetSpecialFolderPath [SHELL32.175]
514  * 
515  * NOTES
516  *     exported by ordinal
517  */
518 void WINAPI SHGetSpecialFolderPath(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
519     FIXME(shell,"(0x%04lx,0x%04lx,csidl=0x%04lx,0x%04lx):stub.\n",
520       x1,x2,x3,x4
521     );
522 }
523
524 /*************************************************************************
525  * RegisterShellHook [SHELL32.181]
526  *
527  * PARAMS
528  *      hwnd [I]  window handle
529  *      y    [I]  flag ????
530  * 
531  * NOTES
532  *     exported by ordinal
533  */
534 void WINAPI RegisterShellHook32(HWND32 hwnd, DWORD y) {
535     FIXME(shell,"(0x%08x,0x%08lx):stub.\n",hwnd,y);
536 }
537
538 /*************************************************************************
539  * ShellMessageBoxA [SHELL32.183]
540  *
541  * Format and output errormessage.
542  *
543  * NOTES
544  *     exported by ordinal
545  */
546 void __cdecl
547 ShellMessageBoxA(HMODULE32 hmod,HWND32 hwnd,DWORD id,DWORD x,DWORD type,LPVOID arglist) {
548         char    buf[100],buf2[100]/*,*buf3*/;
549 /*      LPVOID  args = &arglist;*/
550
551         if (!LoadString32A(hmod,x,buf,100))
552                 strcpy(buf,"Desktop");
553 //      LoadString32A(hmod,id,buf2,100);
554         /* FIXME: the varargs handling doesn't. */
555 //      FormatMessage32A(0x500,buf2,0,0,(LPSTR)&buf3,256,(LPDWORD)&args);
556
557         FIXME(shell,"(%08lx,%08lx,%08lx(%s),%08lx(%s),%08lx,%p):stub.\n",
558                 (DWORD)hmod,(DWORD)hwnd,id,buf2,x,buf,type,arglist
559         );
560         /*MessageBox32A(hwnd,buf3,buf,id|0x10000);*/
561 }
562
563 /*************************************************************************
564  * SHRestricted [SHELL32.100]
565  *
566  * walks through policy table, queries <app> key, <type> value, returns 
567  * queried (DWORD) value.
568  * {0x00001,Explorer,NoRun}
569  * {0x00002,Explorer,NoClose}
570  * {0x00004,Explorer,NoSaveSettings}
571  * {0x00008,Explorer,NoFileMenu}
572  * {0x00010,Explorer,NoSetFolders}
573  * {0x00020,Explorer,NoSetTaskbar}
574  * {0x00040,Explorer,NoDesktop}
575  * {0x00080,Explorer,NoFind}
576  * {0x00100,Explorer,NoDrives}
577  * {0x00200,Explorer,NoDriveAutoRun}
578  * {0x00400,Explorer,NoDriveTypeAutoRun}
579  * {0x00800,Explorer,NoNetHood}
580  * {0x01000,Explorer,NoStartBanner}
581  * {0x02000,Explorer,RestrictRun}
582  * {0x04000,Explorer,NoPrinterTabs}
583  * {0x08000,Explorer,NoDeletePrinter}
584  * {0x10000,Explorer,NoAddPrinter}
585  * {0x20000,Explorer,NoStartMenuSubFolders}
586  * {0x40000,Explorer,MyDocsOnNet}
587  * {0x80000,WinOldApp,NoRealMode}
588  *
589  * NOTES
590  *     exported by ordinal
591  */
592 DWORD WINAPI SHRestricted (DWORD pol) {
593         HKEY    xhkey;
594
595         FIXME(shell,"(%08lx):stub.\n",pol);
596         if (RegOpenKey32A(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies",&xhkey))
597                 return 0;
598         /* FIXME: do nothing for now, just return 0 (== "allowed") */
599         RegCloseKey(xhkey);
600         return 0;
601 }
602
603 /*************************************************************************
604  * PathGetExtension [SHELL32.158]
605  *
606  * NOTES
607  *     exported by ordinal
608  */
609 LPSTR WINAPI PathGetExtension(LPSTR path,DWORD y,DWORD z)
610 { TRACE(shell,"(%s,%08lx,%08lx)\n",path,y,z);
611     path = PathFindExtension(path);
612     return *path?(path+1):path;
613 }
614
615 /*************************************************************************
616  * SHCreateDirectory [SHELL32.165]
617  *
618  * NOTES
619  *  exported by ordinal
620  *  not sure about LPSECURITY_ATTRIBUTES
621  */
622 DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) {
623         TRACE(shell,"(%p,%s):stub.\n",sec,path);
624         if (CreateDirectory32A(path,sec))
625                 return TRUE;
626         /* SHChangeNotify(8,1,path,0); */
627         return FALSE;
628 #if 0
629         if (SHELL32_79(path,(LPVOID)x))
630                 return 0;
631         FIXME(shell,"(%08lx,%s):stub.\n",x,path);
632         return 0;
633 #endif
634 }
635
636 /*************************************************************************
637  * SHFree [SHELL32.195]
638  *
639  * NOTES
640  *     free_ptr() - frees memory using IMalloc
641  *     exported by ordinal
642  */
643 DWORD WINAPI SHFree(LPVOID x) {
644   TRACE(shell,"%p\n",x);
645   /*return LocalFree32((HANDLE32)x);*/ /* crashes */
646   return HeapFree(GetProcessHeap(),0,x);
647 }
648
649 /*************************************************************************
650  * SHAlloc [SHELL32.196]
651  *
652  * NOTES
653  *     void *task_alloc(DWORD len), uses SHMalloc allocator
654  *     exported by ordinal
655  */
656 LPVOID WINAPI SHAlloc(DWORD len) {
657  /* void * ret = (LPVOID)LocalAlloc32(len,LMEM_ZEROINIT);*/ /* chrashes */
658  void * ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len);
659   TRACE(shell,"%lu bytes at %p\n",len, ret);
660   return ret;
661 }
662
663 /*************************************************************************
664  * OpenRegStream [SHELL32.85]
665  *
666  * NOTES
667  *     exported by ordinal
668  */
669 DWORD WINAPI OpenRegStream(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
670     FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub.\n",
671         x1,x2,x3,x4
672     );
673     return 0;
674 }
675
676 /*************************************************************************
677  * SHRegisterDragDrop [SHELL32.86]
678  *
679  * NOTES
680  *     exported by ordinal
681  */
682 DWORD WINAPI SHRegisterDragDrop(HWND32 hwnd,DWORD x2) {
683     FIXME (shell, "(0x%08x,0x%08lx):stub.\n", hwnd, x2);
684     return 0;
685 }
686
687 /*************************************************************************
688  * SHRevokeDragDrop [SHELL32.87]
689  *
690  * NOTES
691  *     exported by ordinal
692  */
693 DWORD WINAPI SHRevokeDragDrop(DWORD x) {
694     FIXME(shell,"(0x%08lx):stub.\n",x);
695     return 0;
696 }
697
698 /*************************************************************************
699  * RunFileDlg [SHELL32.61]
700  *
701  * NOTES
702  *     Original name: RunFileDlg (exported by ordinal)
703  */
704 DWORD WINAPI
705 RunFileDlg (HWND32 hwndOwner, DWORD dwParam1, DWORD dwParam2,
706             LPSTR lpszTitle, LPSTR lpszPrompt, UINT32 uFlags)
707 {
708     FIXME (shell,"(0x%08x 0x%lx 0x%lx \"%s\" \"%s\" 0x%x):stub.\n",
709            hwndOwner, dwParam1, dwParam2, lpszTitle, lpszPrompt, uFlags);
710     return 0;
711 }
712
713 /*************************************************************************
714  * ExitWindowsDialog [SHELL32.60]
715  *
716  * NOTES
717  *     exported by ordinal
718  */
719 DWORD WINAPI
720 ExitWindowsDialog (HWND32 hwndOwner)
721 {
722     FIXME (shell,"(0x%08x):stub.\n", hwndOwner);
723     return 0;
724 }
725
726 /*************************************************************************
727  * ArrangeWindows [SHELL32.184]
728  * 
729  */
730 DWORD WINAPI
731 ArrangeWindows (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3,
732                 DWORD dwParam4, DWORD dwParam5)
733 {
734     FIXME (shell,"(0x%lx 0x%lx 0x%lx 0x%lx 0x%lx):stub.\n",
735            dwParam1, dwParam2, dwParam3, dwParam4, dwParam5);
736     return 0;
737 }
738
739 /*************************************************************************
740  * SHCLSIDFromString [SHELL32.147]
741  *
742  * NOTES
743  *     exported by ordinal
744  */
745 DWORD WINAPI
746 SHCLSIDFromString (DWORD dwParam1, DWORD dwParam2)
747 {
748     FIXME (shell,"(0x%lx 0x%lx):stub.\n", dwParam1, dwParam2);
749     FIXME (shell,"(\"%s\" \"%s\"):stub.\n", (LPSTR)dwParam1, (LPSTR)dwParam2);
750
751     return 0;
752 }
753
754
755 /*************************************************************************
756  * SignalFileOpen [SHELL32.103]
757  *
758  * NOTES
759  *     exported by ordinal
760  */
761 DWORD WINAPI
762 SignalFileOpen (DWORD dwParam1)
763 {
764     FIXME (shell,"(0x%08lx):stub.\n", dwParam1);
765
766     return 0;
767 }
768
769 /*************************************************************************
770  * SHAddToRecentDocs [SHELL32.234]
771  *
772  * PARAMETERS
773  *   uFlags  [IN] SHARD_PATH or SHARD_PIDL
774  *   pv      [IN] string or pidl, NULL clears the list
775  *
776  * NOTES
777  *     exported by name
778  */
779 DWORD WINAPI SHAddToRecentDocs32 (UINT32 uFlags,LPCVOID pv)   
780 { if (SHARD_PIDL==uFlags)
781   { FIXME (shell,"(0x%08x,pidl=%p):stub.\n", uFlags,pv);
782         }
783         else
784         { FIXME (shell,"(0x%08x,%s):stub.\n", uFlags,(char*)pv);
785         }
786   return 0;
787 }
788 /*************************************************************************
789  * SHFileOperation32 [SHELL32.242]
790  *
791  */
792 DWORD WINAPI SHFileOperation32(DWORD x)
793 {       FIXME(shell,"0x%08lx stub\n",x);
794         return 0;
795
796 }
797
798 /*************************************************************************
799  * SHFileOperation32A [SHELL32.243]
800  *
801  * NOTES
802  *     exported by name
803  */
804 DWORD WINAPI SHFileOperation32A (LPSHFILEOPSTRUCT32A lpFileOp)   
805 { FIXME (shell,"(%p):stub.\n", lpFileOp);
806   return 1;
807 }
808 /*************************************************************************
809  * SHFileOperation32W [SHELL32.244]
810  *
811  * NOTES
812  *     exported by name
813  */
814 DWORD WINAPI SHFileOperation32W (LPSHFILEOPSTRUCT32W lpFileOp)   
815 { FIXME (shell,"(%p):stub.\n", lpFileOp);
816   return 1;
817 }
818
819 /*************************************************************************
820  * SHChangeNotify [SHELL32.239]
821  *
822  * NOTES
823  *     exported by name
824  */
825 DWORD WINAPI SHChangeNotify32 (
826     INT32   wEventId,  /* [IN] flags that specifies the event*/
827     UINT32  uFlags,   /* [IN] the meaning of dwItem[1|2]*/
828                 LPCVOID dwItem1,
829                 LPCVOID dwItem2)
830 { FIXME (shell,"(0x%08x,0x%08ux,%p,%p):stub.\n", wEventId,uFlags,dwItem1,dwItem2);
831   return 0;
832 }
833 /*************************************************************************
834  * SHCreateShellFolderViewEx [SHELL32.174]
835  *
836  * NOTES
837  *  see IShellFolder::CreateViewObject
838  */
839 HRESULT WINAPI SHCreateShellFolderViewEx32(
840   LPSHELLVIEWDATA psvcbi, /*[in ] shelltemplate struct*/
841   LPVOID* ppv)            /*[out] IShellView pointer*/
842 { FIXME (shell,"(%p,%p):stub.\n", psvcbi,ppv);
843   return 0;
844 }
845 /*************************************************************************
846  * SHFind_InitMenuPopup [SHELL32.149]
847  *
848  * NOTES
849  *  Registers the menu behind the "Start" button
850  *
851  * PARAMETERS
852  *  hMenu               [in] handel of menu previously created
853  *  hWndParent  [in] parent window
854  *  w                   [in] no pointer
855  *  x                   [in] no pointer
856  */
857 HRESULT WINAPI SHFind_InitMenuPopup (HMENU32 hMenu, HWND32 hWndParent, DWORD w, DWORD x)
858 {       FIXME(shell,"hmenu=0x%08x hwnd=0x%08x 0x%08lx 0x%08lx stub\n",
859                 hMenu,hWndParent,w,x);
860         return 0;
861 }
862 /*************************************************************************
863  * FileMenu_InitMenuPopup [SHELL32.109]
864  *
865  */
866 HRESULT WINAPI FileMenu_InitMenuPopup (DWORD hmenu)
867 {       FIXME(shell,"hmenu=0x%lx stub\n",hmenu);
868         return 0;
869 }
870 /*************************************************************************
871  * FileMenu_Create [SHELL32.114]
872  *
873  * w retval from LoadBitmapA
874  *
875  *
876  */
877 HRESULT WINAPI FileMenu_Create (DWORD u, DWORD v, DWORD w, DWORD x, DWORD z)
878 { FIXME(shell,"0x%08lx 0x%08lx hbmp=0x%lx 0x%08lx 0x%08lx stub\n",u,v,w,x,z);
879   return 0;
880 }
881 /*************************************************************************
882  * FileMenu_TrackPopupMenuEx [SHELL32.116]
883  *
884  * PARAMETERS
885  *  uFlags              [in]    according to TrackPopupMenuEx
886  *  posX                [in]
887  *  posY                [in]
888  *  hWndParent          [in]
889  *  z   could be rect (trace) or TPMPARAMS (TrackPopupMenuEx)
890  */
891 HRESULT WINAPI FileMenu_TrackPopupMenuEx (DWORD t, DWORD uFlags, DWORD posX, DWORD posY, HWND32 hWndParent, DWORD z)
892 {       FIXME(shell,"0x%lx flags=0x%lx posx=0x%lx posy=0x%lx hwndp=0x%x 0x%lx stub\n",
893                 t,uFlags,posX,posY, hWndParent,z);
894         return 0;
895 }
896 /*************************************************************************
897  *  SHWinHelp [SHELL32.127]
898  *
899  */
900 HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
901 {       FIXME(shell,"0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
902         return 0;
903 }
904 /*************************************************************************
905  *  SHRunControlPanel [SHELL32.161]
906  *
907  */
908 HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
909 {       FIXME(shell,"0x%08lx 0x%08lx stub\n",x,z);
910         return 0;
911 }
912 /*************************************************************************
913  * ShellExecuteEx [SHELL32.291]
914  *
915  */
916 BOOL32 WINAPI ShellExecuteEx32A (LPSHELLEXECUTEINFO32A sei)
917 {       CHAR szTemp[MAX_PATH];
918
919         FIXME(shell,"(%p): stub\n",sei);
920
921         if (sei->fMask & SEE_MASK_IDLIST)
922         { SHGetPathFromIDList32A (sei->lpIDList,szTemp);
923           TRACE (shell,"-- idlist=%p (%s)\n", sei->lpIDList, szTemp);
924         }
925
926         if (sei->fMask & SEE_MASK_CLASSNAME)
927         { TRACE (shell,"-- classname= %s\n", sei->lpClass);
928         }
929     
930         if (sei->lpVerb)
931         { TRACE (shell,"-- action=%s\n", sei->lpVerb);
932         }
933         
934         return 0;
935 }
936 /*************************************************************************
937  * SHSetInstanceExplorer [SHELL32.176]
938  *
939  */
940 HRESULT WINAPI SHSetInstanceExplorer (DWORD u)
941 {       FIXME(shell,"0x%08lx stub\n",u);
942         return 0;
943 }
944 /*************************************************************************
945  * SHGetInstanceExplorer [SHELL32.256]
946  *
947  * NOTES
948  *  exported by name
949  */
950 HRESULT WINAPI SHGetInstanceExplorer (DWORD u)
951 {       FIXME(shell,"0x%08lx stub\n",u);
952         return 0;
953 }
954 /*************************************************************************
955  * SHFreeUnusedLibraries [SHELL32.123]
956  *
957  * NOTES
958  *  exported by name
959  */
960 HRESULT WINAPI SHFreeUnusedLibraries (DWORD u)
961 {       FIXME(shell,"0x%08lx stub\n",u);
962         return 0;
963 }
964 /*************************************************************************
965  * DAD_ShowDragImage [SHELL32.137]
966  *
967  * NOTES
968  *  exported by name
969  */
970 HRESULT WINAPI DAD_ShowDragImage (DWORD u)
971 { FIXME(shell,"0x%08lx stub\n",u);
972   return 0;
973 }
974 /*************************************************************************
975  * FileMenu_Destroy [SHELL32.118]
976  *
977  * NOTES
978  *  exported by name
979  */
980 HRESULT WINAPI FileMenu_Destroy (DWORD u)
981 { FIXME(shell,"0x%08lx stub\n",u);
982   return 0;
983 }
984 /*************************************************************************
985  * SHGetDataFromIDListA [SHELL32.247]
986  *
987  */
988 HRESULT WINAPI SHGetDataFromIDListA(DWORD u, DWORD v, DWORD w, DWORD x, DWORD y)
989 {       FIXME(shell,"0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w,x,y);
990         return 0;
991 }
992 /*************************************************************************
993  * SHRegCloseKey32 [NT4.0:SHELL32.505]
994  *
995  */
996 HRESULT WINAPI SHRegCloseKey32 (HKEY hkey)
997 {       TRACE(shell,"0x%04x\n",hkey);
998         return RegCloseKey( hkey );
999 }
1000 /*************************************************************************
1001  * SHRegOpenKey32A [SHELL32.506]
1002  *
1003  */
1004 HRESULT WINAPI SHRegOpenKey32A(HKEY hKey, LPSTR lpSubKey, LPHKEY phkResult)
1005 {       FIXME(shell,"(0x%08x, %s, %p)\n", hKey, debugstr_a(lpSubKey),
1006               phkResult);
1007         return RegOpenKey32A(hKey, lpSubKey, phkResult);
1008 }
1009
1010 /*************************************************************************
1011  * SHRegOpenKey32W [NT4.0:SHELL32.507]
1012  *
1013  */
1014 HRESULT WINAPI SHRegOpenKey32W (HKEY hkey, LPCWSTR lpszSubKey, LPHKEY retkey)
1015 {       WARN(shell,"0x%04x %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
1016         return RegOpenKey32W( hkey, lpszSubKey, retkey );
1017 }
1018 /*************************************************************************
1019  * SHRegQueryValueExA [SHELL32.509]
1020  *
1021  */
1022 HRESULT WINAPI SHRegQueryValueEx32A(DWORD u, LPSTR v, DWORD w, DWORD x,
1023                                   DWORD y, DWORD z)
1024 {       FIXME(shell,"0x%04lx %s 0x%04lx 0x%04lx 0x%04lx  0x%04lx stub\n",
1025                 u,debugstr_a(v),w,x,y,z);
1026         return 0;
1027 }
1028 /*************************************************************************
1029  * SHRegQueryValue32W [NT4.0:SHELL32.510]
1030  *
1031  */
1032 HRESULT WINAPI SHRegQueryValue32W (HKEY hkey, LPWSTR lpszSubKey,
1033                                  LPWSTR lpszData, LPDWORD lpcbData )
1034 {       WARN(shell,"0x%04x %s %p %p semi-stub\n",
1035                 hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
1036         return RegQueryValue32W( hkey, lpszSubKey, lpszData, lpcbData );
1037 }
1038
1039 /*************************************************************************
1040  * SHRegQueryValueEx32W [NT4.0:SHELL32.511]
1041  *
1042  * FIXME 
1043  *  if the datatype REG_EXPAND_SZ then expand the string and change
1044  *  *pdwType to REG_SZ. 
1045  */
1046 HRESULT WINAPI SHRegQueryValueEx32W (HKEY hkey, LPWSTR pszValue, LPDWORD pdwReserved,
1047                  LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData)
1048 {       DWORD ret;
1049         WARN(shell,"0x%04x %s %p %p %p %p semi-stub\n",
1050                 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
1051         ret = RegQueryValueEx32W ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
1052         return ret;
1053 }
1054
1055 /*************************************************************************
1056  * ReadCabinetState [NT 4.0:SHELL32.651]
1057  *
1058  */
1059 HRESULT WINAPI ReadCabinetState(DWORD u, DWORD v)
1060 {       FIXME(shell,"0x%04lx 0x%04lx stub\n",u,v);
1061         return 0;
1062 }
1063 /*************************************************************************
1064  * WriteCabinetState [NT 4.0:SHELL32.652]
1065  *
1066  */
1067 HRESULT WINAPI WriteCabinetState(DWORD u)
1068 {       FIXME(shell,"0x%04lx stub\n",u);
1069         return 0;
1070 }
1071 /*************************************************************************
1072  * FileIconInit [SHELL32.660]
1073  *
1074  */
1075 BOOL32 WINAPI FileIconInit(BOOL32 bFullInit)
1076 {       FIXME(shell,"(%s)\n", bFullInit ? "true" : "false");
1077         return 0;
1078 }
1079 /*************************************************************************
1080  * IsUserAdmin [NT 4.0:SHELL32.680]
1081  *
1082  */
1083 HRESULT WINAPI IsUserAdmin()
1084 {       FIXME(shell,"stub\n");
1085         return TRUE;
1086 }
1087 /*************************************************************************
1088  * StrRetToStrN [SHELL32.96]
1089  * 
1090  * converts a STRRET to a normal string
1091  *
1092  * NOTES
1093  *  FIXME the string handling is to simple (different STRRET choices)
1094  *  at the moment only CSTR
1095  *  the pidl is for STRRET OFFSET
1096  */
1097 HRESULT WINAPI StrRetToStrN (LPSTR dest, DWORD len, LPSTRRET src, LPITEMIDLIST x)
1098 {       FIXME(shell,"dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,x);
1099         strncpy(dest,src->u.cStr,len);
1100         return S_OK;
1101 }
1102
1103 /*************************************************************************
1104  * StrChrW [NT 4.0:SHELL32.651]
1105  *
1106  */
1107 HRESULT WINAPI StrChrW (LPWSTR u, DWORD v)
1108 {       FIXME(shell,"%s 0x%lx stub\n",debugstr_w(u),v);
1109         return 0;
1110 }
1111 /*************************************************************************
1112  * SHAllocShared [SHELL32.520]
1113  *
1114  * NOTES
1115  *  parameter1 is return value from HeapAlloc
1116  *  parameter2 is equal to the size allocated with HeapAlloc
1117  *  parameter3 is return value from GetCurrentProcessId
1118  *
1119  *  the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
1120  *  WM_USER+2 could be the undocumented CWM_SETPATH
1121  *  the allocated memory contains a pidl
1122  */
1123 HGLOBAL32 WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
1124 {       HGLOBAL32 hmem;
1125         LPVOID pmem;
1126         
1127         TRACE(shell,"ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID);
1128         hmem = GlobalAlloc32(GMEM_FIXED, size);
1129         if (!hmem)
1130           return 0;
1131         
1132         pmem =  GlobalLock32 (hmem);
1133
1134         if (! pmem)
1135           return 0;
1136           
1137         memcpy (pmem, psrc, size);
1138         GlobalUnlock32(hmem); 
1139         return hmem;
1140 }
1141 /*************************************************************************
1142  * SHLockShared [SHELL32.521]
1143  *
1144  * NOTES
1145  *  parameter1 is return value from SHAllocShared
1146  *  parameter2 is return value from GetCurrentProcessId
1147  *  the receiver of (WM_USER+2) trys to lock the HANDLE (?) 
1148  *  the returnvalue seems to be a memoryadress
1149  */
1150 void * WINAPI SHLockShared(HANDLE32 hmem, DWORD procID)
1151 {       TRACE(shell,"handle=0x%04x procID=0x%04lx\n",hmem,procID);
1152         return GlobalLock32(hmem);
1153 }
1154 /*************************************************************************
1155  * SHUnlockShared [SHELL32.522]
1156  *
1157  * NOTES
1158  *  parameter1 is return value from SHLockShared
1159  */
1160 BOOL32 WINAPI SHUnlockShared(HANDLE32 pmem)
1161 {       TRACE(shell,"handle=0x%04x\n",pmem);
1162         return GlobalUnlock32(pmem); 
1163 }
1164 /*************************************************************************
1165  * SHFreeShared [SHELL32.523]
1166  *
1167  * NOTES
1168  *  parameter1 is return value from SHAllocShared
1169  *  parameter2 is return value from GetCurrentProcessId
1170  */
1171 HANDLE32 WINAPI SHFreeShared(HANDLE32 hmem, DWORD procID)
1172 {       TRACE(shell,"handle=0x%04x 0x%04lx\n",hmem,procID);
1173         return GlobalFree32(hmem);
1174 }
1175
1176 /*************************************************************************
1177  * SetAppStartingCursor32 [SHELL32.99]
1178  *
1179  */
1180 HRESULT WINAPI SetAppStartingCursor32(DWORD u, DWORD v)
1181 {       FIXME(shell,"0x%04lx 0x%04lx stub\n",u,v );
1182         return 0;
1183 }
1184 /*************************************************************************
1185  * SHLoadOLE32 [SHELL32.151]
1186  *
1187  */
1188 HRESULT WINAPI SHLoadOLE32(DWORD u)
1189 {       FIXME(shell,"0x%04lx stub\n",u);
1190         return S_OK;
1191 }
1192 /*************************************************************************
1193  * Shell_MergeMenus32 [SHELL32.67]
1194  *
1195  */
1196 BOOL32 _SHIsMenuSeparator(HMENU32 hm, int i)
1197 {
1198         MENUITEMINFO32A mii;
1199
1200         mii.cbSize = sizeof(MENUITEMINFO32A);
1201         mii.fMask = MIIM_TYPE;
1202         mii.cch = 0;    /* WARNING: We MUST initialize it to 0*/
1203         if (!GetMenuItemInfo32A(hm, i, TRUE, &mii))
1204         { return(FALSE);
1205         }
1206
1207         if (mii.fType & MFT_SEPARATOR)
1208         { return(TRUE);
1209         }
1210
1211         return(FALSE);
1212 }
1213 #define MM_ADDSEPARATOR         0x00000001L
1214 #define MM_SUBMENUSHAVEIDS      0x00000002L
1215 HRESULT WINAPI Shell_MergeMenus32 (HMENU32 hmDst, HMENU32 hmSrc, UINT32 uInsert, UINT32 uIDAdjust, UINT32 uIDAdjustMax, ULONG uFlags)
1216 {       int             nItem;
1217         HMENU32         hmSubMenu;
1218         BOOL32          bAlreadySeparated;
1219         MENUITEMINFO32A miiSrc;
1220         char            szName[256];
1221         UINT32          uTemp, uIDMax = uIDAdjust;
1222
1223         FIXME(shell,"hmenu1=0x%04x hmenu2=0x%04x 0x%04x 0x%04x 0x%04x  0x%04lx stub\n",
1224                  hmDst, hmSrc, uInsert, uIDAdjust, uIDAdjustMax, uFlags);
1225
1226         if (!hmDst || !hmSrc)
1227         { return uIDMax;
1228         }
1229
1230         nItem = GetMenuItemCount32(hmDst);
1231         if (uInsert >= (UINT32)nItem)
1232         { uInsert = (UINT32)nItem;
1233           bAlreadySeparated = TRUE;
1234         }
1235         else
1236         { bAlreadySeparated = _SHIsMenuSeparator(hmDst, uInsert);;
1237         }
1238         if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
1239         { /* Add a separator between the menus */
1240           InsertMenu32A(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
1241           bAlreadySeparated = TRUE;
1242         }
1243
1244
1245         /* Go through the menu items and clone them*/
1246         for (nItem = GetMenuItemCount32(hmSrc) - 1; nItem >= 0; nItem--)
1247         { miiSrc.cbSize = sizeof(MENUITEMINFO32A);
1248           miiSrc.fMask = MIIM_STATE | MIIM_ID | MIIM_SUBMENU | MIIM_CHECKMARKS | MIIM_TYPE | MIIM_DATA;
1249           /* We need to reset this every time through the loop in case
1250           menus DON'T have IDs*/
1251           miiSrc.fType = MFT_STRING;
1252           miiSrc.dwTypeData = szName;
1253           miiSrc.dwItemData = 0;
1254           miiSrc.cch = sizeof(szName);
1255
1256           if (!GetMenuItemInfo32A(hmSrc, nItem, TRUE, &miiSrc))
1257           { continue;
1258           }
1259           if (miiSrc.fType & MFT_SEPARATOR)
1260           { /* This is a separator; don't put two of them in a row*/
1261             if (bAlreadySeparated)
1262             { continue;
1263             }
1264             bAlreadySeparated = TRUE;
1265           }
1266           else if (miiSrc.hSubMenu)
1267           { if (uFlags & MM_SUBMENUSHAVEIDS)
1268             { /* Adjust the ID and check it*/
1269               miiSrc.wID += uIDAdjust;
1270               if (miiSrc.wID > uIDAdjustMax)
1271               { continue;
1272               }
1273               if (uIDMax <= miiSrc.wID)
1274               { uIDMax = miiSrc.wID + 1;
1275               }
1276             }
1277             else
1278             { /* Don't set IDs for submenus that didn't have them already */
1279               miiSrc.fMask &= ~MIIM_ID;
1280             }
1281             hmSubMenu = miiSrc.hSubMenu;
1282             miiSrc.hSubMenu = CreatePopupMenu32();
1283             if (!miiSrc.hSubMenu)
1284             { return(uIDMax);
1285             }
1286             uTemp = Shell_MergeMenus32(miiSrc.hSubMenu, hmSubMenu, 0, uIDAdjust, uIDAdjustMax, uFlags&MM_SUBMENUSHAVEIDS);
1287             if (uIDMax <= uTemp)
1288             { uIDMax = uTemp;
1289             }
1290             bAlreadySeparated = FALSE;
1291           }
1292           else
1293           { /* Adjust the ID and check it*/
1294             miiSrc.wID += uIDAdjust;
1295             if (miiSrc.wID > uIDAdjustMax)
1296             { continue;
1297             }
1298             if (uIDMax <= miiSrc.wID)
1299             { uIDMax = miiSrc.wID + 1;
1300             }
1301             bAlreadySeparated = FALSE;
1302           }
1303           if (!InsertMenuItem32A(hmDst, uInsert, TRUE, &miiSrc))
1304           { return(uIDMax);
1305           }
1306         }
1307
1308         /* Ensure the correct number of separators at the beginning of the
1309         inserted menu items*/
1310         if (uInsert == 0)
1311         { if (bAlreadySeparated)
1312           { DeleteMenu32(hmDst, uInsert, MF_BYPOSITION);
1313           }
1314         }
1315         else
1316         { if (_SHIsMenuSeparator(hmDst, uInsert-1))
1317           { if (bAlreadySeparated)
1318             { DeleteMenu32(hmDst, uInsert, MF_BYPOSITION);
1319             }
1320           }
1321           else
1322           { if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
1323             { /* Add a separator between the menus*/
1324               InsertMenu32A(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
1325             }
1326           }
1327         }
1328         return(uIDMax);
1329
1330 }
1331 /*************************************************************************
1332  * PathGetDriveNumber32 [SHELL32.57]
1333  *
1334  */
1335 HRESULT WINAPI PathGetDriveNumber32(LPSTR u)
1336 {       FIXME(shell,"%s stub\n",debugstr_a(u));
1337         return 0;
1338 }
1339 /*************************************************************************
1340  * DriveType32 [SHELL32.64]
1341  *
1342  */
1343 HRESULT WINAPI DriveType32(DWORD u)
1344 {       FIXME(shell,"0x%04lx stub\n",u);
1345         return 0;
1346 }
1347 /*************************************************************************
1348  * SHAbortInvokeCommand [SHELL32.198]
1349  *
1350  */
1351 HRESULT WINAPI SHAbortInvokeCommand()
1352 {       FIXME(shell,"stub\n");
1353         return 1;
1354 }
1355 /*************************************************************************
1356  * SHOutOfMemoryMessageBox [SHELL32.126]
1357  *
1358  */
1359 HRESULT WINAPI SHOutOfMemoryMessageBox(DWORD u, DWORD v, DWORD w)
1360 {       FIXME(shell,"0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w);
1361         return 0;
1362 }
1363 /*************************************************************************
1364  * SHFlushClipboard [SHELL32.121]
1365  *
1366  */
1367 HRESULT WINAPI SHFlushClipboard()
1368 {       FIXME(shell,"stub\n");
1369         return 1;
1370 }