2 * Shell Ordinal Functions
4 * These are completely undocumented. The meaning of the functions changes
5 * between different OS versions (NT uses Unicode strings, 95 uses ASCII
8 * They are just here so that explorer.exe and iexplore.exe can be tested.
10 * Copyright 1997 Marcus Meissner
28 #include "cursoricon.h"
29 #include "interfaces.h"
34 #include "winversion.h"
35 #include "shell32_main.h"
37 /*************************************************************************
38 * SHChangeNotifyRegister [SHELL32.2]
40 * Idlist is an array of structures and Count specifies how many items in the array
41 * (usually just one I think).
44 SHChangeNotifyRegister(
51 { FIXME(shell
,"(0x%04x,0x%08lx,0x%08lx,0x%08lx,0x%08x,%p):stub.\n",
52 hwnd
,events1
,events2
,msg
,count
,idlist
);
55 /*************************************************************************
56 * SHChangeNotifyDeregister [SHELL32.4]
59 SHChangeNotifyDeregister(LONG x1
)
60 { FIXME(shell
,"(0x%08lx):stub.\n",x1
);
64 /*************************************************************************
65 * ParseField [SHELL32.58]
68 DWORD WINAPI
ParseField(LPCSTR src
,DWORD field
,LPSTR dst
,DWORD len
)
69 { FIXME(shell
,"(%s,0x%08lx,%p,%ld):stub.\n",src
,field
,dst
,len
);
71 if (!src
|| !src
[0] || !dst
|| !len
)
77 { if (*src
==0x0) return FALSE
;
78 if (*src
==',') field
--;
83 while (*src
!=0x00 && *src
!=',' && len
>0)
84 { *dst
=*src
; dst
++, src
++; len
--;
91 /*************************************************************************
92 * PickIconDlg [SHELL32.62]
95 DWORD WINAPI
PickIconDlg(DWORD x
,DWORD y
,DWORD z
,DWORD a
) {
96 FIXME(shell
,"(%08lx,%08lx,%08lx,%08lx):stub.\n",x
,y
,z
,a
);
100 /*************************************************************************
101 * GetFileNameFromBrowse [SHELL32.63]
104 DWORD WINAPI
GetFileNameFromBrowse(HWND32 howner
, LPSTR targetbuf
, DWORD len
, DWORD x
, LPCSTR suffix
, LPCSTR y
, LPCSTR cmd
) {
105 FIXME(shell
,"(%04x,%p,%ld,%08lx,%s,%s,%s):stub.\n",
106 howner
,targetbuf
,len
,x
,suffix
,y
,cmd
108 /* puts up a Open Dialog and requests input into targetbuf */
109 /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
110 lstrcpy32A(targetbuf
,"x:\\s3.exe");
114 /*************************************************************************
115 * SHGetSettings [SHELL32.68]
118 DWORD WINAPI
SHGetSettings(DWORD x
,DWORD y
,DWORD z
) {
119 FIXME(shell
,"(0x%08lx,0x%08lx,0x%08lx):stub.\n",
125 /*************************************************************************
126 * Shell_GetCachedImageIndex [SHELL32.72]
129 void WINAPI
Shell_GetCachedImageIndex(LPVOID x
,DWORD y
,DWORD z
)
130 { if( VERSION_OsIsUnicode())
131 { FIXME(shell
,"(L%s,%08lx,%08lx):stub.\n",debugstr_w((LPWSTR
)x
),y
,z
);
134 { FIXME(shell
,"(%s,%08lx,%08lx):stub.\n",debugstr_a((LPSTR
)x
),y
,z
);
138 /*************************************************************************
139 * SHShellFolderView_Message [SHELL32.73]
142 * hwndCabinet defines the explorer cabinet window that contains the
143 * shellview you need to communicate with
144 * uMsg identifying the SFVM enum to perform
148 * Message SFVM_REARRANGE = 1
149 * This message gets sent when a column gets clicked to instruct the
150 * shell view to re-sort the item list. lParam identifies the column
153 int WINAPI
SHShellFolderView_Message(HWND32 hwndCabinet
,UINT32 uMsg
,LPARAM lParam
)
154 { FIXME(shell
,"%04x %08ux %08lx stub\n",hwndCabinet
,uMsg
,lParam
);
158 /*************************************************************************
159 * OleStrToStrN [SHELL32.78]
162 * exported by ordinal
164 * wrong implemented OleStr is NOT wide string !!!! (jsch)
167 OleStrToStrN (LPSTR lpMulti
, INT32 nMulti
, LPCWSTR lpWide
, INT32 nWide
) {
168 return WideCharToMultiByte (0, 0, lpWide
, nWide
,
169 lpMulti
, nMulti
, NULL
, NULL
);
172 /*************************************************************************
173 * StrToOleStrN [SHELL32.79]
176 * exported by ordinal
178 * wrong implemented OleStr is NOT wide string !!!! (jsch)
181 StrToOleStrN (LPWSTR lpWide
, INT32 nWide
, LPCSTR lpMulti
, INT32 nMulti
) {
182 return MultiByteToWideChar (0, 0, lpMulti
, nMulti
, lpWide
, nWide
);
185 /*************************************************************************
186 * SHCloneSpecialIDList [SHELL32.89]
190 * nFolder [in] CSIDL_xxxxx ??
195 * exported by ordinal
197 LPITEMIDLIST WINAPI
SHCloneSpecialIDList(HWND32 hwndOwner
,DWORD nFolder
,DWORD x3
)
198 { LPITEMIDLIST ppidl
;
199 WARN(shell
,"(hwnd=0x%x,csidl=0x%lx,0x%lx):semi-stub.\n",
200 hwndOwner
,nFolder
,x3
);
202 SHGetSpecialFolderLocation(hwndOwner
, nFolder
, &ppidl
);
208 /*************************************************************************
209 * SHGetSpecialFolderPath [SHELL32.175]
212 * exported by ordinal
214 void WINAPI
SHGetSpecialFolderPath(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
) {
215 FIXME(shell
,"(0x%04lx,0x%04lx,csidl=0x%04lx,0x%04lx):stub.\n",
220 /*************************************************************************
221 * RegisterShellHook [SHELL32.181]
224 * hwnd [I] window handle
228 * exported by ordinal
230 void WINAPI
RegisterShellHook32(HWND32 hwnd
, DWORD y
) {
231 FIXME(shell
,"(0x%08x,0x%08lx):stub.\n",hwnd
,y
);
234 /*************************************************************************
235 * ShellMessageBoxA [SHELL32.183]
237 * Format and output errormessage.
240 * exported by ordinal
243 ShellMessageBoxA(HMODULE32 hmod
,HWND32 hwnd
,DWORD id
,DWORD x
,DWORD type
,LPVOID arglist
) {
244 char buf
[100],buf2
[100]/*,*buf3*/;
245 /* LPVOID args = &arglist;*/
247 if (!LoadString32A(hmod
,x
,buf
,100))
248 strcpy(buf
,"Desktop");
249 // LoadString32A(hmod,id,buf2,100);
250 /* FIXME: the varargs handling doesn't. */
251 // FormatMessage32A(0x500,buf2,0,0,(LPSTR)&buf3,256,(LPDWORD)&args);
253 FIXME(shell
,"(%08lx,%08lx,%08lx(%s),%08lx(%s),%08lx,%p):stub.\n",
254 (DWORD
)hmod
,(DWORD
)hwnd
,id
,buf2
,x
,buf
,type
,arglist
256 /*MessageBox32A(hwnd,buf3,buf,id|0x10000);*/
259 /*************************************************************************
260 * SHRestricted [SHELL32.100]
262 * walks through policy table, queries <app> key, <type> value, returns
263 * queried (DWORD) value.
264 * {0x00001,Explorer,NoRun}
265 * {0x00002,Explorer,NoClose}
266 * {0x00004,Explorer,NoSaveSettings}
267 * {0x00008,Explorer,NoFileMenu}
268 * {0x00010,Explorer,NoSetFolders}
269 * {0x00020,Explorer,NoSetTaskbar}
270 * {0x00040,Explorer,NoDesktop}
271 * {0x00080,Explorer,NoFind}
272 * {0x00100,Explorer,NoDrives}
273 * {0x00200,Explorer,NoDriveAutoRun}
274 * {0x00400,Explorer,NoDriveTypeAutoRun}
275 * {0x00800,Explorer,NoNetHood}
276 * {0x01000,Explorer,NoStartBanner}
277 * {0x02000,Explorer,RestrictRun}
278 * {0x04000,Explorer,NoPrinterTabs}
279 * {0x08000,Explorer,NoDeletePrinter}
280 * {0x10000,Explorer,NoAddPrinter}
281 * {0x20000,Explorer,NoStartMenuSubFolders}
282 * {0x40000,Explorer,MyDocsOnNet}
283 * {0x80000,WinOldApp,NoRealMode}
286 * exported by ordinal
288 DWORD WINAPI
SHRestricted (DWORD pol
) {
291 FIXME(shell
,"(%08lx):stub.\n",pol
);
292 if (RegOpenKey32A(HKEY_CURRENT_USER
,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies",&xhkey
))
294 /* FIXME: do nothing for now, just return 0 (== "allowed") */
299 /*************************************************************************
300 * SHCreateDirectory [SHELL32.165]
303 * exported by ordinal
304 * not sure about LPSECURITY_ATTRIBUTES
306 DWORD WINAPI
SHCreateDirectory(LPSECURITY_ATTRIBUTES sec
,LPCSTR path
) {
307 TRACE(shell
,"(%p,%s):stub.\n",sec
,path
);
308 if (CreateDirectory32A(path
,sec
))
310 /* SHChangeNotify(8,1,path,0); */
313 if (SHELL32_79(path
,(LPVOID
)x
))
315 FIXME(shell
,"(%08lx,%s):stub.\n",x
,path
);
320 /*************************************************************************
321 * SHFree [SHELL32.195]
324 * free_ptr() - frees memory using IMalloc
325 * exported by ordinal
327 DWORD WINAPI
SHFree(LPVOID x
) {
328 TRACE(shell
,"%p\n",x
);
329 /*return LocalFree32((HANDLE32)x);*/ /* crashes */
330 return HeapFree(GetProcessHeap(),0,x
);
333 /*************************************************************************
334 * SHAlloc [SHELL32.196]
337 * void *task_alloc(DWORD len), uses SHMalloc allocator
338 * exported by ordinal
340 LPVOID WINAPI
SHAlloc(DWORD len
) {
341 /* void * ret = (LPVOID)LocalAlloc32(len,LMEM_ZEROINIT);*/ /* chrashes */
342 void * ret
= (LPVOID
) HeapAlloc(GetProcessHeap(),0,len
);
343 TRACE(shell
,"%lu bytes at %p\n",len
, ret
);
347 /*************************************************************************
348 * OpenRegStream [SHELL32.85]
351 * exported by ordinal
353 DWORD WINAPI
OpenRegStream(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
) {
354 FIXME(shell
,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub.\n",
360 /*************************************************************************
361 * SHRegisterDragDrop [SHELL32.86]
364 * exported by ordinal
366 DWORD WINAPI
SHRegisterDragDrop(HWND32 hwnd
,DWORD x2
) {
367 FIXME (shell
, "(0x%08x,0x%08lx):stub.\n", hwnd
, x2
);
371 /*************************************************************************
372 * SHRevokeDragDrop [SHELL32.87]
375 * exported by ordinal
377 DWORD WINAPI
SHRevokeDragDrop(DWORD x
) {
378 FIXME(shell
,"(0x%08lx):stub.\n",x
);
382 /*************************************************************************
383 * RunFileDlg [SHELL32.61]
386 * Original name: RunFileDlg (exported by ordinal)
389 RunFileDlg (HWND32 hwndOwner
, DWORD dwParam1
, DWORD dwParam2
,
390 LPSTR lpszTitle
, LPSTR lpszPrompt
, UINT32 uFlags
)
392 FIXME (shell
,"(0x%08x 0x%lx 0x%lx \"%s\" \"%s\" 0x%x):stub.\n",
393 hwndOwner
, dwParam1
, dwParam2
, lpszTitle
, lpszPrompt
, uFlags
);
397 /*************************************************************************
398 * ExitWindowsDialog [SHELL32.60]
401 * exported by ordinal
404 ExitWindowsDialog (HWND32 hwndOwner
)
406 FIXME (shell
,"(0x%08x):stub.\n", hwndOwner
);
410 /*************************************************************************
411 * ArrangeWindows [SHELL32.184]
415 ArrangeWindows (DWORD dwParam1
, DWORD dwParam2
, DWORD dwParam3
,
416 DWORD dwParam4
, DWORD dwParam5
)
418 FIXME (shell
,"(0x%lx 0x%lx 0x%lx 0x%lx 0x%lx):stub.\n",
419 dwParam1
, dwParam2
, dwParam3
, dwParam4
, dwParam5
);
423 /*************************************************************************
424 * SHCLSIDFromString [SHELL32.147]
427 * exported by ordinal
430 SHCLSIDFromString (DWORD dwParam1
, DWORD dwParam2
)
432 FIXME (shell
,"(0x%lx 0x%lx):stub.\n", dwParam1
, dwParam2
);
433 FIXME (shell
,"(\"%s\" \"%s\"):stub.\n", (LPSTR
)dwParam1
, (LPSTR
)dwParam2
);
439 /*************************************************************************
440 * SignalFileOpen [SHELL32.103]
443 * exported by ordinal
446 SignalFileOpen (DWORD dwParam1
)
448 FIXME (shell
,"(0x%08lx):stub.\n", dwParam1
);
453 /*************************************************************************
454 * SHAddToRecentDocs [SHELL32.234]
457 * uFlags [IN] SHARD_PATH or SHARD_PIDL
458 * pv [IN] string or pidl, NULL clears the list
463 DWORD WINAPI
SHAddToRecentDocs32 (UINT32 uFlags
,LPCVOID pv
)
464 { if (SHARD_PIDL
==uFlags
)
465 { FIXME (shell
,"(0x%08x,pidl=%p):stub.\n", uFlags
,pv
);
468 { FIXME (shell
,"(0x%08x,%s):stub.\n", uFlags
,(char*)pv
);
472 /*************************************************************************
473 * SHFileOperation32 [SHELL32.242]
476 DWORD WINAPI
SHFileOperation32(DWORD x
)
477 { FIXME(shell
,"0x%08lx stub\n",x
);
482 /*************************************************************************
483 * SHFileOperation32A [SHELL32.243]
488 DWORD WINAPI
SHFileOperation32A (LPSHFILEOPSTRUCT32A lpFileOp
)
489 { FIXME (shell
,"(%p):stub.\n", lpFileOp
);
492 /*************************************************************************
493 * SHFileOperation32W [SHELL32.244]
498 DWORD WINAPI
SHFileOperation32W (LPSHFILEOPSTRUCT32W lpFileOp
)
499 { FIXME (shell
,"(%p):stub.\n", lpFileOp
);
503 /*************************************************************************
504 * SHChangeNotify [SHELL32.239]
509 DWORD WINAPI
SHChangeNotify32 (
510 INT32 wEventId
, /* [IN] flags that specifies the event*/
511 UINT32 uFlags
, /* [IN] the meaning of dwItem[1|2]*/
514 { FIXME (shell
,"(0x%08x,0x%08ux,%p,%p):stub.\n", wEventId
,uFlags
,dwItem1
,dwItem2
);
517 /*************************************************************************
518 * SHCreateShellFolderViewEx [SHELL32.174]
521 * see IShellFolder::CreateViewObject
523 HRESULT WINAPI
SHCreateShellFolderViewEx32(
524 LPSHELLVIEWDATA psvcbi
, /*[in ] shelltemplate struct*/
525 LPVOID
* ppv
) /*[out] IShellView pointer*/
526 { FIXME (shell
,"(%p,%p):stub.\n", psvcbi
,ppv
);
529 /*************************************************************************
530 * SHFind_InitMenuPopup [SHELL32.149]
533 * Registers the menu behind the "Start" button
536 * hMenu [in] handel of menu previously created
537 * hWndParent [in] parent window
541 HRESULT WINAPI
SHFind_InitMenuPopup (HMENU32 hMenu
, HWND32 hWndParent
, DWORD w
, DWORD x
)
542 { FIXME(shell
,"hmenu=0x%08x hwnd=0x%08x 0x%08lx 0x%08lx stub\n",
543 hMenu
,hWndParent
,w
,x
);
546 /*************************************************************************
547 * FileMenu_InitMenuPopup [SHELL32.109]
550 HRESULT WINAPI
FileMenu_InitMenuPopup (DWORD hmenu
)
551 { FIXME(shell
,"hmenu=0x%lx stub\n",hmenu
);
554 /*************************************************************************
555 * FileMenu_Create [SHELL32.114]
557 * w retval from LoadBitmapA
561 HRESULT WINAPI
FileMenu_Create (DWORD u
, DWORD v
, DWORD w
, DWORD x
, DWORD z
)
562 { FIXME(shell
,"0x%08lx 0x%08lx hbmp=0x%lx 0x%08lx 0x%08lx stub\n",u
,v
,w
,x
,z
);
565 /*************************************************************************
566 * FileMenu_TrackPopupMenuEx [SHELL32.116]
569 * uFlags [in] according to TrackPopupMenuEx
573 * z could be rect (trace) or TPMPARAMS (TrackPopupMenuEx)
575 HRESULT WINAPI
FileMenu_TrackPopupMenuEx (DWORD t
, DWORD uFlags
, DWORD posX
, DWORD posY
, HWND32 hWndParent
, DWORD z
)
576 { FIXME(shell
,"0x%lx flags=0x%lx posx=0x%lx posy=0x%lx hwndp=0x%x 0x%lx stub\n",
577 t
,uFlags
,posX
,posY
, hWndParent
,z
);
580 /*************************************************************************
581 * SHWinHelp [SHELL32.127]
584 HRESULT WINAPI
SHWinHelp (DWORD v
, DWORD w
, DWORD x
, DWORD z
)
585 { FIXME(shell
,"0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v
,w
,x
,z
);
588 /*************************************************************************
589 * SHRunControlPanel [SHELL32.161]
592 HRESULT WINAPI
SHRunControlPanel (DWORD x
, DWORD z
)
593 { FIXME(shell
,"0x%08lx 0x%08lx stub\n",x
,z
);
596 /*************************************************************************
597 * ShellExecuteEx [SHELL32.291]
600 BOOL32 WINAPI
ShellExecuteEx32 (LPVOID sei
)
601 { if (VERSION_OsIsUnicode())
602 return ShellExecuteEx32W (sei
);
603 return ShellExecuteEx32A (sei
);
605 /*************************************************************************
606 * ShellExecuteEx32A [SHELL32.292]
609 BOOL32 WINAPI
ShellExecuteEx32A (LPSHELLEXECUTEINFO32A sei
)
610 { CHAR szTemp
[MAX_PATH
];
612 FIXME(shell
,"(%p): stub\n",sei
);
614 if (sei
->fMask
& SEE_MASK_IDLIST
)
615 { SHGetPathFromIDList32A (sei
->lpIDList
,szTemp
);
616 TRACE (shell
,"-- idlist=%p (%s)\n", sei
->lpIDList
, szTemp
);
619 if (sei
->fMask
& SEE_MASK_CLASSNAME
)
620 { TRACE (shell
,"-- classname= %s\n", sei
->lpClass
);
624 { TRACE (shell
,"-- action=%s\n", sei
->lpVerb
);
629 /*************************************************************************
630 * ShellExecuteEx [SHELL32.293]
633 BOOL32 WINAPI
ShellExecuteEx32W (LPSHELLEXECUTEINFO32W sei
)
634 { WCHAR szTemp
[MAX_PATH
];
636 FIXME(shell
,"(%p): stub\n",sei
);
638 if (sei
->fMask
& SEE_MASK_IDLIST
)
639 { SHGetPathFromIDList32W (sei
->lpIDList
,szTemp
);
640 TRACE (shell
,"-- idlist=%p (%s)\n", sei
->lpIDList
, debugstr_w(szTemp
));
643 if (sei
->fMask
& SEE_MASK_CLASSNAME
)
644 { TRACE (shell
,"-- classname= %s\n", debugstr_w(sei
->lpClass
));
648 { TRACE (shell
,"-- action=%s\n", debugstr_w(sei
->lpVerb
));
653 static LPUNKNOWN SHELL32_IExplorerInterface
=0;
654 /*************************************************************************
655 * SHSetInstanceExplorer [SHELL32.176]
660 HRESULT WINAPI
SHSetInstanceExplorer (LPUNKNOWN lpUnknown
)
661 { TRACE (shell
,"%p\n", lpUnknown
);
662 SHELL32_IExplorerInterface
= lpUnknown
;
663 return (HRESULT
) lpUnknown
;
665 /*************************************************************************
666 * SHGetInstanceExplorer [SHELL32.256]
669 * gets the interface pointer of the explorer and a reference
671 HRESULT WINAPI
SHGetInstanceExplorer (LPUNKNOWN
* lpUnknown
)
672 { TRACE(shell
,"%p\n", lpUnknown
);
674 *lpUnknown
= SHELL32_IExplorerInterface
;
676 if (!SHELL32_IExplorerInterface
)
679 SHELL32_IExplorerInterface
->lpvtbl
->fnAddRef(SHELL32_IExplorerInterface
);
682 /*************************************************************************
683 * SHFreeUnusedLibraries [SHELL32.123]
688 HRESULT WINAPI
SHFreeUnusedLibraries (void)
689 { FIXME(shell
,"stub\n");
692 /*************************************************************************
693 * DAD_ShowDragImage [SHELL32.137]
698 HRESULT WINAPI
DAD_ShowDragImage (DWORD u
)
699 { FIXME(shell
,"0x%08lx stub\n",u
);
702 /*************************************************************************
703 * FileMenu_Destroy [SHELL32.118]
708 HRESULT WINAPI
FileMenu_Destroy (DWORD u
)
709 { FIXME(shell
,"0x%08lx stub\n",u
);
712 /*************************************************************************
713 * SHGetDataFromIDListA [SHELL32.247]
716 HRESULT WINAPI
SHGetDataFromIDListA(DWORD u
, DWORD v
, DWORD w
, DWORD x
, DWORD y
)
717 { FIXME(shell
,"0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",u
,v
,w
,x
,y
);
720 /*************************************************************************
721 * SHRegCloseKey32 [NT4.0:SHELL32.505]
724 HRESULT WINAPI
SHRegCloseKey32 (HKEY hkey
)
725 { TRACE(shell
,"0x%04x\n",hkey
);
726 return RegCloseKey( hkey
);
728 /*************************************************************************
729 * SHRegOpenKey32A [SHELL32.506]
732 HRESULT WINAPI
SHRegOpenKey32A(HKEY hKey
, LPSTR lpSubKey
, LPHKEY phkResult
)
733 { FIXME(shell
,"(0x%08x, %s, %p)\n", hKey
, debugstr_a(lpSubKey
),
735 return RegOpenKey32A(hKey
, lpSubKey
, phkResult
);
738 /*************************************************************************
739 * SHRegOpenKey32W [NT4.0:SHELL32.507]
742 HRESULT WINAPI
SHRegOpenKey32W (HKEY hkey
, LPCWSTR lpszSubKey
, LPHKEY retkey
)
743 { WARN(shell
,"0x%04x %s %p\n",hkey
,debugstr_w(lpszSubKey
),retkey
);
744 return RegOpenKey32W( hkey
, lpszSubKey
, retkey
);
746 /*************************************************************************
747 * SHRegQueryValueExA [SHELL32.509]
750 HRESULT WINAPI
SHRegQueryValueEx32A(DWORD u
, LPSTR v
, DWORD w
, DWORD x
,
752 { FIXME(shell
,"0x%04lx %s 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",
753 u
,debugstr_a(v
),w
,x
,y
,z
);
756 /*************************************************************************
757 * SHRegQueryValue32W [NT4.0:SHELL32.510]
760 HRESULT WINAPI
SHRegQueryValue32W (HKEY hkey
, LPWSTR lpszSubKey
,
761 LPWSTR lpszData
, LPDWORD lpcbData
)
762 { WARN(shell
,"0x%04x %s %p %p semi-stub\n",
763 hkey
, debugstr_w(lpszSubKey
), lpszData
, lpcbData
);
764 return RegQueryValue32W( hkey
, lpszSubKey
, lpszData
, lpcbData
);
767 /*************************************************************************
768 * SHRegQueryValueEx32W [NT4.0:SHELL32.511]
771 * if the datatype REG_EXPAND_SZ then expand the string and change
772 * *pdwType to REG_SZ.
774 HRESULT WINAPI
SHRegQueryValueEx32W (HKEY hkey
, LPWSTR pszValue
, LPDWORD pdwReserved
,
775 LPDWORD pdwType
, LPVOID pvData
, LPDWORD pcbData
)
777 WARN(shell
,"0x%04x %s %p %p %p %p semi-stub\n",
778 hkey
, debugstr_w(pszValue
), pdwReserved
, pdwType
, pvData
, pcbData
);
779 ret
= RegQueryValueEx32W ( hkey
, pszValue
, pdwReserved
, pdwType
, pvData
, pcbData
);
783 /*************************************************************************
784 * ReadCabinetState [NT 4.0:SHELL32.651]
787 HRESULT WINAPI
ReadCabinetState(DWORD u
, DWORD v
)
788 { FIXME(shell
,"0x%04lx 0x%04lx stub\n",u
,v
);
791 /*************************************************************************
792 * WriteCabinetState [NT 4.0:SHELL32.652]
795 HRESULT WINAPI
WriteCabinetState(DWORD u
)
796 { FIXME(shell
,"0x%04lx stub\n",u
);
799 /*************************************************************************
800 * FileIconInit [SHELL32.660]
803 BOOL32 WINAPI
FileIconInit(BOOL32 bFullInit
)
804 { FIXME(shell
,"(%s)\n", bFullInit
? "true" : "false");
807 /*************************************************************************
808 * IsUserAdmin [NT 4.0:SHELL32.680]
811 HRESULT WINAPI
IsUserAdmin(void)
812 { FIXME(shell
,"stub\n");
815 /*************************************************************************
816 * StrRetToStrN [SHELL32.96]
818 * converts a STRRET to a normal string
821 * FIXME the string handling is to simple (different STRRET choices)
822 * at the moment only CSTR
823 * the pidl is for STRRET OFFSET
825 HRESULT WINAPI
StrRetToStrN (LPVOID dest
, DWORD len
, LPSTRRET src
, LPITEMIDLIST pidl
)
826 { TRACE(shell
,"dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest
,len
,src
,pidl
);
830 WideCharToMultiByte(CP_ACP
, 0, src
->u
.pOleStr
, -1, (LPSTR
)dest
, len
, NULL
, NULL
);
831 SHFree(src
->u
.pOleStr
);
835 if (VERSION_OsIsUnicode())
836 lstrcpynAtoW((LPWSTR
)dest
, src
->u
.cStr
, len
);
838 strncpy((LPSTR
)dest
, src
->u
.cStr
, len
);
843 { if(VERSION_OsIsUnicode())
844 lstrcpynAtoW((LPWSTR
)dest
, ((LPCSTR
)&pidl
->mkid
)+src
->u
.uOffset
, len
);
846 strncpy((LPSTR
)dest
, ((LPCSTR
)&pidl
->mkid
)+src
->u
.uOffset
, len
);
851 FIXME(shell
,"unknown type!\n");
853 { *(LPSTR
)dest
= '\0';
860 /*************************************************************************
861 * StrChrW [NT 4.0:SHELL32.651]
864 LPWSTR WINAPI
StrChrW (LPWSTR str
, WCHAR x
)
867 TRACE(shell
,"%s 0x%04x\n",debugstr_w(str
),x
);
877 /*************************************************************************
878 * StrCmpNIW [NT 4.0:SHELL32.*]
881 INT32 WINAPI
StrCmpNIW ( LPWSTR wstr1
, LPWSTR wstr2
, INT32 len
)
882 { FIXME( shell
,"%s %s %i stub\n", debugstr_w(wstr1
),debugstr_w(wstr2
),len
);
886 /*************************************************************************
887 * SHAllocShared [SHELL32.520]
890 * parameter1 is return value from HeapAlloc
891 * parameter2 is equal to the size allocated with HeapAlloc
892 * parameter3 is return value from GetCurrentProcessId
894 * the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
895 * WM_USER+2 could be the undocumented CWM_SETPATH
896 * the allocated memory contains a pidl
898 HGLOBAL32 WINAPI
SHAllocShared(LPVOID psrc
, DWORD size
, DWORD procID
)
902 TRACE(shell
,"ptr=%p size=0x%04lx procID=0x%04lx\n",psrc
,size
,procID
);
903 hmem
= GlobalAlloc32(GMEM_FIXED
, size
);
907 pmem
= GlobalLock32 (hmem
);
912 memcpy (pmem
, psrc
, size
);
913 GlobalUnlock32(hmem
);
916 /*************************************************************************
917 * SHLockShared [SHELL32.521]
920 * parameter1 is return value from SHAllocShared
921 * parameter2 is return value from GetCurrentProcessId
922 * the receiver of (WM_USER+2) trys to lock the HANDLE (?)
923 * the returnvalue seems to be a memoryadress
925 LPVOID WINAPI
SHLockShared(HANDLE32 hmem
, DWORD procID
)
926 { TRACE(shell
,"handle=0x%04x procID=0x%04lx\n",hmem
,procID
);
927 return GlobalLock32(hmem
);
929 /*************************************************************************
930 * SHUnlockShared [SHELL32.522]
933 * parameter1 is return value from SHLockShared
935 BOOL32 WINAPI
SHUnlockShared(HANDLE32 pmem
)
936 { TRACE(shell
,"handle=0x%04x\n",pmem
);
937 return GlobalUnlock32(pmem
);
939 /*************************************************************************
940 * SHFreeShared [SHELL32.523]
943 * parameter1 is return value from SHAllocShared
944 * parameter2 is return value from GetCurrentProcessId
946 HANDLE32 WINAPI
SHFreeShared(HANDLE32 hmem
, DWORD procID
)
947 { TRACE(shell
,"handle=0x%04x 0x%04lx\n",hmem
,procID
);
948 return GlobalFree32(hmem
);
951 /*************************************************************************
952 * SetAppStartingCursor32 [SHELL32.99]
955 HRESULT WINAPI
SetAppStartingCursor32(DWORD u
, DWORD v
)
956 { FIXME(shell
,"0x%04lx 0x%04lx stub\n",u
,v
);
959 /*************************************************************************
960 * SHLoadOLE32 [SHELL32.151]
963 HRESULT WINAPI
SHLoadOLE32(DWORD u
)
964 { FIXME(shell
,"0x%04lx stub\n",u
);
967 /*************************************************************************
968 * Shell_MergeMenus32 [SHELL32.67]
971 BOOL32
_SHIsMenuSeparator(HMENU32 hm
, int i
)
975 mii
.cbSize
= sizeof(MENUITEMINFO32A
);
976 mii
.fMask
= MIIM_TYPE
;
977 mii
.cch
= 0; /* WARNING: We MUST initialize it to 0*/
978 if (!GetMenuItemInfo32A(hm
, i
, TRUE
, &mii
))
982 if (mii
.fType
& MFT_SEPARATOR
)
988 #define MM_ADDSEPARATOR 0x00000001L
989 #define MM_SUBMENUSHAVEIDS 0x00000002L
990 HRESULT WINAPI
Shell_MergeMenus32 (HMENU32 hmDst
, HMENU32 hmSrc
, UINT32 uInsert
, UINT32 uIDAdjust
, UINT32 uIDAdjustMax
, ULONG uFlags
)
993 BOOL32 bAlreadySeparated
;
994 MENUITEMINFO32A miiSrc
;
996 UINT32 uTemp
, uIDMax
= uIDAdjust
;
998 FIXME(shell
,"hmenu1=0x%04x hmenu2=0x%04x 0x%04x 0x%04x 0x%04x 0x%04lx stub\n",
999 hmDst
, hmSrc
, uInsert
, uIDAdjust
, uIDAdjustMax
, uFlags
);
1001 if (!hmDst
|| !hmSrc
)
1005 nItem
= GetMenuItemCount32(hmDst
);
1006 if (uInsert
>= (UINT32
)nItem
)
1007 { uInsert
= (UINT32
)nItem
;
1008 bAlreadySeparated
= TRUE
;
1011 { bAlreadySeparated
= _SHIsMenuSeparator(hmDst
, uInsert
);;
1013 if ((uFlags
& MM_ADDSEPARATOR
) && !bAlreadySeparated
)
1014 { /* Add a separator between the menus */
1015 InsertMenu32A(hmDst
, uInsert
, MF_BYPOSITION
| MF_SEPARATOR
, 0, NULL
);
1016 bAlreadySeparated
= TRUE
;
1020 /* Go through the menu items and clone them*/
1021 for (nItem
= GetMenuItemCount32(hmSrc
) - 1; nItem
>= 0; nItem
--)
1022 { miiSrc
.cbSize
= sizeof(MENUITEMINFO32A
);
1023 miiSrc
.fMask
= MIIM_STATE
| MIIM_ID
| MIIM_SUBMENU
| MIIM_CHECKMARKS
| MIIM_TYPE
| MIIM_DATA
;
1024 /* We need to reset this every time through the loop in case
1025 menus DON'T have IDs*/
1026 miiSrc
.fType
= MFT_STRING
;
1027 miiSrc
.dwTypeData
= szName
;
1028 miiSrc
.dwItemData
= 0;
1029 miiSrc
.cch
= sizeof(szName
);
1031 if (!GetMenuItemInfo32A(hmSrc
, nItem
, TRUE
, &miiSrc
))
1034 if (miiSrc
.fType
& MFT_SEPARATOR
)
1035 { /* This is a separator; don't put two of them in a row*/
1036 if (bAlreadySeparated
)
1039 bAlreadySeparated
= TRUE
;
1041 else if (miiSrc
.hSubMenu
)
1042 { if (uFlags
& MM_SUBMENUSHAVEIDS
)
1043 { /* Adjust the ID and check it*/
1044 miiSrc
.wID
+= uIDAdjust
;
1045 if (miiSrc
.wID
> uIDAdjustMax
)
1048 if (uIDMax
<= miiSrc
.wID
)
1049 { uIDMax
= miiSrc
.wID
+ 1;
1053 { /* Don't set IDs for submenus that didn't have them already */
1054 miiSrc
.fMask
&= ~MIIM_ID
;
1056 hmSubMenu
= miiSrc
.hSubMenu
;
1057 miiSrc
.hSubMenu
= CreatePopupMenu32();
1058 if (!miiSrc
.hSubMenu
)
1061 uTemp
= Shell_MergeMenus32(miiSrc
.hSubMenu
, hmSubMenu
, 0, uIDAdjust
, uIDAdjustMax
, uFlags
&MM_SUBMENUSHAVEIDS
);
1062 if (uIDMax
<= uTemp
)
1065 bAlreadySeparated
= FALSE
;
1068 { /* Adjust the ID and check it*/
1069 miiSrc
.wID
+= uIDAdjust
;
1070 if (miiSrc
.wID
> uIDAdjustMax
)
1073 if (uIDMax
<= miiSrc
.wID
)
1074 { uIDMax
= miiSrc
.wID
+ 1;
1076 bAlreadySeparated
= FALSE
;
1078 if (!InsertMenuItem32A(hmDst
, uInsert
, TRUE
, &miiSrc
))
1083 /* Ensure the correct number of separators at the beginning of the
1084 inserted menu items*/
1086 { if (bAlreadySeparated
)
1087 { DeleteMenu32(hmDst
, uInsert
, MF_BYPOSITION
);
1091 { if (_SHIsMenuSeparator(hmDst
, uInsert
-1))
1092 { if (bAlreadySeparated
)
1093 { DeleteMenu32(hmDst
, uInsert
, MF_BYPOSITION
);
1097 { if ((uFlags
& MM_ADDSEPARATOR
) && !bAlreadySeparated
)
1098 { /* Add a separator between the menus*/
1099 InsertMenu32A(hmDst
, uInsert
, MF_BYPOSITION
| MF_SEPARATOR
, 0, NULL
);
1106 /*************************************************************************
1107 * DriveType32 [SHELL32.64]
1110 HRESULT WINAPI
DriveType32(DWORD u
)
1111 { FIXME(shell
,"0x%04lx stub\n",u
);
1114 /*************************************************************************
1115 * SHAbortInvokeCommand [SHELL32.198]
1118 HRESULT WINAPI
SHAbortInvokeCommand(void)
1119 { FIXME(shell
,"stub\n");
1122 /*************************************************************************
1123 * SHOutOfMemoryMessageBox [SHELL32.126]
1126 HRESULT WINAPI
SHOutOfMemoryMessageBox(DWORD u
, DWORD v
, DWORD w
)
1127 { FIXME(shell
,"0x%04lx 0x%04lx 0x%04lx stub\n",u
,v
,w
);
1130 /*************************************************************************
1131 * SHFlushClipboard [SHELL32.121]
1134 HRESULT WINAPI
SHFlushClipboard(void)
1135 { FIXME(shell
,"stub\n");
1138 /*************************************************************************
1139 * StrRChrW [SHELL32.320]
1142 LPWSTR WINAPI
StrRChrW(LPWSTR lpStart
, LPWSTR lpEnd
, DWORD wMatch
)
1144 TRACE(shell
,"%s %s 0x%04x\n",debugstr_w(lpStart
),debugstr_w(lpEnd
), (WCHAR
)wMatch
);
1146 /* if the end not given, search*/
1154 { if (*lpStart
==(WCHAR
)wMatch
)
1157 } while ( lpStart
<=lpEnd
);
1160 /*************************************************************************
1161 * StrFormatByteSize [SHLWAPI]
1163 LPSTR WINAPI
StrFormatByteSize32A ( DWORD dw
, LPSTR pszBuf
, UINT32 cchBuf
)
1165 TRACE(shell
,"%lx %p %i\n", dw
, pszBuf
, cchBuf
);
1167 { sprintf (buf
,"%3.1f bytes", (FLOAT
)dw
);
1169 else if ( dw
<1048576L)
1170 { sprintf (buf
,"%3.1f KB", (FLOAT
)dw
/1024);
1172 else if ( dw
< 1073741824L)
1173 { sprintf (buf
,"%3.1f MB", (FLOAT
)dw
/1048576L);
1176 { sprintf (buf
,"%3.1f GB", (FLOAT
)dw
/1073741824L);
1178 strncpy (pszBuf
, buf
, cchBuf
);
1181 LPWSTR WINAPI
StrFormatByteSize32W ( DWORD dw
, LPWSTR pszBuf
, UINT32 cchBuf
)
1183 TRACE(shell
,"%lx %p %i\n", dw
, pszBuf
, cchBuf
);
1185 { sprintf (buf
,"%3.1f bytes", (FLOAT
)dw
);
1187 else if ( dw
<1048576L)
1188 { sprintf (buf
,"%3.1f KB", (FLOAT
)dw
/1024);
1190 else if ( dw
< 1073741824L)
1191 { sprintf (buf
,"%3.1f MB", (FLOAT
)dw
/1048576L);
1194 { sprintf (buf
,"%3.1f GB", (FLOAT
)dw
/1073741824L);
1196 lstrcpynAtoW (pszBuf
, buf
, cchBuf
);
1199 /*************************************************************************
1200 * SHWaitForFileToOpen [SHELL32.97]
1203 HRESULT WINAPI
SHWaitForFileToOpen(DWORD u
, DWORD v
, DWORD w
)
1204 { FIXME(shell
,"0x%04lx 0x%04lx 0x%04lx stub\n",u
,v
,w
);