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