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