Like the AUTORADIOBUTTON, the parent of a RADIOBUTTON style button
[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 <stdio.h>
10 #include "winerror.h"
11 #include "winreg.h"
12 #include "debugtools.h"
13 #include "winnls.h"
14 #include "winversion.h"
15 #include "heap.h"
16 #include "crtdll.h"
17
18 #include "shellapi.h"
19 #include "shlobj.h"
20 #include "shell32_main.h"
21 #include "wine/undocshell.h"
22
23 DEFAULT_DEBUG_CHANNEL(shell);
24
25 /*************************************************************************
26  * ParseFieldA                                  [internal]
27  *
28  * copys a field from a ',' delimited string
29  * 
30  * first field is nField = 1
31  */
32 DWORD WINAPI ParseFieldA(
33         LPCSTR src,
34         DWORD nField,
35         LPSTR dst,
36         DWORD len) 
37 {
38         WARN("('%s',0x%08lx,%p,%ld) semi-stub.\n",src,nField,dst,len);
39
40         if (!src || !src[0] || !dst || !len)
41           return 0;
42
43         /* skip n fields delimited by ',' */
44         while (nField > 1)
45         {
46           if (*src=='\0') return FALSE;
47           if (*(src++)==',') nField--;
48         }
49
50         /* copy part till the next ',' to dst */
51         while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
52         
53         /* finalize the string */
54         *dst=0x0;
55         
56         return TRUE;
57 }
58
59 /*************************************************************************
60  * ParseFieldW                  [internal]
61  *
62  * copys a field from a ',' delimited string
63  * 
64  * first field is nField = 1
65  */
66 DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) 
67 {
68         FIXME("('%s',0x%08lx,%p,%ld) stub.\n",
69           debugstr_w(src), nField, dst, len);
70         return FALSE;
71 }
72
73 /*************************************************************************
74  * ParseFieldAW                 [SHELL32.58]
75  */
76 DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len) 
77 {
78         if (VERSION_OsIsUnicode())
79           return ParseFieldW(src, nField, dst, len);
80         return ParseFieldA(src, nField, dst, len);
81 }
82
83 /*************************************************************************
84  * GetFileNameFromBrowse                        [SHELL32.63]
85  * 
86  */
87 BOOL WINAPI GetFileNameFromBrowse(
88         HWND hwndOwner,
89         LPSTR lpstrFile,
90         DWORD nMaxFile,
91         LPCSTR lpstrInitialDir,
92         LPCSTR lpstrDefExt,
93         LPCSTR lpstrFilter,
94         LPCSTR lpstrTitle)
95 {
96         FIXME("(%04x,%s,%ld,%s,%s,%s,%s):stub.\n",
97           hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt,
98           lpstrFilter, lpstrTitle);
99
100     /* puts up a Open Dialog and requests input into targetbuf */
101     /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
102     lstrcpyA(lpstrFile,"x:\\dummy.exe");
103     return 1;
104 }
105
106 /*************************************************************************
107  * SHGetSettings                                [SHELL32.68]
108  * 
109  * NOTES
110  *  the registry path are for win98 (tested)
111  *  and possibly are the same in nt40
112  */
113 void WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask, DWORD dwx)
114 {
115         HKEY    hKey;
116         DWORD   dwData;
117         DWORD   dwDataSize = sizeof (DWORD);
118
119         TRACE("(%p 0x%08lx 0x%08lx)\n",lpsfs,dwMask, dwx);
120         
121         if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
122                                  0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
123           return;
124         
125         if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
126           lpsfs->fShowExtensions  = ((dwData == 0) ?  0 : 1);
127
128         if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
129           lpsfs->fShowInfoTip  = ((dwData == 0) ?  0 : 1);
130
131         if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
132           lpsfs->fDontPrettyPath  = ((dwData == 0) ?  0 : 1);
133
134         if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
135           lpsfs->fHideIcons  = ((dwData == 0) ?  0 : 1);
136
137         if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
138           lpsfs->fMapNetDrvBtn  = ((dwData == 0) ?  0 : 1);
139
140         if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
141           lpsfs->fShowAttribCol  = ((dwData == 0) ?  0 : 1);
142
143         if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
144         { if (dwData == 0)
145           { if (SSF_SHOWALLOBJECTS & dwMask)    lpsfs->fShowAllObjects  = 0;
146             if (SSF_SHOWSYSFILES & dwMask)      lpsfs->fShowSysFiles  = 0;
147           }
148           else if (dwData == 1)
149           { if (SSF_SHOWALLOBJECTS & dwMask)    lpsfs->fShowAllObjects  = 1;
150             if (SSF_SHOWSYSFILES & dwMask)      lpsfs->fShowSysFiles  = 0;
151           }
152           else if (dwData == 2)
153           { if (SSF_SHOWALLOBJECTS & dwMask)    lpsfs->fShowAllObjects  = 0;
154             if (SSF_SHOWSYSFILES & dwMask)      lpsfs->fShowSysFiles  = 1;
155           }
156         }
157         RegCloseKey (hKey);
158
159         TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
160 }
161
162 /*************************************************************************
163  * SHShellFolderView_Message                    [SHELL32.73]
164  *
165  * PARAMETERS
166  *  hwndCabinet defines the explorer cabinet window that contains the 
167  *              shellview you need to communicate with
168  *  uMsg        identifying the SFVM enum to perform
169  *  lParam
170  *
171  * NOTES
172  *  Message SFVM_REARRANGE = 1
173  *    This message gets sent when a column gets clicked to instruct the
174  *    shell view to re-sort the item list. lParam identifies the column
175  *    that was clicked.
176  */
177 int WINAPI SHShellFolderView_Message(
178         HWND hwndCabinet, 
179         DWORD dwMessage,
180         DWORD dwParam)
181 {
182         FIXME("%04x %08lx %08lx stub\n",hwndCabinet, dwMessage, dwParam);
183         return 0;
184 }
185
186 /*************************************************************************
187  * OleStrToStrN                                 [SHELL32.78]
188  */
189 BOOL WINAPI OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle) 
190 {
191         TRACE("(%p, %x, %s, %x)\n", lpStr, nStr, debugstr_wn(lpOle,nOle), nOle);
192         return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL);
193 }
194
195 BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle) 
196 {
197         TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle);
198
199         if (lstrcpynW ( lpwStr, lpOle, nwStr))
200         { return lstrlenW (lpwStr);
201         }
202         return 0;
203 }
204
205 BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn) 
206 {
207         if (VERSION_OsIsUnicode())
208           return OleStrToStrNW (lpOut, nOut, lpIn, nIn);
209         return OleStrToStrNA (lpOut, nOut, lpIn, nIn);
210 }
211
212 /*************************************************************************
213  * StrToOleStrN                                 [SHELL32.79]
214  *  lpMulti, nMulti, nWide [IN]
215  *  lpWide [OUT]
216  */
217 BOOL WINAPI StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr) 
218 {
219         TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_an(lpStrA,nStr), nStr);
220         return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide);
221 }
222 BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr) 
223 {
224         TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr);
225
226         if (lstrcpynW (lpWide, lpStrW, nWide))
227         { return lstrlenW (lpWide);
228         }
229         return 0;
230 }
231
232 BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr) 
233 {
234         if (VERSION_OsIsUnicode())
235           return StrToOleStrNW (lpWide, nWide, lpStr, nStr);
236         return StrToOleStrNA (lpWide, nWide, lpStr, nStr);
237 }
238
239 /*************************************************************************
240  * RegisterShellHook                            [SHELL32.181]
241  *
242  * PARAMS
243  *      hwnd [I]  window handle
244  *      y    [I]  flag ????
245  * 
246  * NOTES
247  *     exported by ordinal
248  */
249 BOOL WINAPI RegisterShellHook(
250         HWND hWnd,
251         DWORD dwType)
252 {
253         FIXME("(0x%08x,0x%08lx):stub.\n",hWnd, dwType);
254         return TRUE;
255 }
256 /*************************************************************************
257  * ShellMessageBoxW                             [SHELL32.182]
258  *
259  * Format and output errormessage.
260  *
261  * idText       resource ID of title or LPSTR
262  * idTitle      resource ID of title or LPSTR
263  *
264  * NOTES
265  *     exported by ordinal
266  */
267 int WINAPIV ShellMessageBoxW(
268         HINSTANCE hInstance,
269         HWND hWnd,
270         LPCWSTR lpText,
271         LPCWSTR lpCaption,
272         UINT uType,
273         ...)
274 {
275         WCHAR   szText[100],szTitle[100],szTemp[256];
276         LPCWSTR   pszText = szText, pszTitle = szTitle;
277         va_list args;
278         va_start(args, uType);
279         /* wvsprintfA(buf,fmt, args); */
280
281         TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
282         (DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
283
284         if (!HIWORD(lpCaption))
285           LoadStringW(hInstance, (DWORD)lpCaption, szTitle, 100);
286         else
287           pszTitle = lpCaption;
288
289         if (!HIWORD(lpText))
290           LoadStringW(hInstance, (DWORD)lpText, szText, 100);
291         else
292           pszText = lpText;
293
294         FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY,
295                        szText, 0, 0, szTemp, 256, (LPDWORD) args);
296
297         va_end(args);
298
299         return MessageBoxW(hWnd,szTemp,szTitle,uType);
300 }
301
302 /*************************************************************************
303  * ShellMessageBoxA                             [SHELL32.183]
304  */
305 int WINAPIV ShellMessageBoxA(
306         HINSTANCE hInstance,
307         HWND hWnd,
308         LPCSTR lpText,
309         LPCSTR lpCaption,
310         UINT uType,
311         ...)
312 {
313         char    szText[100],szTitle[100],szTemp[256];
314         LPCSTR   pszText = szText, pszTitle = szTitle;
315         va_list args;
316         va_start(args, uType);
317         /* wvsprintfA(buf,fmt, args); */
318
319         TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
320         (DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
321
322         if (!HIWORD(lpCaption))
323           LoadStringA(hInstance, (DWORD)lpCaption, szTitle, 100);
324         else
325           pszTitle = lpCaption;
326
327         if (!HIWORD(lpText))
328           LoadStringA(hInstance, (DWORD)lpText, szText, 100);
329         else
330           pszText = lpText;
331
332         FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY,
333                        szText, 0, 0, szTemp, 256, (LPDWORD) args);
334
335         va_end(args);
336
337         return MessageBoxA(hWnd,szTemp,szTitle,uType);
338 }
339
340 /*************************************************************************
341  * SHFree                                       [SHELL32.195]
342  *
343  * NOTES
344  *     free_ptr() - frees memory using IMalloc
345  *     exported by ordinal
346  */
347 #define MEM_DEBUG 1
348 void WINAPI SHFree(LPVOID x) 
349 {
350 #if MEM_DEBUG
351         WORD len = *(LPWORD)((LPBYTE)x-2);
352
353         if ( *(LPWORD)((LPBYTE)x+len) != 0x7384)
354           ERR("MAGIC2!\n");
355
356         if ( (*(LPWORD)((LPBYTE)x-4)) != 0x8271)
357           ERR("MAGIC1!\n");
358         else
359           memset((LPBYTE)x-4, 0xde, len+6);
360
361         TRACE("%p len=%u\n",x, len);
362
363         x = (LPBYTE) x - 4;
364 #else
365         TRACE("%p\n",x);
366 #endif
367         HeapFree(GetProcessHeap(), 0, x);
368 }
369
370 /*************************************************************************
371  * SHAlloc                                      [SHELL32.196]
372  *
373  * NOTES
374  *     void *task_alloc(DWORD len), uses SHMalloc allocator
375  *     exported by ordinal
376  */
377 LPVOID WINAPI SHAlloc(DWORD len) 
378 {
379         LPBYTE ret;
380
381 #if MEM_DEBUG
382         ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len+6);
383 #else
384         ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len);
385 #endif
386
387 #if MEM_DEBUG
388         *(LPWORD)(ret) = 0x8271;
389         *(LPWORD)(ret+2) = (WORD)len;
390         *(LPWORD)(ret+4+len) = 0x7384;
391         ret += 4;
392         memset(ret, 0xdf, len);
393 #endif
394         TRACE("%lu bytes at %p\n",len, ret);
395         return (LPVOID)ret;
396 }
397
398 /*************************************************************************
399  * SHRegisterDragDrop                           [SHELL32.86]
400  *
401  * NOTES
402  *     exported by ordinal
403  */
404 HRESULT WINAPI SHRegisterDragDrop(
405         HWND hWnd,
406         LPDROPTARGET pDropTarget)
407 {
408         FIXME("(0x%08x,%p):stub.\n", hWnd, pDropTarget);
409         if (GetShellOle()) return pRegisterDragDrop(hWnd, pDropTarget);
410         return 0;
411 }
412
413 /*************************************************************************
414  * SHRevokeDragDrop                             [SHELL32.87]
415  *
416  * NOTES
417  *     exported by ordinal
418  */
419 HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
420 {
421     FIXME("(0x%08x):stub.\n",hWnd);
422     return 0;
423 }
424
425 /*************************************************************************
426  * SHDoDragDrop                                 [SHELL32.88]
427  *
428  * NOTES
429  *     exported by ordinal
430  */
431 HRESULT WINAPI SHDoDragDrop(
432         HWND hWnd,
433         LPDATAOBJECT lpDataObject,
434         LPDROPSOURCE lpDropSource,
435         DWORD dwOKEffect,
436         LPDWORD pdwEffect)
437 {
438     FIXME("(0x%04x %p %p 0x%08lx %p):stub.\n",
439     hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
440     return 0;
441 }
442
443 /*************************************************************************
444  * ArrangeWindows                               [SHELL32.184]
445  * 
446  */
447 WORD WINAPI ArrangeWindows(
448         HWND hwndParent,
449         DWORD dwReserved,
450         LPCRECT lpRect,
451         WORD cKids,
452         CONST HWND * lpKids)
453 {
454     FIXME("(0x%08x 0x%08lx %p 0x%04x %p):stub.\n",
455            hwndParent, dwReserved, lpRect, cKids, lpKids);
456     return 0;
457 }
458
459 /*************************************************************************
460  * SignalFileOpen                               [SHELL32.103]
461  *
462  * NOTES
463  *     exported by ordinal
464  */
465 DWORD WINAPI
466 SignalFileOpen (DWORD dwParam1)
467 {
468     FIXME("(0x%08lx):stub.\n", dwParam1);
469
470     return 0;
471 }
472
473 /*************************************************************************
474  * SHAddToRecentDocs                            [SHELL32.234]
475  *
476  * PARAMETERS
477  *   uFlags  [IN] SHARD_PATH or SHARD_PIDL
478  *   pv      [IN] string or pidl, NULL clears the list
479  *
480  * NOTES
481  *     exported by name
482  */
483 DWORD WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)   
484 { if (SHARD_PIDL==uFlags)
485   { FIXME("(0x%08x,pidl=%p):stub.\n", uFlags,pv);
486         }
487         else
488         { FIXME("(0x%08x,%s):stub.\n", uFlags,(char*)pv);
489         }
490   return 0;
491 }
492 /*************************************************************************
493  * SHCreateShellFolderViewEx                    [SHELL32.174]
494  *
495  * NOTES
496  *  see IShellFolder::CreateViewObject
497  */
498 HRESULT WINAPI SHCreateShellFolderViewEx(
499         LPCSHELLFOLDERVIEWINFO psvcbi, /*[in ] shelltemplate struct*/
500         LPSHELLVIEW* ppv)              /*[out] IShellView pointer*/
501 {
502         IShellView * psf;
503         HRESULT hRes;
504         
505         TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=0x%08lx\n", 
506           psvcbi->pshf, psvcbi->pidlFolder, psvcbi->lpfnCallback,
507           psvcbi->uViewMode, psvcbi->dwUser);
508
509         psf = IShellView_Constructor(psvcbi->pshf);
510         
511         if (!psf)
512           return E_OUTOFMEMORY;
513
514         IShellView_AddRef(psf);
515         hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
516         IShellView_Release(psf);
517
518         return hRes;
519 }
520 /*************************************************************************
521  *  SHWinHelp                                   [SHELL32.127]
522  *
523  */
524 HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
525 {       FIXME("0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
526         return 0;
527 }
528 /*************************************************************************
529  *  SHRunControlPanel [SHELL32.161]
530  *
531  */
532 HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
533 {       FIXME("0x%08lx 0x%08lx stub\n",x,z);
534         return 0;
535 }
536 /*************************************************************************
537  * ShellExecuteEx                               [SHELL32.291]
538  *
539  */
540 BOOL WINAPI ShellExecuteExAW (LPVOID sei)
541 {       if (VERSION_OsIsUnicode())
542           return ShellExecuteExW (sei);
543         return ShellExecuteExA (sei);
544 }
545 /*************************************************************************
546  * ShellExecuteExA                              [SHELL32.292]
547  *
548  * placeholder in the commandline:
549  *      %1 file
550  *      %2 printer
551  *      %3 driver
552  *      %4 port
553  *      %I adress of a global item ID (explorer switch /idlist)
554  *      %L ??? path/url/current file ???
555  *      %S ???
556  *      %* all following parameters (see batfile)
557  */
558 #include "process.h" /* we can get rid of it hopefully */
559 #include "task.h"
560 BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
561 {       CHAR szApplicationName[MAX_PATH],szCommandline[MAX_PATH],szPidl[20];
562         LPSTR pos;
563         int gap, len;
564         STARTUPINFOA  startup;
565         PROCESS_INFORMATION info;
566                         
567         WARN("mask=0x%08lx hwnd=0x%04x verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s incomplete\n",
568                 sei->fMask, sei->hwnd, sei->lpVerb, sei->lpFile,
569                 sei->lpParameters, sei->lpDirectory, sei->nShow, 
570                 (sei->fMask & SEE_MASK_CLASSNAME) ? sei->lpClass : "not used");
571
572         ZeroMemory(szApplicationName,MAX_PATH);
573         if (sei->lpFile)
574           strcpy(szApplicationName, sei->lpFile);
575         
576         ZeroMemory(szCommandline,MAX_PATH);
577         if (sei->lpParameters)
578           strcpy(szCommandline, sei->lpParameters);
579                         
580         if (sei->fMask & (SEE_MASK_CLASSKEY | SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
581                           SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT |
582                           SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE | 
583                           SEE_MASK_NO_CONSOLE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR ))
584         {
585           FIXME("flags ignored: 0x%08lx\n", sei->fMask);
586         }
587         
588         /* launch a document by fileclass like 'Wordpad.Document.1' */
589         if (sei->fMask & SEE_MASK_CLASSNAME)
590         {
591           /* the commandline contains 'c:\Path\wordpad.exe "%1"' */
592           HCR_GetExecuteCommand(sei->lpClass, (sei->lpVerb) ? sei->lpVerb : "open", szCommandline, 256);
593           /* fixme: get the extension of lpFile, check if it fits to the lpClass */
594           TRACE("SEE_MASK_CLASSNAME->'%s'\n", szCommandline);
595         }
596
597         /* process the IDList */
598         if ( (sei->fMask & SEE_MASK_INVOKEIDLIST) == SEE_MASK_INVOKEIDLIST) /*0x0c*/
599         {
600           SHGetPathFromIDListA (sei->lpIDList,szApplicationName);
601           TRACE("-- idlist=%p (%s)\n", sei->lpIDList, szApplicationName);
602         }
603         else
604         {
605           if (sei->fMask & SEE_MASK_IDLIST )
606           {
607             pos = strstr(szCommandline, "%I");
608             if (pos)
609             {
610               LPVOID pv;
611               HGLOBAL hmem = SHAllocShared ( sei->lpIDList, ILGetSize(sei->lpIDList), 0);
612               pv = SHLockShared(hmem,0);
613               sprintf(szPidl,":%p",pv );
614               SHUnlockShared(pv);
615             
616               gap = strlen(szPidl);
617               len = strlen(pos)-2;
618               memmove(pos+gap,pos+2,len);
619               memcpy(pos,szPidl,gap);
620
621             }
622           }
623         }
624
625         TRACE("execute:'%s','%s'\n",szApplicationName, szCommandline);
626
627         strcat(szApplicationName, " ");
628         strcat(szApplicationName, szCommandline);
629
630         ZeroMemory(&startup,sizeof(STARTUPINFOA));
631         startup.cb = sizeof(STARTUPINFOA);
632
633         if (! CreateProcessA(NULL, szApplicationName,
634                          NULL, NULL, FALSE, 0, 
635                          NULL, NULL, &startup, &info))
636         {
637           sei->hInstApp = GetLastError();
638           return FALSE;
639         }
640
641         sei->hInstApp = 33;
642         
643         /* Give 30 seconds to the app to come up */
644         if ( WaitForInputIdle ( info.hProcess, 30000 ) ==  0xFFFFFFFF )
645           ERR("WaitForInputIdle failed: Error %ld\n", GetLastError() );
646  
647         if(sei->fMask & SEE_MASK_NOCLOSEPROCESS)
648           sei->hProcess = info.hProcess;          
649         else
650           CloseHandle( info.hProcess );
651         CloseHandle( info.hThread );
652         return TRUE;
653 }
654 /*************************************************************************
655  * ShellExecuteExW                              [SHELL32.293]
656  *
657  */
658 BOOL WINAPI ShellExecuteExW (LPSHELLEXECUTEINFOW sei)
659 {       SHELLEXECUTEINFOA seiA;
660         DWORD ret;
661
662         TRACE("%p\n", sei);
663
664         memcpy(&seiA, sei, sizeof(SHELLEXECUTEINFOA));
665         
666         if (sei->lpVerb)
667           seiA.lpVerb = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpVerb);
668
669         if (sei->lpFile)
670           seiA.lpFile = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpFile);
671
672         if (sei->lpParameters)
673           seiA.lpParameters = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpParameters);
674
675         if (sei->lpDirectory)
676           seiA.lpDirectory = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpDirectory);
677
678         if ((sei->fMask & SEE_MASK_CLASSNAME) && sei->lpClass)
679           seiA.lpClass = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpClass);
680         else
681           seiA.lpClass = NULL;
682                   
683         ret = ShellExecuteExA(&seiA);
684
685         if (seiA.lpVerb)        HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpVerb );
686         if (seiA.lpFile)        HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpFile );
687         if (seiA.lpParameters)  HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpParameters );
688         if (seiA.lpDirectory)   HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpDirectory );
689         if (seiA.lpClass)       HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpClass );
690
691         return ret;
692 }
693
694 static LPUNKNOWN SHELL32_IExplorerInterface=0;
695 /*************************************************************************
696  * SHSetInstanceExplorer                        [SHELL32.176]
697  *
698  * NOTES
699  *  Sets the interface
700  */
701 HRESULT WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
702 {       TRACE("%p\n", lpUnknown);
703         SHELL32_IExplorerInterface = lpUnknown;
704         return (HRESULT) lpUnknown;
705 }
706 /*************************************************************************
707  * SHGetInstanceExplorer                        [SHELL32.256]
708  *
709  * NOTES
710  *  gets the interface pointer of the explorer and a reference
711  */
712 HRESULT WINAPI SHGetInstanceExplorer (LPUNKNOWN * lpUnknown)
713 {       TRACE("%p\n", lpUnknown);
714
715         *lpUnknown = SHELL32_IExplorerInterface;
716
717         if (!SHELL32_IExplorerInterface)
718           return E_FAIL;
719
720         IUnknown_AddRef(SHELL32_IExplorerInterface);
721         return NOERROR;
722 }
723 /*************************************************************************
724  * SHFreeUnusedLibraries                        [SHELL32.123]
725  *
726  * NOTES
727  *  exported by name
728  */
729 void WINAPI SHFreeUnusedLibraries (void)
730 {
731         FIXME("stub\n");
732 }
733 /*************************************************************************
734  * DAD_SetDragImage                             [SHELL32.136]
735  *
736  * NOTES
737  *  exported by name
738  */
739 BOOL WINAPI DAD_SetDragImage(
740         HIMAGELIST himlTrack,
741         LPPOINT lppt)
742 {
743         FIXME("%p %p stub\n",himlTrack, lppt);
744   return 0;
745 }
746 /*************************************************************************
747  * DAD_ShowDragImage                            [SHELL32.137]
748  *
749  * NOTES
750  *  exported by name
751  */
752 BOOL WINAPI DAD_ShowDragImage(BOOL bShow)
753 {
754         FIXME("0x%08x stub\n",bShow);
755         return 0;
756 }
757 /*************************************************************************
758  * SHRegCloseKey                        [NT4.0:SHELL32.505]
759  *
760  */
761 HRESULT WINAPI SHRegCloseKey (HKEY hkey)
762 {       TRACE("0x%04x\n",hkey);
763         return RegCloseKey( hkey );
764 }
765 /*************************************************************************
766  * SHRegOpenKeyA                                [SHELL32.506]
767  *
768  */
769 HRESULT WINAPI SHRegOpenKeyA(HKEY hKey, LPSTR lpSubKey, LPHKEY phkResult)
770 {
771         TRACE("(0x%08x, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
772         return RegOpenKeyA(hKey, lpSubKey, phkResult);
773 }
774
775 /*************************************************************************
776  * SHRegOpenKeyW                                [NT4.0:SHELL32.507]
777  *
778  */
779 HRESULT WINAPI SHRegOpenKeyW (HKEY hkey, LPCWSTR lpszSubKey, LPHKEY retkey)
780 {       WARN("0x%04x %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
781         return RegOpenKeyW( hkey, lpszSubKey, retkey );
782 }
783 /*************************************************************************
784  * SHRegQueryValueExA                           [SHELL32.509]
785  *
786  */
787 HRESULT WINAPI SHRegQueryValueExA(
788         HKEY hkey,
789         LPSTR lpValueName,
790         LPDWORD lpReserved,
791         LPDWORD lpType,
792         LPBYTE lpData,
793         LPDWORD lpcbData)
794 {
795         TRACE("0x%04x %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
796         return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
797 }
798 /*************************************************************************
799  * SHRegQueryValueW                             [NT4.0:SHELL32.510]
800  *
801  */
802 HRESULT WINAPI SHRegQueryValueW (HKEY hkey, LPWSTR lpszSubKey,
803                                  LPWSTR lpszData, LPDWORD lpcbData )
804 {       WARN("0x%04x %s %p %p semi-stub\n",
805                 hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
806         return RegQueryValueW( hkey, lpszSubKey, lpszData, lpcbData );
807 }
808
809 /*************************************************************************
810  * SHRegQueryValueExW                           [NT4.0:SHELL32.511]
811  *
812  * FIXME 
813  *  if the datatype REG_EXPAND_SZ then expand the string and change
814  *  *pdwType to REG_SZ. 
815  */
816 HRESULT WINAPI SHRegQueryValueExW (HKEY hkey, LPWSTR pszValue, LPDWORD pdwReserved,
817                  LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData)
818 {       DWORD ret;
819         WARN("0x%04x %s %p %p %p %p semi-stub\n",
820                 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
821         ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
822         return ret;
823 }
824
825  /* SHGetValue: Gets a value from the registry */
826
827 /*************************************************************************
828  * SHGetValueA
829  *
830  * Gets a value from the registry
831  */
832 DWORD WINAPI SHGetValueA(
833     HKEY     hkey,
834     LPCSTR   pSubKey,
835     LPCSTR   pValue,
836     LPDWORD  pwType,
837     LPVOID   pvData,
838     LPDWORD  pbData
839     )
840 {
841     FIXME("(%p),stub!\n", pSubKey);
842
843         return ERROR_SUCCESS;  /* return success */
844 }
845
846 /*************************************************************************
847  * SHGetValueW
848  *
849  * Gets a value from the registry
850  */
851 DWORD WINAPI SHGetValueW(
852     HKEY     hkey,
853     LPCWSTR  pSubKey,
854     LPCWSTR  pValue,
855     LPDWORD  pwType,
856     LPVOID   pvData,
857     LPDWORD  pbData
858     )
859 {
860     FIXME("(%p),stub!\n", pSubKey);
861
862         return ERROR_SUCCESS;  /* return success */
863 }
864
865 /* gets a user-specific registry value. */
866
867 /*************************************************************************
868  * SHRegGetUSValueA
869  *
870  * Gets a user-specific registry value
871  */
872 LONG WINAPI SHRegGetUSValueA(
873     LPCSTR   pSubKey,
874     LPCSTR   pValue,
875     LPDWORD  pwType,
876     LPVOID   pvData,
877     LPDWORD  pbData,
878     BOOL     fIgnoreHKCU,
879     LPVOID   pDefaultData,
880     DWORD    wDefaultDataSize
881     )
882 {
883     FIXME("(%p),stub!\n", pSubKey);
884
885         return ERROR_SUCCESS;  /* return success */
886 }
887
888 /*************************************************************************
889  * SHRegGetUSValueW
890  *
891  * Gets a user-specific registry value
892  */
893 LONG WINAPI SHRegGetUSValueW(
894     LPCWSTR  pSubKey,
895     LPCWSTR  pValue,
896     LPDWORD  pwType,
897     LPVOID   pvData,
898     LPDWORD  pbData,
899     BOOL     flagIgnoreHKCU,
900     LPVOID   pDefaultData,
901     DWORD    wDefaultDataSize
902     )
903 {
904     FIXME("(%p),stub!\n", pSubKey);
905
906         return ERROR_SUCCESS;  /* return success */
907 }
908   
909 /*************************************************************************
910  * SHRegDeleteKeyA and SHDeleteKeyA
911  */
912 HRESULT WINAPI SHRegDeleteKeyA(HKEY hkey, LPCSTR pszSubKey)
913 {
914         FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
915         return 0;
916 }
917
918 /*************************************************************************
919  * SHRegDeleteKeyW and SHDeleteKeyA
920  */
921 HRESULT WINAPI SHRegDeleteKeyW(HKEY hkey, LPCWSTR pszSubKey)
922 {
923         FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey));
924         return 0;
925 }
926 /*************************************************************************
927  * ReadCabinetState                             [NT 4.0:SHELL32.651]
928  *
929  */
930 HRESULT WINAPI ReadCabinetState(DWORD u, DWORD v)
931 {       FIXME("0x%04lx 0x%04lx stub\n",u,v);
932         return 0;
933 }
934 /*************************************************************************
935  * WriteCabinetState                            [NT 4.0:SHELL32.652]
936  *
937  */
938 HRESULT WINAPI WriteCabinetState(DWORD u)
939 {       FIXME("0x%04lx stub\n",u);
940         return 0;
941 }
942 /*************************************************************************
943  * FileIconInit                                 [SHELL32.660]
944  *
945  */
946 BOOL WINAPI FileIconInit(BOOL bFullInit)
947 {       FIXME("(%s)\n", bFullInit ? "true" : "false");
948         return 0;
949 }
950 /*************************************************************************
951  * IsUserAdmin                                  [NT 4.0:SHELL32.680]
952  *
953  */
954 HRESULT WINAPI IsUserAdmin(void)
955 {       FIXME("stub\n");
956         return TRUE;
957 }
958
959 /*************************************************************************
960  * StrRetToBufA                                 [SHLWAPI.@]
961  * 
962  * converts a STRRET to a normal string
963  *
964  * NOTES
965  *  the pidl is for STRRET OFFSET
966  */
967 HRESULT WINAPI StrRetToBufA (LPSTRRET src, LPITEMIDLIST pidl, LPSTR dest, DWORD len)
968 {
969         return StrRetToStrNA(dest, len, src, pidl);
970 }
971
972 /*************************************************************************
973  * StrRetToBufW                                 [SHLWAPI.@]
974  * 
975  * converts a STRRET to a normal string
976  *
977  * NOTES
978  *  the pidl is for STRRET OFFSET
979  */
980 HRESULT WINAPI StrRetToBufW (LPSTRRET src, LPITEMIDLIST pidl, LPWSTR dest, DWORD len)
981 {
982         return StrRetToStrNW(dest, len, src, pidl);
983 }
984
985 /*************************************************************************
986  * StrRetToStrN                                 [SHELL32.96]
987  * 
988  * converts a STRRET to a normal string
989  *
990  * NOTES
991  *  the pidl is for STRRET OFFSET
992  */
993 HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
994 {
995         TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
996
997         switch (src->uType)
998         {
999           case STRRET_WSTR:
1000             WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL);
1001             SHFree(src->u.pOleStr);
1002             break;
1003
1004           case STRRET_CSTRA:
1005             lstrcpynA((LPSTR)dest, src->u.cStr, len);
1006             break;
1007
1008           case STRRET_OFFSETA:
1009             lstrcpynA((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
1010             break;
1011
1012           default:
1013             FIXME("unknown type!\n");
1014             if (len)
1015             {
1016               *(LPSTR)dest = '\0';
1017             }
1018             return(FALSE);
1019         }
1020         return S_OK;
1021 }
1022
1023 HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
1024 {
1025         TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
1026
1027         switch (src->uType)
1028         {
1029           case STRRET_WSTR:
1030             lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
1031             SHFree(src->u.pOleStr);
1032             break;
1033
1034           case STRRET_CSTRA:
1035             lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
1036             break;
1037
1038           case STRRET_OFFSETA:
1039             if (pidl)
1040             {
1041               lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
1042             }
1043             break;
1044
1045           default:
1046             FIXME("unknown type!\n");
1047             if (len)
1048             { *(LPSTR)dest = '\0';
1049             }
1050             return(FALSE);
1051         }
1052         return S_OK;
1053 }
1054 HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
1055 {
1056         if(VERSION_OsIsUnicode())
1057           return StrRetToStrNW (dest, len, src, pidl);
1058         return StrRetToStrNA (dest, len, src, pidl);
1059 }
1060
1061 /*************************************************************************
1062  * StrChrW                                      [NT 4.0:SHELL32.651]
1063  *
1064  */
1065 LPWSTR WINAPI StrChrW (LPWSTR str, WCHAR x )
1066 {
1067         TRACE("%s 0x%04x\n",debugstr_w(str),x);
1068         return CRTDLL_wcschr(str, x);
1069 }
1070
1071 /*************************************************************************
1072  * StrCmpNIW                                    [NT 4.0:SHELL32.*]
1073  *
1074  */
1075 INT WINAPI StrCmpNIW ( LPWSTR wstr1, LPWSTR wstr2, INT len)
1076 {
1077         TRACE("%s %s %i stub\n", debugstr_w(wstr1),debugstr_w(wstr2),len);
1078         return CRTDLL__wcsnicmp(wstr1, wstr2, len);
1079 }
1080
1081 /*************************************************************************
1082  * SHAllocShared                                [SHELL32.520]
1083  *
1084  * NOTES
1085  *  parameter1 is return value from HeapAlloc
1086  *  parameter2 is equal to the size allocated with HeapAlloc
1087  *  parameter3 is return value from GetCurrentProcessId
1088  *
1089  *  the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
1090  *  WM_USER+2 could be the undocumented CWM_SETPATH
1091  *  the allocated memory contains a pidl
1092  */
1093 HGLOBAL WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
1094 {       HGLOBAL hmem;
1095         LPVOID pmem;
1096         
1097         TRACE("ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID);
1098         hmem = GlobalAlloc(GMEM_FIXED, size);
1099         if (!hmem)
1100           return 0;
1101         
1102         pmem =  GlobalLock (hmem);
1103
1104         if (! pmem)
1105           return 0;
1106           
1107         memcpy (pmem, psrc, size);
1108         GlobalUnlock(hmem); 
1109         return hmem;
1110 }
1111 /*************************************************************************
1112  * SHLockShared                                 [SHELL32.521]
1113  *
1114  * NOTES
1115  *  parameter1 is return value from SHAllocShared
1116  *  parameter2 is return value from GetCurrentProcessId
1117  *  the receiver of (WM_USER+2) trys to lock the HANDLE (?) 
1118  *  the returnvalue seems to be a memoryadress
1119  */
1120 LPVOID WINAPI SHLockShared(HANDLE hmem, DWORD procID)
1121 {       TRACE("handle=0x%04x procID=0x%04lx\n",hmem,procID);
1122         return GlobalLock(hmem);
1123 }
1124 /*************************************************************************
1125  * SHUnlockShared                               [SHELL32.522]
1126  *
1127  * NOTES
1128  *  parameter1 is return value from SHLockShared
1129  */
1130 BOOL WINAPI SHUnlockShared(LPVOID pv)
1131 {
1132         TRACE("%p\n",pv);
1133         return GlobalUnlock((HANDLE)pv); 
1134 }
1135 /*************************************************************************
1136  * SHFreeShared                                 [SHELL32.523]
1137  *
1138  * NOTES
1139  *  parameter1 is return value from SHAllocShared
1140  *  parameter2 is return value from GetCurrentProcessId
1141  */
1142 BOOL WINAPI SHFreeShared(
1143         HANDLE hMem,
1144         DWORD pid)
1145 {
1146         TRACE("handle=0x%04x 0x%04lx\n",hMem,pid);
1147         return GlobalFree(hMem);
1148 }
1149
1150 /*************************************************************************
1151  * SetAppStartingCursor                         [SHELL32.99]
1152  */
1153 HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
1154 {       FIXME("hwnd=0x%04x 0x%04lx stub\n",u,v );
1155         return 0;
1156 }
1157 /*************************************************************************
1158  * SHLoadOLE                                    [SHELL32.151]
1159  *
1160  */
1161 HRESULT WINAPI SHLoadOLE(DWORD u)
1162 {       FIXME("0x%04lx stub\n",u);
1163         return S_OK;
1164 }
1165 /*************************************************************************
1166  * DriveType                                    [SHELL32.64]
1167  *
1168  */
1169 HRESULT WINAPI DriveType(DWORD u)
1170 {       FIXME("0x%04lx stub\n",u);
1171         return 0;
1172 }
1173 /*************************************************************************
1174  * SHAbortInvokeCommand                         [SHELL32.198]
1175  *
1176  */
1177 HRESULT WINAPI SHAbortInvokeCommand(void)
1178 {       FIXME("stub\n");
1179         return 1;
1180 }
1181 /*************************************************************************
1182  * SHOutOfMemoryMessageBox                      [SHELL32.126]
1183  *
1184  */
1185 int WINAPI SHOutOfMemoryMessageBox(
1186         HWND hwndOwner,
1187         LPCSTR lpCaption,
1188         UINT uType)
1189 {
1190         FIXME("0x%04x %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
1191         return 0;
1192 }
1193 /*************************************************************************
1194  * SHFlushClipboard                             [SHELL32.121]
1195  *
1196  */
1197 HRESULT WINAPI SHFlushClipboard(void)
1198 {       FIXME("stub\n");
1199         return 1;
1200 }
1201
1202 /*************************************************************************
1203  * StrFormatByteSizeA                           [SHLWAPI]
1204  */
1205 LPSTR WINAPI StrFormatByteSizeA ( DWORD dw, LPSTR pszBuf, UINT cchBuf )
1206 {       char buf[64];
1207         TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
1208         if ( dw<1024L )
1209         { sprintf (buf,"%3.1f bytes", (FLOAT)dw);
1210         }
1211         else if ( dw<1048576L)
1212         { sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
1213         }
1214         else if ( dw < 1073741824L)
1215         { sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
1216         }
1217         else
1218         { sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
1219         }
1220         lstrcpynA (pszBuf, buf, cchBuf);
1221         return pszBuf;  
1222 }
1223
1224 /*************************************************************************
1225  * StrFormatByteSizeW                           [SHLWAPI]
1226  */
1227 LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf )
1228 {       char buf[64];
1229         TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
1230         if ( dw<1024L )
1231         { sprintf (buf,"%3.1f bytes", (FLOAT)dw);
1232         }
1233         else if ( dw<1048576L)
1234         { sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
1235         }
1236         else if ( dw < 1073741824L)
1237         { sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
1238         }
1239         else
1240         { sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
1241         }
1242         lstrcpynAtoW (pszBuf, buf, cchBuf);
1243         return pszBuf;  
1244 }
1245 /*************************************************************************
1246  * SHWaitForFileToOpen                          [SHELL32.97]
1247  *
1248  */
1249 BOOL WINAPI SHWaitForFileToOpen(
1250         LPCITEMIDLIST pidl, 
1251         DWORD dwFlags,
1252         DWORD dwTimeout)
1253 {
1254         FIXME("%p 0x%08lx 0x%08lx stub\n", pidl, dwFlags, dwTimeout);
1255         return 0;
1256 }
1257 /*************************************************************************
1258  * Control_FillCache_RunDLL                     [SHELL32.8]
1259  *
1260  */
1261 HRESULT WINAPI Control_FillCache_RunDLL(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
1262 {       FIXME("0x%04x 0x%04x 0x%04lx 0x%04lx stub\n",hWnd, hModule,w,x);
1263         return 0;
1264 }
1265 /*************************************************************************
1266  * RunDLL_CallEntry16                           [SHELL32.122]
1267  * the name is propably wrong
1268  */
1269 HRESULT WINAPI RunDLL_CallEntry16(DWORD v, DWORD w, DWORD x, DWORD y, DWORD z)
1270 {       FIXME("0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",v,w,x,y,z);
1271         return 0;
1272 }
1273
1274 /************************************************************************
1275  *      shell32_654                             [SHELL32.654]
1276  *
1277  * NOTES: first parameter seems to be a pointer (same as passed to WriteCabinetState)
1278  * second one could be a size (0x0c). The size is the same as the structure saved to
1279  * HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState
1280  * I'm (js) guessing: this one is just ReadCabinetState ;-)
1281  */
1282 HRESULT WINAPI shell32_654 (DWORD x, DWORD y)
1283 {       FIXME("0x%08lx 0x%08lx stub\n",x,y);
1284         return 0;
1285 }
1286
1287 /************************************************************************
1288  *      RLBuildListOfPaths                      [SHELL32.146]
1289  *
1290  * NOTES
1291  *   builds a DPA
1292  */
1293 DWORD WINAPI RLBuildListOfPaths (void)
1294 {       FIXME("stub\n");
1295         return 0;
1296 }
1297 /************************************************************************
1298  *      StrToOleStr                     [SHELL32.163]
1299  *
1300  */
1301 int WINAPI StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString)
1302 {
1303         TRACE("(%p, %p %s)\n",
1304         lpWideCharStr, lpMultiByteString, debugstr_a(lpMultiByteString));
1305
1306         return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH);
1307
1308 }
1309 int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
1310 {
1311         TRACE("(%p, %p %s)\n",
1312         lpWideCharStr, lpWString, debugstr_w(lpWString));
1313
1314         if (lstrcpyW (lpWideCharStr, lpWString ))
1315         { return lstrlenW (lpWideCharStr);
1316         }
1317         return 0;
1318 }
1319
1320 BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString)
1321 {
1322         if (VERSION_OsIsUnicode())
1323           return StrToOleStrW (lpWideCharStr, lpString);
1324         return StrToOleStrA (lpWideCharStr, lpString);
1325 }
1326
1327 /************************************************************************
1328  *      SHValidateUNC                           [SHELL32.173]
1329  *
1330  */
1331 HRESULT WINAPI SHValidateUNC (DWORD x, DWORD y, DWORD z)
1332 {
1333         FIXME("0x%08lx 0x%08lx 0x%08lx stub\n",x,y,z);
1334         return 0;
1335 }
1336
1337 /************************************************************************
1338  *      DoEnvironmentSubstA                     [SHELL32.1222]
1339  *
1340  */
1341 HRESULT WINAPI DoEnvironmentSubstA(LPSTR x, LPSTR y)
1342 {
1343         FIXME("(%s, %s) stub\n", debugstr_a(x), debugstr_a(y));
1344         return 0;
1345 }
1346
1347 /************************************************************************
1348  *      DoEnvironmentSubstW                     [SHELL32.1223]
1349  *
1350  */
1351 HRESULT WINAPI DoEnvironmentSubstW(LPWSTR x, LPWSTR y)
1352 {
1353         FIXME("(%s, %s): stub\n", debugstr_w(x), debugstr_w(y));
1354         return 0;
1355 }
1356
1357 /************************************************************************
1358  *      DoEnvironmentSubst                      [SHELL32.53]
1359  *
1360  */
1361 HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y)
1362 {
1363         if (VERSION_OsIsUnicode())
1364           return DoEnvironmentSubstW(x, y);
1365         return DoEnvironmentSubstA(x, y);
1366 }
1367
1368 /*************************************************************************
1369  *      shell32_243                             [SHELL32.243]
1370  * 
1371  * Win98+ by-ordinal routine.  In Win98 this routine returns zero and
1372  * does nothing else.  Possibly this does something in NT or SHELL32 5.0?
1373  *
1374  */
1375
1376 BOOL WINAPI shell32_243(DWORD a, DWORD b) 
1377
1378   return FALSE; 
1379 }
1380