source: trunk/src/shell32/shellord.cpp@ 1215

Last change on this file since 1215 was 1215, checked in by sandervl, 26 years ago

Added $Id$

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