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
27 #include "cursoricon.h"
28 #include "interfaces.h"
33 #include "winversion.h"
34 #include "shell32_main.h"
36 /*************************************************************************
37 * SHChangeNotifyRegister [SHELL32.2]
39 * Idlist is an array of structures and Count specifies how many items in the array
40 * (usually just one I think).
43 SHChangeNotifyRegister(
50 { FIXME(shell,"(0x%04x,0x%08lx,0x%08lx,0x%08lx,0x%08x,%p):stub.\n",
51 hwnd,events1,events2,msg,count,idlist);
54 /*************************************************************************
55 * SHChangeNotifyDeregister [SHELL32.4]
58 SHChangeNotifyDeregister(LONG x1)
59 { FIXME(shell,"(0x%08lx):stub.\n",x1);
63 /*************************************************************************
64 * ParseField [SHELL32.58]
67 DWORD WINAPI ParseField(LPCSTR src,DWORD field,LPSTR dst,DWORD len)
68 { FIXME(shell,"(%s,0x%08lx,%p,%ld):stub.\n",src,field,dst,len);
70 if (!src || !src[0] || !dst || !len)
76 { if (*src==0x0) return FALSE;
77 if (*src==',') field--;
82 while (*src!=0x00 && *src!=',' && len>0)
83 { *dst=*src; dst++, src++; len--;
90 /*************************************************************************
91 * PickIconDlg [SHELL32.62]
94 DWORD WINAPI PickIconDlg(DWORD x,DWORD y,DWORD z,DWORD a) {
95 FIXME(shell,"(%08lx,%08lx,%08lx,%08lx):stub.\n",x,y,z,a);
99 /*************************************************************************
100 * GetFileNameFromBrowse [SHELL32.63]
103 DWORD WINAPI GetFileNameFromBrowse(HWND32 howner, LPSTR targetbuf, DWORD len, DWORD x, LPCSTR suffix, LPCSTR y, LPCSTR cmd) {
104 FIXME(shell,"(%04x,%p,%ld,%08lx,%s,%s,%s):stub.\n",
105 howner,targetbuf,len,x,suffix,y,cmd
107 /* puts up a Open Dialog and requests input into targetbuf */
108 /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
109 lstrcpy32A(targetbuf,"x:\\s3.exe");
113 /*************************************************************************
114 * SHGetSettings [SHELL32.68]
117 DWORD WINAPI SHGetSettings(DWORD x,DWORD y,DWORD z) {
118 FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx):stub.\n",
124 /*************************************************************************
125 * Shell_GetCachedImageIndex [SHELL32.72]
128 void WINAPI Shell_GetCachedImageIndex(LPVOID x,DWORD y,DWORD z)
129 { if( VERSION_OsIsUnicode())
130 { FIXME(shell,"(L%s,%08lx,%08lx):stub.\n",debugstr_w((LPWSTR)x),y,z);
133 { FIXME(shell,"(%s,%08lx,%08lx):stub.\n",debugstr_a((LPSTR)x),y,z);
137 /*************************************************************************
138 * SHShellFolderView_Message [SHELL32.73]
141 * hwndCabinet defines the explorer cabinet window that contains the
142 * shellview you need to communicate with
143 * uMsg identifying the SFVM enum to perform
147 * Message SFVM_REARRANGE = 1
148 * This message gets sent when a column gets clicked to instruct the
149 * shell view to re-sort the item list. lParam identifies the column
152 int WINAPI SHShellFolderView_Message(HWND32 hwndCabinet,UINT32 uMsg,LPARAM lParam)
153 { FIXME(shell,"%04x %08ux %08lx stub\n",hwndCabinet,uMsg,lParam);
157 /*************************************************************************
158 * OleStrToStrN [SHELL32.78]
161 * exported by ordinal
163 * wrong implemented OleStr is NOT wide string !!!! (jsch)
166 OleStrToStrN (LPSTR lpMulti, INT32 nMulti, LPCWSTR lpWide, INT32 nWide) {
167 return WideCharToMultiByte (0, 0, lpWide, nWide,
168 lpMulti, nMulti, NULL, NULL);
171 /*************************************************************************
172 * StrToOleStrN [SHELL32.79]
175 * exported by ordinal
177 * wrong implemented OleStr is NOT wide string !!!! (jsch)
180 StrToOleStrN (LPWSTR lpWide, INT32 nWide, LPCSTR lpMulti, INT32 nMulti) {
181 return MultiByteToWideChar (0, 0, lpMulti, nMulti, lpWide, nWide);
184 /*************************************************************************
185 * SHCloneSpecialIDList [SHELL32.89]
189 * nFolder [in] CSIDL_xxxxx ??
194 * exported by ordinal
196 LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND32 hwndOwner,DWORD nFolder,DWORD x3)
197 { LPITEMIDLIST ppidl;
198 WARN(shell,"(hwnd=0x%x,csidl=0x%lx,0x%lx):semi-stub.\n",
199 hwndOwner,nFolder,x3);
201 SHGetSpecialFolderLocation(hwndOwner, nFolder, &ppidl);
207 /*************************************************************************
208 * SHGetSpecialFolderPath [SHELL32.175]
211 * exported by ordinal
213 void WINAPI SHGetSpecialFolderPath(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
214 FIXME(shell,"(0x%04lx,0x%04lx,csidl=0x%04lx,0x%04lx):stub.\n",
219 /*************************************************************************
220 * RegisterShellHook [SHELL32.181]
223 * hwnd [I] window handle
227 * exported by ordinal
229 void WINAPI RegisterShellHook32(HWND32 hwnd, DWORD y) {
230 FIXME(shell,"(0x%08x,0x%08lx):stub.\n",hwnd,y);
233 /*************************************************************************
234 * ShellMessageBoxA [SHELL32.183]
236 * Format and output errormessage.
239 * exported by ordinal
242 ShellMessageBoxA(HMODULE32 hmod,HWND32 hwnd,DWORD id,DWORD x,DWORD type,LPVOID arglist) {
243 char buf[100],buf2[100]/*,*buf3*/;
244 /* LPVOID args = &arglist;*/
246 if (!LoadString32A(hmod,x,buf,100))
247 strcpy(buf,"Desktop");
248 // LoadString32A(hmod,id,buf2,100);
249 /* FIXME: the varargs handling doesn't. */
250 // FormatMessage32A(0x500,buf2,0,0,(LPSTR)&buf3,256,(LPDWORD)&args);
252 FIXME(shell,"(%08lx,%08lx,%08lx(%s),%08lx(%s),%08lx,%p):stub.\n",
253 (DWORD)hmod,(DWORD)hwnd,id,buf2,x,buf,type,arglist
255 /*MessageBox32A(hwnd,buf3,buf,id|0x10000);*/
258 /*************************************************************************
259 * SHRestricted [SHELL32.100]
261 * walks through policy table, queries <app> key, <type> value, returns
262 * queried (DWORD) value.
263 * {0x00001,Explorer,NoRun}
264 * {0x00002,Explorer,NoClose}
265 * {0x00004,Explorer,NoSaveSettings}
266 * {0x00008,Explorer,NoFileMenu}
267 * {0x00010,Explorer,NoSetFolders}
268 * {0x00020,Explorer,NoSetTaskbar}
269 * {0x00040,Explorer,NoDesktop}
270 * {0x00080,Explorer,NoFind}
271 * {0x00100,Explorer,NoDrives}
272 * {0x00200,Explorer,NoDriveAutoRun}
273 * {0x00400,Explorer,NoDriveTypeAutoRun}
274 * {0x00800,Explorer,NoNetHood}
275 * {0x01000,Explorer,NoStartBanner}
276 * {0x02000,Explorer,RestrictRun}
277 * {0x04000,Explorer,NoPrinterTabs}
278 * {0x08000,Explorer,NoDeletePrinter}
279 * {0x10000,Explorer,NoAddPrinter}
280 * {0x20000,Explorer,NoStartMenuSubFolders}
281 * {0x40000,Explorer,MyDocsOnNet}
282 * {0x80000,WinOldApp,NoRealMode}
285 * exported by ordinal
287 DWORD WINAPI SHRestricted (DWORD pol) {
290 FIXME(shell,"(%08lx):stub.\n",pol);
291 if (RegOpenKey32A(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies",&xhkey))
293 /* FIXME: do nothing for now, just return 0 (== "allowed") */
298 /*************************************************************************
299 * SHCreateDirectory [SHELL32.165]
302 * exported by ordinal
303 * not sure about LPSECURITY_ATTRIBUTES
305 DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) {
306 TRACE(shell,"(%p,%s):stub.\n",sec,path);
307 if (CreateDirectory32A(path,sec))
309 /* SHChangeNotify(8,1,path,0); */
312 if (SHELL32_79(path,(LPVOID)x))
314 FIXME(shell,"(%08lx,%s):stub.\n",x,path);
319 /*************************************************************************
320 * SHFree [SHELL32.195]
323 * free_ptr() - frees memory using IMalloc
324 * exported by ordinal
326 DWORD WINAPI SHFree(LPVOID x) {
327 TRACE(shell,"%p\n",x);
328 /*return LocalFree32((HANDLE32)x);*/ /* crashes */
329 return HeapFree(GetProcessHeap(),0,x);
332 /*************************************************************************
333 * SHAlloc [SHELL32.196]
336 * void *task_alloc(DWORD len), uses SHMalloc allocator
337 * exported by ordinal
339 LPVOID WINAPI SHAlloc(DWORD len) {
340 /* void * ret = (LPVOID)LocalAlloc32(len,LMEM_ZEROINIT);*/ /* chrashes */
341 void * ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len);
342 TRACE(shell,"%lu bytes at %p\n",len, ret);
346 /*************************************************************************
347 * OpenRegStream [SHELL32.85]
350 * exported by ordinal
352 DWORD WINAPI OpenRegStream(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
353 FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub.\n",
359 /*************************************************************************
360 * SHRegisterDragDrop [SHELL32.86]
363 * exported by ordinal
365 DWORD WINAPI SHRegisterDragDrop(HWND32 hwnd,DWORD x2) {
366 FIXME (shell, "(0x%08x,0x%08lx):stub.\n", hwnd, x2);
370 /*************************************************************************
371 * SHRevokeDragDrop [SHELL32.87]
374 * exported by ordinal
376 DWORD WINAPI SHRevokeDragDrop(DWORD x) {
377 FIXME(shell,"(0x%08lx):stub.\n",x);
381 /*************************************************************************
382 * RunFileDlg [SHELL32.61]
385 * Original name: RunFileDlg (exported by ordinal)
388 RunFileDlg (HWND32 hwndOwner, DWORD dwParam1, DWORD dwParam2,
389 LPSTR lpszTitle, LPSTR lpszPrompt, UINT32 uFlags)
391 FIXME (shell,"(0x%08x 0x%lx 0x%lx \"%s\" \"%s\" 0x%x):stub.\n",
392 hwndOwner, dwParam1, dwParam2, lpszTitle, lpszPrompt, uFlags);
396 /*************************************************************************
397 * ExitWindowsDialog [SHELL32.60]
400 * exported by ordinal
403 ExitWindowsDialog (HWND32 hwndOwner)
405 FIXME (shell,"(0x%08x):stub.\n", hwndOwner);
409 /*************************************************************************
410 * ArrangeWindows [SHELL32.184]
414 ArrangeWindows (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3,
415 DWORD dwParam4, DWORD dwParam5)
417 FIXME (shell,"(0x%lx 0x%lx 0x%lx 0x%lx 0x%lx):stub.\n",
418 dwParam1, dwParam2, dwParam3, dwParam4, dwParam5);
422 /*************************************************************************
423 * SHCLSIDFromString [SHELL32.147]
426 * exported by ordinal
429 SHCLSIDFromString (DWORD dwParam1, DWORD dwParam2)
431 FIXME (shell,"(0x%lx 0x%lx):stub.\n", dwParam1, dwParam2);
432 FIXME (shell,"(\"%s\" \"%s\"):stub.\n", (LPSTR)dwParam1, (LPSTR)dwParam2);
438 /*************************************************************************
439 * SignalFileOpen [SHELL32.103]
442 * exported by ordinal
445 SignalFileOpen (DWORD dwParam1)
447 FIXME (shell,"(0x%08lx):stub.\n", dwParam1);
452 /*************************************************************************
453 * SHAddToRecentDocs [SHELL32.234]
456 * uFlags [IN] SHARD_PATH or SHARD_PIDL
457 * pv [IN] string or pidl, NULL clears the list
462 DWORD WINAPI SHAddToRecentDocs32 (UINT32 uFlags,LPCVOID pv)
463 { if (SHARD_PIDL==uFlags)
464 { FIXME (shell,"(0x%08x,pidl=%p):stub.\n", uFlags,pv);
467 { FIXME (shell,"(0x%08x,%s):stub.\n", uFlags,(char*)pv);
471 /*************************************************************************
472 * SHFileOperation32 [SHELL32.242]
475 DWORD WINAPI SHFileOperation32(DWORD x)
476 { FIXME(shell,"0x%08lx stub\n",x);
481 /*************************************************************************
482 * SHFileOperation32A [SHELL32.243]
487 DWORD WINAPI SHFileOperation32A (LPSHFILEOPSTRUCT32A lpFileOp)
488 { FIXME (shell,"(%p):stub.\n", lpFileOp);
491 /*************************************************************************
492 * SHFileOperation32W [SHELL32.244]
497 DWORD WINAPI SHFileOperation32W (LPSHFILEOPSTRUCT32W lpFileOp)
498 { FIXME (shell,"(%p):stub.\n", lpFileOp);
502 /*************************************************************************
503 * SHChangeNotify [SHELL32.239]
508 DWORD WINAPI SHChangeNotify32 (
509 INT32 wEventId, /* [IN] flags that specifies the event*/
510 UINT32 uFlags, /* [IN] the meaning of dwItem[1|2]*/
513 { FIXME (shell,"(0x%08x,0x%08ux,%p,%p):stub.\n", wEventId,uFlags,dwItem1,dwItem2);
516 /*************************************************************************
517 * SHCreateShellFolderViewEx [SHELL32.174]
520 * see IShellFolder::CreateViewObject
522 HRESULT WINAPI SHCreateShellFolderViewEx32(
523 LPSHELLVIEWDATA psvcbi, /*[in ] shelltemplate struct*/
524 LPVOID* ppv) /*[out] IShellView pointer*/
525 { FIXME (shell,"(%p,%p):stub.\n", psvcbi,ppv);
528 /*************************************************************************
529 * SHFind_InitMenuPopup [SHELL32.149]
532 * Registers the menu behind the "Start" button
535 * hMenu [in] handel of menu previously created
536 * hWndParent [in] parent window
540 HRESULT WINAPI SHFind_InitMenuPopup (HMENU32 hMenu, HWND32 hWndParent, DWORD w, DWORD x)
541 { FIXME(shell,"hmenu=0x%08x hwnd=0x%08x 0x%08lx 0x%08lx stub\n",
542 hMenu,hWndParent,w,x);
545 /*************************************************************************
546 * FileMenu_InitMenuPopup [SHELL32.109]
549 HRESULT WINAPI FileMenu_InitMenuPopup (DWORD hmenu)
550 { FIXME(shell,"hmenu=0x%lx stub\n",hmenu);
553 /*************************************************************************
554 * FileMenu_Create [SHELL32.114]
556 * w retval from LoadBitmapA
560 HRESULT WINAPI FileMenu_Create (DWORD u, DWORD v, DWORD w, DWORD x, DWORD z)
561 { FIXME(shell,"0x%08lx 0x%08lx hbmp=0x%lx 0x%08lx 0x%08lx stub\n",u,v,w,x,z);
564 /*************************************************************************
565 * FileMenu_TrackPopupMenuEx [SHELL32.116]
568 * uFlags [in] according to TrackPopupMenuEx
572 * z could be rect (trace) or TPMPARAMS (TrackPopupMenuEx)
574 HRESULT WINAPI FileMenu_TrackPopupMenuEx (DWORD t, DWORD uFlags, DWORD posX, DWORD posY, HWND32 hWndParent, DWORD z)
575 { FIXME(shell,"0x%lx flags=0x%lx posx=0x%lx posy=0x%lx hwndp=0x%x 0x%lx stub\n",
576 t,uFlags,posX,posY, hWndParent,z);
579 /*************************************************************************
580 * SHWinHelp [SHELL32.127]
583 HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
584 { FIXME(shell,"0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
587 /*************************************************************************
588 * SHRunControlPanel [SHELL32.161]
591 HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
592 { FIXME(shell,"0x%08lx 0x%08lx stub\n",x,z);
595 /*************************************************************************
596 * ShellExecuteEx [SHELL32.291]
599 BOOL32 WINAPI ShellExecuteEx32 (LPVOID sei)
600 { if (VERSION_OsIsUnicode())
601 return ShellExecuteEx32W (sei);
602 return ShellExecuteEx32A (sei);
604 /*************************************************************************
605 * ShellExecuteEx32A [SHELL32.292]
608 BOOL32 WINAPI ShellExecuteEx32A (LPSHELLEXECUTEINFO32A sei)
609 { CHAR szTemp[MAX_PATH];
611 FIXME(shell,"(%p): stub\n",sei);
613 if (sei->fMask & SEE_MASK_IDLIST)
614 { SHGetPathFromIDList32A (sei->lpIDList,szTemp);
615 TRACE (shell,"-- idlist=%p (%s)\n", sei->lpIDList, szTemp);
618 if (sei->fMask & SEE_MASK_CLASSNAME)
619 { TRACE (shell,"-- classname= %s\n", sei->lpClass);
623 { TRACE (shell,"-- action=%s\n", sei->lpVerb);
628 /*************************************************************************
629 * ShellExecuteEx [SHELL32.293]
632 BOOL32 WINAPI ShellExecuteEx32W (LPSHELLEXECUTEINFO32W sei)
633 { WCHAR szTemp[MAX_PATH];
635 FIXME(shell,"(%p): stub\n",sei);
637 if (sei->fMask & SEE_MASK_IDLIST)
638 { SHGetPathFromIDList32W (sei->lpIDList,szTemp);
639 TRACE (shell,"-- idlist=%p (%s)\n", sei->lpIDList, debugstr_w(szTemp));
642 if (sei->fMask & SEE_MASK_CLASSNAME)
643 { TRACE (shell,"-- classname= %s\n", debugstr_w(sei->lpClass));
647 { TRACE (shell,"-- action=%s\n", debugstr_w(sei->lpVerb));
652 static LPUNKNOWN SHELL32_IExplorerInterface=0;
653 /*************************************************************************
654 * SHSetInstanceExplorer [SHELL32.176]
659 HRESULT WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
660 { TRACE (shell,"%p\n", lpUnknown);
661 SHELL32_IExplorerInterface = lpUnknown;
662 return (HRESULT) lpUnknown;
664 /*************************************************************************
665 * SHGetInstanceExplorer [SHELL32.256]
668 * gets the interface pointer of the explorer and a reference
670 HRESULT WINAPI SHGetInstanceExplorer (LPUNKNOWN * lpUnknown)
671 { TRACE(shell,"%p\n", lpUnknown);
673 *lpUnknown = SHELL32_IExplorerInterface;
675 if (!SHELL32_IExplorerInterface)
678 SHELL32_IExplorerInterface->lpvtbl->fnAddRef(SHELL32_IExplorerInterface);
681 /*************************************************************************
682 * SHFreeUnusedLibraries [SHELL32.123]
687 HRESULT WINAPI SHFreeUnusedLibraries (void)
688 { FIXME(shell,"stub\n");
691 /*************************************************************************
692 * DAD_ShowDragImage [SHELL32.137]
697 HRESULT WINAPI DAD_ShowDragImage (DWORD u)
698 { FIXME(shell,"0x%08lx stub\n",u);
701 /*************************************************************************
702 * FileMenu_Destroy [SHELL32.118]
707 HRESULT WINAPI FileMenu_Destroy (DWORD u)
708 { FIXME(shell,"0x%08lx stub\n",u);
711 /*************************************************************************
712 * SHGetDataFromIDListA [SHELL32.247]
715 HRESULT WINAPI SHGetDataFromIDListA(DWORD u, DWORD v, DWORD w, DWORD x, DWORD y)
716 { FIXME(shell,"0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w,x,y);
719 /*************************************************************************
720 * SHRegCloseKey32 [NT4.0:SHELL32.505]
723 HRESULT WINAPI SHRegCloseKey32 (HKEY hkey)
724 { TRACE(shell,"0x%04x\n",hkey);
725 return RegCloseKey( hkey );
727 /*************************************************************************
728 * SHRegOpenKey32A [SHELL32.506]
731 HRESULT WINAPI SHRegOpenKey32A(HKEY hKey, LPSTR lpSubKey, LPHKEY phkResult)
732 { FIXME(shell,"(0x%08x, %s, %p)\n", hKey, debugstr_a(lpSubKey),
734 return RegOpenKey32A(hKey, lpSubKey, phkResult);
737 /*************************************************************************
738 * SHRegOpenKey32W [NT4.0:SHELL32.507]
741 HRESULT WINAPI SHRegOpenKey32W (HKEY hkey, LPCWSTR lpszSubKey, LPHKEY retkey)
742 { WARN(shell,"0x%04x %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
743 return RegOpenKey32W( hkey, lpszSubKey, retkey );
745 /*************************************************************************
746 * SHRegQueryValueExA [SHELL32.509]
749 HRESULT WINAPI SHRegQueryValueEx32A(DWORD u, LPSTR v, DWORD w, DWORD x,
751 { FIXME(shell,"0x%04lx %s 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",
752 u,debugstr_a(v),w,x,y,z);
755 /*************************************************************************
756 * SHRegQueryValue32W [NT4.0:SHELL32.510]
759 HRESULT WINAPI SHRegQueryValue32W (HKEY hkey, LPWSTR lpszSubKey,
760 LPWSTR lpszData, LPDWORD lpcbData )
761 { WARN(shell,"0x%04x %s %p %p semi-stub\n",
762 hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
763 return RegQueryValue32W( hkey, lpszSubKey, lpszData, lpcbData );
766 /*************************************************************************
767 * SHRegQueryValueEx32W [NT4.0:SHELL32.511]
770 * if the datatype REG_EXPAND_SZ then expand the string and change
771 * *pdwType to REG_SZ.
773 HRESULT WINAPI SHRegQueryValueEx32W (HKEY hkey, LPWSTR pszValue, LPDWORD pdwReserved,
774 LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData)
776 WARN(shell,"0x%04x %s %p %p %p %p semi-stub\n",
777 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
778 ret = RegQueryValueEx32W ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
782 /*************************************************************************
783 * ReadCabinetState [NT 4.0:SHELL32.651]
786 HRESULT WINAPI ReadCabinetState(DWORD u, DWORD v)
787 { FIXME(shell,"0x%04lx 0x%04lx stub\n",u,v);
790 /*************************************************************************
791 * WriteCabinetState [NT 4.0:SHELL32.652]
794 HRESULT WINAPI WriteCabinetState(DWORD u)
795 { FIXME(shell,"0x%04lx stub\n",u);
798 /*************************************************************************
799 * FileIconInit [SHELL32.660]
802 BOOL32 WINAPI FileIconInit(BOOL32 bFullInit)
803 { FIXME(shell,"(%s)\n", bFullInit ? "true" : "false");
806 /*************************************************************************
807 * IsUserAdmin [NT 4.0:SHELL32.680]
810 HRESULT WINAPI IsUserAdmin(void)
811 { FIXME(shell,"stub\n");
814 /*************************************************************************
815 * StrRetToStrN [SHELL32.96]
817 * converts a STRRET to a normal string
820 * FIXME the string handling is to simple (different STRRET choices)
821 * at the moment only CSTR
822 * the pidl is for STRRET OFFSET
824 HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
825 { TRACE(shell,"dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
829 WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL);
830 SHFree(src->u.pOleStr);
834 if (VERSION_OsIsUnicode())
835 lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
837 strncpy((LPSTR)dest, src->u.cStr, len);
842 { if(VERSION_OsIsUnicode())
843 lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
845 strncpy((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
850 FIXME(shell,"unknown type!\n");
852 { *(LPSTR)dest = '\0';
859 /*************************************************************************
860 * StrChrW [NT 4.0:SHELL32.651]
863 LPWSTR WINAPI StrChrW (LPWSTR str, WCHAR x )
866 TRACE(shell,"%s 0x%04x\n",debugstr_w(str),x);
876 /*************************************************************************
877 * StrCmpNIW [NT 4.0:SHELL32.*]
880 INT32 WINAPI StrCmpNIW ( LPWSTR wstr1, LPWSTR wstr2, INT32 len)
881 { FIXME( shell,"%s %s %i stub\n", debugstr_w(wstr1),debugstr_w(wstr2),len);
885 /*************************************************************************
886 * SHAllocShared [SHELL32.520]
889 * parameter1 is return value from HeapAlloc
890 * parameter2 is equal to the size allocated with HeapAlloc
891 * parameter3 is return value from GetCurrentProcessId
893 * the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
894 * WM_USER+2 could be the undocumented CWM_SETPATH
895 * the allocated memory contains a pidl
897 HGLOBAL32 WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
901 TRACE(shell,"ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID);
902 hmem = GlobalAlloc32(GMEM_FIXED, size);
906 pmem = GlobalLock32 (hmem);
911 memcpy (pmem, psrc, size);
912 GlobalUnlock32(hmem);
915 /*************************************************************************
916 * SHLockShared [SHELL32.521]
919 * parameter1 is return value from SHAllocShared
920 * parameter2 is return value from GetCurrentProcessId
921 * the receiver of (WM_USER+2) trys to lock the HANDLE (?)
922 * the returnvalue seems to be a memoryadress
924 LPVOID WINAPI SHLockShared(HANDLE32 hmem, DWORD procID)
925 { TRACE(shell,"handle=0x%04x procID=0x%04lx\n",hmem,procID);
926 return GlobalLock32(hmem);
928 /*************************************************************************
929 * SHUnlockShared [SHELL32.522]
932 * parameter1 is return value from SHLockShared
934 BOOL32 WINAPI SHUnlockShared(HANDLE32 pmem)
935 { TRACE(shell,"handle=0x%04x\n",pmem);
936 return GlobalUnlock32(pmem);
938 /*************************************************************************
939 * SHFreeShared [SHELL32.523]
942 * parameter1 is return value from SHAllocShared
943 * parameter2 is return value from GetCurrentProcessId
945 HANDLE32 WINAPI SHFreeShared(HANDLE32 hmem, DWORD procID)
946 { TRACE(shell,"handle=0x%04x 0x%04lx\n",hmem,procID);
947 return GlobalFree32(hmem);
950 /*************************************************************************
951 * SetAppStartingCursor32 [SHELL32.99]
954 HRESULT WINAPI SetAppStartingCursor32(DWORD u, DWORD v)
955 { FIXME(shell,"0x%04lx 0x%04lx stub\n",u,v );
958 /*************************************************************************
959 * SHLoadOLE32 [SHELL32.151]
962 HRESULT WINAPI SHLoadOLE32(DWORD u)
963 { FIXME(shell,"0x%04lx stub\n",u);
966 /*************************************************************************
967 * Shell_MergeMenus32 [SHELL32.67]
970 BOOL32 _SHIsMenuSeparator(HMENU32 hm, int i)
974 mii.cbSize = sizeof(MENUITEMINFO32A);
975 mii.fMask = MIIM_TYPE;
976 mii.cch = 0; /* WARNING: We MUST initialize it to 0*/
977 if (!GetMenuItemInfo32A(hm, i, TRUE, &mii))
981 if (mii.fType & MFT_SEPARATOR)
987 #define MM_ADDSEPARATOR 0x00000001L
988 #define MM_SUBMENUSHAVEIDS 0x00000002L
989 HRESULT WINAPI Shell_MergeMenus32 (HMENU32 hmDst, HMENU32 hmSrc, UINT32 uInsert, UINT32 uIDAdjust, UINT32 uIDAdjustMax, ULONG uFlags)
992 BOOL32 bAlreadySeparated;
993 MENUITEMINFO32A miiSrc;
995 UINT32 uTemp, uIDMax = uIDAdjust;
997 FIXME(shell,"hmenu1=0x%04x hmenu2=0x%04x 0x%04x 0x%04x 0x%04x 0x%04lx stub\n",
998 hmDst, hmSrc, uInsert, uIDAdjust, uIDAdjustMax, uFlags);
1000 if (!hmDst || !hmSrc)
1004 nItem = GetMenuItemCount32(hmDst);
1005 if (uInsert >= (UINT32)nItem)
1006 { uInsert = (UINT32)nItem;
1007 bAlreadySeparated = TRUE;
1010 { bAlreadySeparated = _SHIsMenuSeparator(hmDst, uInsert);;
1012 if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
1013 { /* Add a separator between the menus */
1014 InsertMenu32A(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
1015 bAlreadySeparated = TRUE;
1019 /* Go through the menu items and clone them*/
1020 for (nItem = GetMenuItemCount32(hmSrc) - 1; nItem >= 0; nItem--)
1021 { miiSrc.cbSize = sizeof(MENUITEMINFO32A);
1022 miiSrc.fMask = MIIM_STATE | MIIM_ID | MIIM_SUBMENU | MIIM_CHECKMARKS | MIIM_TYPE | MIIM_DATA;
1023 /* We need to reset this every time through the loop in case
1024 menus DON'T have IDs*/
1025 miiSrc.fType = MFT_STRING;
1026 miiSrc.dwTypeData = szName;
1027 miiSrc.dwItemData = 0;
1028 miiSrc.cch = sizeof(szName);
1030 if (!GetMenuItemInfo32A(hmSrc, nItem, TRUE, &miiSrc))
1033 if (miiSrc.fType & MFT_SEPARATOR)
1034 { /* This is a separator; don't put two of them in a row*/
1035 if (bAlreadySeparated)
1038 bAlreadySeparated = TRUE;
1040 else if (miiSrc.hSubMenu)
1041 { if (uFlags & MM_SUBMENUSHAVEIDS)
1042 { /* Adjust the ID and check it*/
1043 miiSrc.wID += uIDAdjust;
1044 if (miiSrc.wID > uIDAdjustMax)
1047 if (uIDMax <= miiSrc.wID)
1048 { uIDMax = miiSrc.wID + 1;
1052 { /* Don't set IDs for submenus that didn't have them already */
1053 miiSrc.fMask &= ~MIIM_ID;
1055 hmSubMenu = miiSrc.hSubMenu;
1056 miiSrc.hSubMenu = CreatePopupMenu32();
1057 if (!miiSrc.hSubMenu)
1060 uTemp = Shell_MergeMenus32(miiSrc.hSubMenu, hmSubMenu, 0, uIDAdjust, uIDAdjustMax, uFlags&MM_SUBMENUSHAVEIDS);
1061 if (uIDMax <= uTemp)
1064 bAlreadySeparated = FALSE;
1067 { /* Adjust the ID and check it*/
1068 miiSrc.wID += uIDAdjust;
1069 if (miiSrc.wID > uIDAdjustMax)
1072 if (uIDMax <= miiSrc.wID)
1073 { uIDMax = miiSrc.wID + 1;
1075 bAlreadySeparated = FALSE;
1077 if (!InsertMenuItem32A(hmDst, uInsert, TRUE, &miiSrc))
1082 /* Ensure the correct number of separators at the beginning of the
1083 inserted menu items*/
1085 { if (bAlreadySeparated)
1086 { DeleteMenu32(hmDst, uInsert, MF_BYPOSITION);
1090 { if (_SHIsMenuSeparator(hmDst, uInsert-1))
1091 { if (bAlreadySeparated)
1092 { DeleteMenu32(hmDst, uInsert, MF_BYPOSITION);
1096 { if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
1097 { /* Add a separator between the menus*/
1098 InsertMenu32A(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
1105 /*************************************************************************
1106 * DriveType32 [SHELL32.64]
1109 HRESULT WINAPI DriveType32(DWORD u)
1110 { FIXME(shell,"0x%04lx stub\n",u);
1113 /*************************************************************************
1114 * SHAbortInvokeCommand [SHELL32.198]
1117 HRESULT WINAPI SHAbortInvokeCommand(void)
1118 { FIXME(shell,"stub\n");
1121 /*************************************************************************
1122 * SHOutOfMemoryMessageBox [SHELL32.126]
1125 HRESULT WINAPI SHOutOfMemoryMessageBox(DWORD u, DWORD v, DWORD w)
1126 { FIXME(shell,"0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w);
1129 /*************************************************************************
1130 * SHFlushClipboard [SHELL32.121]
1133 HRESULT WINAPI SHFlushClipboard(void)
1134 { FIXME(shell,"stub\n");
1137 /*************************************************************************
1138 * StrRChrW [SHELL32.320]
1141 LPWSTR WINAPI StrRChrW(LPWSTR lpStart, LPWSTR lpEnd, DWORD wMatch)
1143 TRACE(shell,"%s %s 0x%04x\n",debugstr_w(lpStart),debugstr_w(lpEnd), (WCHAR)wMatch );
1145 /* if the end not given, search*/
1153 { if (*lpStart==(WCHAR)wMatch)
1156 } while ( lpStart<=lpEnd );
1159 /*************************************************************************
1160 * StrFormatByteSize [SHLWAPI]
1162 LPSTR WINAPI StrFormatByteSize32A ( DWORD dw, LPSTR pszBuf, UINT32 cchBuf )
1164 TRACE(shell,"%lx %p %i\n", dw, pszBuf, cchBuf);
1166 { sprintf (buf,"%3.1f bytes", (FLOAT)dw);
1168 else if ( dw<1048576L)
1169 { sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
1171 else if ( dw < 1073741824L)
1172 { sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
1175 { sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
1177 strncpy (pszBuf, buf, cchBuf);
1180 LPWSTR WINAPI StrFormatByteSize32W ( DWORD dw, LPWSTR pszBuf, UINT32 cchBuf )
1182 TRACE(shell,"%lx %p %i\n", dw, pszBuf, cchBuf);
1184 { sprintf (buf,"%3.1f bytes", (FLOAT)dw);
1186 else if ( dw<1048576L)
1187 { sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
1189 else if ( dw < 1073741824L)
1190 { sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
1193 { sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
1195 lstrcpynAtoW (pszBuf, buf, cchBuf);
1198 /*************************************************************************
1199 * SHWaitForFileToOpen [SHELL32.97]
1202 HRESULT WINAPI SHWaitForFileToOpen(DWORD u, DWORD v, DWORD w)
1203 { FIXME(shell,"0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w);