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"
33 #include "shell32_main.h"
35 /*************************************************************************
36 * SHChangeNotifyRegister [SHELL32.2]
38 * Idlist is an array of structures and Count specifies how many items in the array
39 * (usually just one I think).
42 SHChangeNotifyRegister(
49 { FIXME(shell,"(0x%04x,0x%08lx,0x%08lx,0x%08lx,0x%08x,%p):stub.\n",
50 hwnd,events1,events2,msg,count,idlist);
53 /*************************************************************************
54 * SHChangeNotifyDeregister [SHELL32.4]
57 SHChangeNotifyDeregister(LONG x1,LONG x2)
58 { FIXME(shell,"(0x%08lx,0x%08lx):stub.\n",x1,x2);
62 /*************************************************************************
63 * PathIsRoot [SHELL32.29]
65 BOOL32 WINAPI PathIsRoot(LPCSTR x) {
66 TRACE(shell,"%s\n",x);
67 if (!strcmp(x+1,":\\")) /* "X:\" */
69 if (!strcmp(x,"\\")) /* "\" */
71 if (x[0]=='\\' && x[1]=='\\') { /* UNC "\\<xx>\" */
72 int foundbackslash = 0;
78 if (foundbackslash<=1) /* max 1 \ more ... */
84 /*************************************************************************
85 * PathBuildRoot [SHELL32.30]
87 LPSTR WINAPI PathBuildRoot(LPSTR root,BYTE drive) {
88 TRACE(shell,"%p %i\n",root, drive);
94 /*************************************************************************
95 * PathFindExtension [SHELL32.31]
98 * returns pointer to last . in last pathcomponent or at \0.
100 LPSTR WINAPI PathFindExtension(LPSTR path) {
101 LPSTR lastpoint = NULL;
102 TRACE(shell,"%p %s\n",path,path);
104 if (*path=='\\'||*path==' ')
110 return lastpoint?lastpoint:path;
113 /*************************************************************************
114 * PathAddBackslash [SHELL32.32]
117 * append \ if there is none
119 LPSTR WINAPI PathAddBackslash(LPSTR path)
121 TRACE(shell,"%p->%s\n",path,path);
124 if (len && path[len-1]!='\\')
132 /*************************************************************************
133 * PathRemoveBlanks [SHELL32.33]
136 * remove spaces from beginning and end of passed string
138 LPSTR WINAPI PathRemoveBlanks(LPSTR str)
140 TRACE(shell,"%s\n",str);
155 /*************************************************************************
156 * PathFindFilename [SHELL32.34]
159 * basename(char *fn);
161 LPSTR WINAPI PathFindFilename(LPSTR fn)
163 TRACE(shell,"%s\n",fn);
166 { if (((fn[0]=='\\') || (fn[0]==':')) && fn[1] && fn[1]!='\\')
173 /*************************************************************************
174 * PathRemoveFileSpec [SHELL32.35]
177 * bool getpath(char *pathname); truncates passed argument to a valid path
178 * returns if the string was modified or not.
179 * "\foo\xx\foo"-> "\foo\xx"
183 DWORD WINAPI PathRemoveFileSpec(LPSTR fn) {
185 TRACE(shell,"%s\n",fn);
199 continue; /* already x++ed */
217 /*************************************************************************
218 * PathAppend [SHELL32.36]
221 * concat_paths(char*target,const char*add);
222 * concats "target\\add" and writes them to target
224 LPSTR WINAPI PathAppend(LPSTR x1,LPSTR x2) {
225 TRACE(shell,"%s %s\n",x1,x2);
226 while (x2[0]=='\\') x2++;
227 return PathCombine(x1,x1,x2);
230 /*************************************************************************
231 * PathCombine [SHELL32.37]
234 * if lpszFile='.' skip it
235 * szDest can be equal to lpszFile. Thats why we use sTemp
237 LPSTR WINAPI PathCombine(LPSTR szDest, LPCSTR lpszDir, LPCSTR lpszFile)
238 { char sTemp[MAX_PATH];
239 TRACE(shell,"%p %p->%s %p->%s\n",szDest, lpszDir, lpszDir, lpszFile, lpszFile);
241 if (!lpszFile || !lpszFile[0] || (lpszFile[0]=='.' && !lpszFile[1]) )
242 { strcpy(szDest,lpszDir);
246 /* if lpszFile is a complete path don't care about lpszDir */
247 if (PathIsRoot(lpszFile))
248 { strcpy(szDest,lpszFile);
250 strcpy(sTemp,lpszDir);
251 PathAddBackslash(sTemp);
252 strcat(sTemp,lpszFile);
253 strcpy(szDest,sTemp);
257 /*************************************************************************
258 * PathIsUNC [SHELL32.39]
261 * PathIsUNC(char*path);
263 BOOL32 WINAPI PathIsUNC(LPCSTR path) {
264 TRACE(shell,"%s\n",path);
265 if ((path[0]=='\\') && (path[1]=='\\'))
269 /*************************************************************************
270 * PathIsExe [SHELL32.43]
273 BOOL32 WINAPI PathIsExe (LPCSTR path)
274 { TRACE(shell,"path=%s\n",path);
278 /*************************************************************************
279 * PathFileExists [SHELL32.45]
282 * file_exists(char *fn);
284 BOOL32 WINAPI PathFileExists(LPSTR fn) {
285 TRACE(shell,"%s\n",fn);
286 if (GetFileAttributes32A(fn)==-1)
291 /*************************************************************************
292 * PathMatchSpec [SHELL32.46]
298 BOOL32 WINAPI PathMatchSpec(LPSTR x, LPSTR y)
299 { FIXME(shell,"%s %s stub\n",x,y);
303 /*************************************************************************
304 * PathResolve [SHELL32.51]
306 DWORD WINAPI PathResolve(LPCSTR s,DWORD x2,DWORD x3) {
307 FIXME(shell,"(%s,0x%08lx,0x%08lx),stub!\n",s,x2,x3);
311 /*************************************************************************
312 * PathGetArgs [SHELL32.52]
315 * look for next arg in string. handle "quoted" strings
316 * returns pointer to argument *AFTER* the space. Or to the \0.
318 LPSTR WINAPI PathGetArgs(LPSTR cmdline) {
319 BOOL32 qflag = FALSE;
320 TRACE(shell,"%s\n",cmdline);
322 if ((*cmdline==' ') && !qflag)
331 /*************************************************************************
332 * PathUnquoteSpaces [SHELL32.56]
335 * unquote string (remove ")
337 VOID WINAPI PathUnquoteSpaces(LPSTR str) {
338 DWORD len = lstrlen32A(str);
339 TRACE(shell,"%s\n",str);
340 if (*str!='"') return;
341 if (str[len-1]!='"') return;
343 lstrcpy32A(str,str+1);
347 /*************************************************************************
348 * ParseField [SHELL32.58]
351 DWORD WINAPI ParseField(LPCSTR src,DWORD x2,LPSTR target,DWORD pathlen) {
352 FIXME(shell,"(%s,0x%08lx,%p,%ld):stub.\n",
353 src,x2,target,pathlen
360 /*************************************************************************
361 * PickIconDlg [SHELL32.62]
364 DWORD WINAPI PickIconDlg(DWORD x,DWORD y,DWORD z,DWORD a) {
365 FIXME(shell,"(%08lx,%08lx,%08lx,%08lx):stub.\n",x,y,z,a);
369 /*************************************************************************
370 * GetFileNameFromBrowse [SHELL32.63]
373 DWORD WINAPI GetFileNameFromBrowse(HWND32 howner, LPSTR targetbuf, DWORD len, DWORD x, LPCSTR suffix, LPCSTR y, LPCSTR cmd) {
374 FIXME(shell,"(%04x,%p,%ld,%08lx,%s,%s,%s):stub.\n",
375 howner,targetbuf,len,x,suffix,y,cmd
377 /* puts up a Open Dialog and requests input into targetbuf */
378 /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
379 lstrcpy32A(targetbuf,"x:\\s3.exe");
383 /*************************************************************************
384 * SHGetSettings [SHELL32.68]
387 DWORD WINAPI SHGetSettings(DWORD x,DWORD y,DWORD z) {
388 FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx):stub.\n",
394 /*************************************************************************
395 * Shell_GetCachedImageIndex [SHELL32.72]
398 void WINAPI Shell_GetCachedImageIndex(LPSTR x,DWORD y,DWORD z)
399 { FIXME(shell,"(%s,%08lx,%08lx):stub.\n",x,y,z);
402 /*************************************************************************
403 * SHShellFolderView_Message [SHELL32.73]
406 * hwndCabinet defines the explorer cabinet window that contains the
407 * shellview you need to communicate with
408 * uMsg identifying the SFVM enum to perform
412 * Message SFVM_REARRANGE = 1
413 * This message gets sent when a column gets clicked to instruct the
414 * shell view to re-sort the item list. lParam identifies the column
417 int WINAPI SHShellFolderView_Message(HWND32 hwndCabinet,UINT32 uMsg,LPARAM lParam)
418 { FIXME(shell,"%04x %08ux %08lx stub\n",hwndCabinet,uMsg,lParam);
422 /*************************************************************************
423 * PathYetAnotherMakeUniqueName [SHELL32.75]
426 * exported by ordinal
428 BOOL32 WINAPI PathYetAnotherMakeUniqueName(LPDWORD x,LPDWORD y) {
429 FIXME(shell,"(%p,%p):stub.\n",x,y);
433 /*************************************************************************
434 * SHMapPIDLToSystemImageListIndex [SHELL32.77]
437 * x pointer to an instance of IShellFolder
440 * exported by ordinal
444 SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh,DWORD y,DWORD z)
445 { FIXME(shell,"(SF=%p,pidl=%08lx,%08lx):stub.\n",sh,y,z);
449 /*************************************************************************
450 * OleStrToStrN [SHELL32.78]
453 * exported by ordinal
455 * wrong implemented OleStr is NOT wide string !!!! (jsch)
458 OleStrToStrN (LPSTR lpMulti, INT32 nMulti, LPCWSTR lpWide, INT32 nWide) {
459 return WideCharToMultiByte (0, 0, lpWide, nWide,
460 lpMulti, nMulti, NULL, NULL);
463 /*************************************************************************
464 * StrToOleStrN [SHELL32.79]
467 * exported by ordinal
469 * wrong implemented OleStr is NOT wide string !!!! (jsch)
472 StrToOleStrN (LPWSTR lpWide, INT32 nWide, LPCSTR lpMulti, INT32 nMulti) {
473 return MultiByteToWideChar (0, 0, lpMulti, nMulti, lpWide, nWide);
476 /*************************************************************************
477 * SHCloneSpecialIDList [SHELL32.89]
481 * nFolder [in] CSIDL_xxxxx ??
486 * exported by ordinal
488 LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND32 hwndOwner,DWORD nFolder,DWORD x3)
489 { LPITEMIDLIST ppidl;
490 WARN(shell,"(hwnd=0x%x,csidl=0x%lx,0x%lx):semi-stub.\n",
491 hwndOwner,nFolder,x3);
493 SHGetSpecialFolderLocation(hwndOwner, nFolder, &ppidl);
498 /*************************************************************************
499 * IsLFNDrive [SHELL32.119]
502 * exported by ordinal Name
504 BOOL32 WINAPI IsLFNDrive(LPCSTR path) {
507 if (!GetVolumeInformation32A(path,NULL,0,NULL,&fnlen,NULL,NULL,0))
512 /*************************************************************************
513 * SHGetSpecialFolderPath [SHELL32.175]
516 * exported by ordinal
518 void WINAPI SHGetSpecialFolderPath(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
519 FIXME(shell,"(0x%04lx,0x%04lx,csidl=0x%04lx,0x%04lx):stub.\n",
524 /*************************************************************************
525 * RegisterShellHook [SHELL32.181]
528 * hwnd [I] window handle
532 * exported by ordinal
534 void WINAPI RegisterShellHook32(HWND32 hwnd, DWORD y) {
535 FIXME(shell,"(0x%08x,0x%08lx):stub.\n",hwnd,y);
538 /*************************************************************************
539 * ShellMessageBoxA [SHELL32.183]
541 * Format and output errormessage.
544 * exported by ordinal
547 ShellMessageBoxA(HMODULE32 hmod,HWND32 hwnd,DWORD id,DWORD x,DWORD type,LPVOID arglist) {
548 char buf[100],buf2[100]/*,*buf3*/;
549 /* LPVOID args = &arglist;*/
551 if (!LoadString32A(hmod,x,buf,100))
552 strcpy(buf,"Desktop");
553 // LoadString32A(hmod,id,buf2,100);
554 /* FIXME: the varargs handling doesn't. */
555 // FormatMessage32A(0x500,buf2,0,0,(LPSTR)&buf3,256,(LPDWORD)&args);
557 FIXME(shell,"(%08lx,%08lx,%08lx(%s),%08lx(%s),%08lx,%p):stub.\n",
558 (DWORD)hmod,(DWORD)hwnd,id,buf2,x,buf,type,arglist
560 /*MessageBox32A(hwnd,buf3,buf,id|0x10000);*/
563 /*************************************************************************
564 * SHRestricted [SHELL32.100]
566 * walks through policy table, queries <app> key, <type> value, returns
567 * queried (DWORD) value.
568 * {0x00001,Explorer,NoRun}
569 * {0x00002,Explorer,NoClose}
570 * {0x00004,Explorer,NoSaveSettings}
571 * {0x00008,Explorer,NoFileMenu}
572 * {0x00010,Explorer,NoSetFolders}
573 * {0x00020,Explorer,NoSetTaskbar}
574 * {0x00040,Explorer,NoDesktop}
575 * {0x00080,Explorer,NoFind}
576 * {0x00100,Explorer,NoDrives}
577 * {0x00200,Explorer,NoDriveAutoRun}
578 * {0x00400,Explorer,NoDriveTypeAutoRun}
579 * {0x00800,Explorer,NoNetHood}
580 * {0x01000,Explorer,NoStartBanner}
581 * {0x02000,Explorer,RestrictRun}
582 * {0x04000,Explorer,NoPrinterTabs}
583 * {0x08000,Explorer,NoDeletePrinter}
584 * {0x10000,Explorer,NoAddPrinter}
585 * {0x20000,Explorer,NoStartMenuSubFolders}
586 * {0x40000,Explorer,MyDocsOnNet}
587 * {0x80000,WinOldApp,NoRealMode}
590 * exported by ordinal
592 DWORD WINAPI SHRestricted (DWORD pol) {
595 FIXME(shell,"(%08lx):stub.\n",pol);
596 if (RegOpenKey32A(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies",&xhkey))
598 /* FIXME: do nothing for now, just return 0 (== "allowed") */
603 /*************************************************************************
604 * PathGetExtension [SHELL32.158]
607 * exported by ordinal
609 LPSTR WINAPI PathGetExtension(LPSTR path,DWORD y,DWORD z)
610 { TRACE(shell,"(%s,%08lx,%08lx)\n",path,y,z);
611 path = PathFindExtension(path);
612 return *path?(path+1):path;
615 /*************************************************************************
616 * SHCreateDirectory [SHELL32.165]
619 * exported by ordinal
620 * not sure about LPSECURITY_ATTRIBUTES
622 DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) {
623 TRACE(shell,"(%p,%s):stub.\n",sec,path);
624 if (CreateDirectory32A(path,sec))
626 /* SHChangeNotify(8,1,path,0); */
629 if (SHELL32_79(path,(LPVOID)x))
631 FIXME(shell,"(%08lx,%s):stub.\n",x,path);
636 /*************************************************************************
637 * SHFree [SHELL32.195]
640 * free_ptr() - frees memory using IMalloc
641 * exported by ordinal
643 DWORD WINAPI SHFree(LPVOID x) {
644 TRACE(shell,"%p\n",x);
645 /*return LocalFree32((HANDLE32)x);*/ /* crashes */
646 return HeapFree(GetProcessHeap(),0,x);
649 /*************************************************************************
650 * SHAlloc [SHELL32.196]
653 * void *task_alloc(DWORD len), uses SHMalloc allocator
654 * exported by ordinal
656 LPVOID WINAPI SHAlloc(DWORD len) {
657 /* void * ret = (LPVOID)LocalAlloc32(len,LMEM_ZEROINIT);*/ /* chrashes */
658 void * ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len);
659 TRACE(shell,"%lu bytes at %p\n",len, ret);
663 /*************************************************************************
664 * OpenRegStream [SHELL32.85]
667 * exported by ordinal
669 DWORD WINAPI OpenRegStream(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
670 FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub.\n",
676 /*************************************************************************
677 * SHRegisterDragDrop [SHELL32.86]
680 * exported by ordinal
682 DWORD WINAPI SHRegisterDragDrop(HWND32 hwnd,DWORD x2) {
683 FIXME (shell, "(0x%08x,0x%08lx):stub.\n", hwnd, x2);
687 /*************************************************************************
688 * SHRevokeDragDrop [SHELL32.87]
691 * exported by ordinal
693 DWORD WINAPI SHRevokeDragDrop(DWORD x) {
694 FIXME(shell,"(0x%08lx):stub.\n",x);
698 /*************************************************************************
699 * RunFileDlg [SHELL32.61]
702 * Original name: RunFileDlg (exported by ordinal)
705 RunFileDlg (HWND32 hwndOwner, DWORD dwParam1, DWORD dwParam2,
706 LPSTR lpszTitle, LPSTR lpszPrompt, UINT32 uFlags)
708 FIXME (shell,"(0x%08x 0x%lx 0x%lx \"%s\" \"%s\" 0x%x):stub.\n",
709 hwndOwner, dwParam1, dwParam2, lpszTitle, lpszPrompt, uFlags);
713 /*************************************************************************
714 * ExitWindowsDialog [SHELL32.60]
717 * exported by ordinal
720 ExitWindowsDialog (HWND32 hwndOwner)
722 FIXME (shell,"(0x%08x):stub.\n", hwndOwner);
726 /*************************************************************************
727 * ArrangeWindows [SHELL32.184]
731 ArrangeWindows (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3,
732 DWORD dwParam4, DWORD dwParam5)
734 FIXME (shell,"(0x%lx 0x%lx 0x%lx 0x%lx 0x%lx):stub.\n",
735 dwParam1, dwParam2, dwParam3, dwParam4, dwParam5);
739 /*************************************************************************
740 * SHCLSIDFromString [SHELL32.147]
743 * exported by ordinal
746 SHCLSIDFromString (DWORD dwParam1, DWORD dwParam2)
748 FIXME (shell,"(0x%lx 0x%lx):stub.\n", dwParam1, dwParam2);
749 FIXME (shell,"(\"%s\" \"%s\"):stub.\n", (LPSTR)dwParam1, (LPSTR)dwParam2);
755 /*************************************************************************
756 * SignalFileOpen [SHELL32.103]
759 * exported by ordinal
762 SignalFileOpen (DWORD dwParam1)
764 FIXME (shell,"(0x%08lx):stub.\n", dwParam1);
769 /*************************************************************************
770 * SHAddToRecentDocs [SHELL32.234]
773 * uFlags [IN] SHARD_PATH or SHARD_PIDL
774 * pv [IN] string or pidl, NULL clears the list
779 DWORD WINAPI SHAddToRecentDocs32 (UINT32 uFlags,LPCVOID pv)
780 { if (SHARD_PIDL==uFlags)
781 { FIXME (shell,"(0x%08x,pidl=%p):stub.\n", uFlags,pv);
784 { FIXME (shell,"(0x%08x,%s):stub.\n", uFlags,(char*)pv);
788 /*************************************************************************
789 * SHFileOperation32 [SHELL32.242]
792 DWORD WINAPI SHFileOperation32(DWORD x)
793 { FIXME(shell,"0x%08lx stub\n",x);
798 /*************************************************************************
799 * SHFileOperation32A [SHELL32.243]
804 DWORD WINAPI SHFileOperation32A (LPSHFILEOPSTRUCT32A lpFileOp)
805 { FIXME (shell,"(%p):stub.\n", lpFileOp);
808 /*************************************************************************
809 * SHFileOperation32W [SHELL32.244]
814 DWORD WINAPI SHFileOperation32W (LPSHFILEOPSTRUCT32W lpFileOp)
815 { FIXME (shell,"(%p):stub.\n", lpFileOp);
819 /*************************************************************************
820 * SHChangeNotify [SHELL32.239]
825 DWORD WINAPI SHChangeNotify32 (
826 INT32 wEventId, /* [IN] flags that specifies the event*/
827 UINT32 uFlags, /* [IN] the meaning of dwItem[1|2]*/
830 { FIXME (shell,"(0x%08x,0x%08ux,%p,%p):stub.\n", wEventId,uFlags,dwItem1,dwItem2);
833 /*************************************************************************
834 * SHCreateShellFolderViewEx [SHELL32.174]
837 * see IShellFolder::CreateViewObject
839 HRESULT WINAPI SHCreateShellFolderViewEx32(
840 LPSHELLVIEWDATA psvcbi, /*[in ] shelltemplate struct*/
841 LPVOID* ppv) /*[out] IShellView pointer*/
842 { FIXME (shell,"(%p,%p):stub.\n", psvcbi,ppv);
845 /*************************************************************************
846 * SHFind_InitMenuPopup [SHELL32.149]
849 * Registers the menu behind the "Start" button
852 * hMenu [in] handel of menu previously created
853 * hWndParent [in] parent window
857 HRESULT WINAPI SHFind_InitMenuPopup (HMENU32 hMenu, HWND32 hWndParent, DWORD w, DWORD x)
858 { FIXME(shell,"hmenu=0x%08x hwnd=0x%08x 0x%08lx 0x%08lx stub\n",
859 hMenu,hWndParent,w,x);
862 /*************************************************************************
863 * FileMenu_InitMenuPopup [SHELL32.109]
866 HRESULT WINAPI FileMenu_InitMenuPopup (DWORD hmenu)
867 { FIXME(shell,"hmenu=0x%lx stub\n",hmenu);
870 /*************************************************************************
871 * FileMenu_Create [SHELL32.114]
873 * w retval from LoadBitmapA
877 HRESULT WINAPI FileMenu_Create (DWORD u, DWORD v, DWORD w, DWORD x, DWORD z)
878 { FIXME(shell,"0x%08lx 0x%08lx hbmp=0x%lx 0x%08lx 0x%08lx stub\n",u,v,w,x,z);
881 /*************************************************************************
882 * FileMenu_TrackPopupMenuEx [SHELL32.116]
885 * uFlags [in] according to TrackPopupMenuEx
889 * z could be rect (trace) or TPMPARAMS (TrackPopupMenuEx)
891 HRESULT WINAPI FileMenu_TrackPopupMenuEx (DWORD t, DWORD uFlags, DWORD posX, DWORD posY, HWND32 hWndParent, DWORD z)
892 { FIXME(shell,"0x%lx flags=0x%lx posx=0x%lx posy=0x%lx hwndp=0x%x 0x%lx stub\n",
893 t,uFlags,posX,posY, hWndParent,z);
896 /*************************************************************************
897 * SHWinHelp [SHELL32.127]
900 HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
901 { FIXME(shell,"0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
904 /*************************************************************************
905 * SHRunControlPanel [SHELL32.161]
908 HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
909 { FIXME(shell,"0x%08lx 0x%08lx stub\n",x,z);
912 /*************************************************************************
913 * ShellExecuteEx [SHELL32.291]
916 BOOL32 WINAPI ShellExecuteEx32A (LPSHELLEXECUTEINFO32A sei)
917 { CHAR szTemp[MAX_PATH];
919 FIXME(shell,"(%p): stub\n",sei);
921 if (sei->fMask & SEE_MASK_IDLIST)
922 { SHGetPathFromIDList32A (sei->lpIDList,szTemp);
923 TRACE (shell,"-- idlist=%p (%s)\n", sei->lpIDList, szTemp);
926 if (sei->fMask & SEE_MASK_CLASSNAME)
927 { TRACE (shell,"-- classname= %s\n", sei->lpClass);
931 { TRACE (shell,"-- action=%s\n", sei->lpVerb);
936 /*************************************************************************
937 * SHSetInstanceExplorer [SHELL32.176]
940 HRESULT WINAPI SHSetInstanceExplorer (DWORD u)
941 { FIXME(shell,"0x%08lx stub\n",u);
944 /*************************************************************************
945 * SHGetInstanceExplorer [SHELL32.256]
950 HRESULT WINAPI SHGetInstanceExplorer (DWORD u)
951 { FIXME(shell,"0x%08lx stub\n",u);
954 /*************************************************************************
955 * SHFreeUnusedLibraries [SHELL32.123]
960 HRESULT WINAPI SHFreeUnusedLibraries (DWORD u)
961 { FIXME(shell,"0x%08lx stub\n",u);
964 /*************************************************************************
965 * DAD_ShowDragImage [SHELL32.137]
970 HRESULT WINAPI DAD_ShowDragImage (DWORD u)
971 { FIXME(shell,"0x%08lx stub\n",u);
974 /*************************************************************************
975 * FileMenu_Destroy [SHELL32.118]
980 HRESULT WINAPI FileMenu_Destroy (DWORD u)
981 { FIXME(shell,"0x%08lx stub\n",u);
984 /*************************************************************************
985 * SHGetDataFromIDListA [SHELL32.247]
988 HRESULT WINAPI SHGetDataFromIDListA(DWORD u, DWORD v, DWORD w, DWORD x, DWORD y)
989 { FIXME(shell,"0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w,x,y);
992 /*************************************************************************
993 * SHRegCloseKey32 [NT4.0:SHELL32.505]
996 HRESULT WINAPI SHRegCloseKey32 (HKEY hkey)
997 { TRACE(shell,"0x%04x\n",hkey);
998 return RegCloseKey( hkey );
1000 /*************************************************************************
1001 * SHRegOpenKey32A [SHELL32.506]
1004 HRESULT WINAPI SHRegOpenKey32A(HKEY hKey, LPSTR lpSubKey, LPHKEY phkResult)
1005 { FIXME(shell,"(0x%08x, %s, %p)\n", hKey, debugstr_a(lpSubKey),
1007 return RegOpenKey32A(hKey, lpSubKey, phkResult);
1010 /*************************************************************************
1011 * SHRegOpenKey32W [NT4.0:SHELL32.507]
1014 HRESULT WINAPI SHRegOpenKey32W (HKEY hkey, LPCWSTR lpszSubKey, LPHKEY retkey)
1015 { WARN(shell,"0x%04x %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
1016 return RegOpenKey32W( hkey, lpszSubKey, retkey );
1018 /*************************************************************************
1019 * SHRegQueryValueExA [SHELL32.509]
1022 HRESULT WINAPI SHRegQueryValueEx32A(DWORD u, LPSTR v, DWORD w, DWORD x,
1024 { FIXME(shell,"0x%04lx %s 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",
1025 u,debugstr_a(v),w,x,y,z);
1028 /*************************************************************************
1029 * SHRegQueryValue32W [NT4.0:SHELL32.510]
1032 HRESULT WINAPI SHRegQueryValue32W (HKEY hkey, LPWSTR lpszSubKey,
1033 LPWSTR lpszData, LPDWORD lpcbData )
1034 { WARN(shell,"0x%04x %s %p %p semi-stub\n",
1035 hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
1036 return RegQueryValue32W( hkey, lpszSubKey, lpszData, lpcbData );
1039 /*************************************************************************
1040 * SHRegQueryValueEx32W [NT4.0:SHELL32.511]
1043 * if the datatype REG_EXPAND_SZ then expand the string and change
1044 * *pdwType to REG_SZ.
1046 HRESULT WINAPI SHRegQueryValueEx32W (HKEY hkey, LPWSTR pszValue, LPDWORD pdwReserved,
1047 LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData)
1049 WARN(shell,"0x%04x %s %p %p %p %p semi-stub\n",
1050 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
1051 ret = RegQueryValueEx32W ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
1055 /*************************************************************************
1056 * ReadCabinetState [NT 4.0:SHELL32.651]
1059 HRESULT WINAPI ReadCabinetState(DWORD u, DWORD v)
1060 { FIXME(shell,"0x%04lx 0x%04lx stub\n",u,v);
1063 /*************************************************************************
1064 * WriteCabinetState [NT 4.0:SHELL32.652]
1067 HRESULT WINAPI WriteCabinetState(DWORD u)
1068 { FIXME(shell,"0x%04lx stub\n",u);
1071 /*************************************************************************
1072 * FileIconInit [SHELL32.660]
1075 BOOL32 WINAPI FileIconInit(BOOL32 bFullInit)
1076 { FIXME(shell,"(%s)\n", bFullInit ? "true" : "false");
1079 /*************************************************************************
1080 * IsUserAdmin [NT 4.0:SHELL32.680]
1083 HRESULT WINAPI IsUserAdmin()
1084 { FIXME(shell,"stub\n");
1087 /*************************************************************************
1088 * StrRetToStrN [SHELL32.96]
1090 * converts a STRRET to a normal string
1093 * FIXME the string handling is to simple (different STRRET choices)
1094 * at the moment only CSTR
1095 * the pidl is for STRRET OFFSET
1097 HRESULT WINAPI StrRetToStrN (LPSTR dest, DWORD len, LPSTRRET src, LPITEMIDLIST x)
1098 { FIXME(shell,"dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,x);
1099 strncpy(dest,src->u.cStr,len);
1103 /*************************************************************************
1104 * StrChrW [NT 4.0:SHELL32.651]
1107 HRESULT WINAPI StrChrW (LPWSTR u, DWORD v)
1108 { FIXME(shell,"%s 0x%lx stub\n",debugstr_w(u),v);
1111 /*************************************************************************
1112 * SHAllocShared [SHELL32.520]
1115 * parameter1 is return value from HeapAlloc
1116 * parameter2 is equal to the size allocated with HeapAlloc
1117 * parameter3 is return value from GetCurrentProcessId
1119 * the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
1120 * WM_USER+2 could be the undocumented CWM_SETPATH
1121 * the allocated memory contains a pidl
1123 HGLOBAL32 WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
1127 TRACE(shell,"ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID);
1128 hmem = GlobalAlloc32(GMEM_FIXED, size);
1132 pmem = GlobalLock32 (hmem);
1137 memcpy (pmem, psrc, size);
1138 GlobalUnlock32(hmem);
1141 /*************************************************************************
1142 * SHLockShared [SHELL32.521]
1145 * parameter1 is return value from SHAllocShared
1146 * parameter2 is return value from GetCurrentProcessId
1147 * the receiver of (WM_USER+2) trys to lock the HANDLE (?)
1148 * the returnvalue seems to be a memoryadress
1150 void * WINAPI SHLockShared(HANDLE32 hmem, DWORD procID)
1151 { TRACE(shell,"handle=0x%04x procID=0x%04lx\n",hmem,procID);
1152 return GlobalLock32(hmem);
1154 /*************************************************************************
1155 * SHUnlockShared [SHELL32.522]
1158 * parameter1 is return value from SHLockShared
1160 BOOL32 WINAPI SHUnlockShared(HANDLE32 pmem)
1161 { TRACE(shell,"handle=0x%04x\n",pmem);
1162 return GlobalUnlock32(pmem);
1164 /*************************************************************************
1165 * SHFreeShared [SHELL32.523]
1168 * parameter1 is return value from SHAllocShared
1169 * parameter2 is return value from GetCurrentProcessId
1171 HANDLE32 WINAPI SHFreeShared(HANDLE32 hmem, DWORD procID)
1172 { TRACE(shell,"handle=0x%04x 0x%04lx\n",hmem,procID);
1173 return GlobalFree32(hmem);
1176 /*************************************************************************
1177 * SetAppStartingCursor32 [SHELL32.99]
1180 HRESULT WINAPI SetAppStartingCursor32(DWORD u, DWORD v)
1181 { FIXME(shell,"0x%04lx 0x%04lx stub\n",u,v );
1184 /*************************************************************************
1185 * SHLoadOLE32 [SHELL32.151]
1188 HRESULT WINAPI SHLoadOLE32(DWORD u)
1189 { FIXME(shell,"0x%04lx stub\n",u);
1192 /*************************************************************************
1193 * Shell_MergeMenus32 [SHELL32.67]
1196 BOOL32 _SHIsMenuSeparator(HMENU32 hm, int i)
1198 MENUITEMINFO32A mii;
1200 mii.cbSize = sizeof(MENUITEMINFO32A);
1201 mii.fMask = MIIM_TYPE;
1202 mii.cch = 0; /* WARNING: We MUST initialize it to 0*/
1203 if (!GetMenuItemInfo32A(hm, i, TRUE, &mii))
1207 if (mii.fType & MFT_SEPARATOR)
1213 #define MM_ADDSEPARATOR 0x00000001L
1214 #define MM_SUBMENUSHAVEIDS 0x00000002L
1215 HRESULT WINAPI Shell_MergeMenus32 (HMENU32 hmDst, HMENU32 hmSrc, UINT32 uInsert, UINT32 uIDAdjust, UINT32 uIDAdjustMax, ULONG uFlags)
1218 BOOL32 bAlreadySeparated;
1219 MENUITEMINFO32A miiSrc;
1221 UINT32 uTemp, uIDMax = uIDAdjust;
1223 FIXME(shell,"hmenu1=0x%04x hmenu2=0x%04x 0x%04x 0x%04x 0x%04x 0x%04lx stub\n",
1224 hmDst, hmSrc, uInsert, uIDAdjust, uIDAdjustMax, uFlags);
1226 if (!hmDst || !hmSrc)
1230 nItem = GetMenuItemCount32(hmDst);
1231 if (uInsert >= (UINT32)nItem)
1232 { uInsert = (UINT32)nItem;
1233 bAlreadySeparated = TRUE;
1236 { bAlreadySeparated = _SHIsMenuSeparator(hmDst, uInsert);;
1238 if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
1239 { /* Add a separator between the menus */
1240 InsertMenu32A(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
1241 bAlreadySeparated = TRUE;
1245 /* Go through the menu items and clone them*/
1246 for (nItem = GetMenuItemCount32(hmSrc) - 1; nItem >= 0; nItem--)
1247 { miiSrc.cbSize = sizeof(MENUITEMINFO32A);
1248 miiSrc.fMask = MIIM_STATE | MIIM_ID | MIIM_SUBMENU | MIIM_CHECKMARKS | MIIM_TYPE | MIIM_DATA;
1249 /* We need to reset this every time through the loop in case
1250 menus DON'T have IDs*/
1251 miiSrc.fType = MFT_STRING;
1252 miiSrc.dwTypeData = szName;
1253 miiSrc.dwItemData = 0;
1254 miiSrc.cch = sizeof(szName);
1256 if (!GetMenuItemInfo32A(hmSrc, nItem, TRUE, &miiSrc))
1259 if (miiSrc.fType & MFT_SEPARATOR)
1260 { /* This is a separator; don't put two of them in a row*/
1261 if (bAlreadySeparated)
1264 bAlreadySeparated = TRUE;
1266 else if (miiSrc.hSubMenu)
1267 { if (uFlags & MM_SUBMENUSHAVEIDS)
1268 { /* Adjust the ID and check it*/
1269 miiSrc.wID += uIDAdjust;
1270 if (miiSrc.wID > uIDAdjustMax)
1273 if (uIDMax <= miiSrc.wID)
1274 { uIDMax = miiSrc.wID + 1;
1278 { /* Don't set IDs for submenus that didn't have them already */
1279 miiSrc.fMask &= ~MIIM_ID;
1281 hmSubMenu = miiSrc.hSubMenu;
1282 miiSrc.hSubMenu = CreatePopupMenu32();
1283 if (!miiSrc.hSubMenu)
1286 uTemp = Shell_MergeMenus32(miiSrc.hSubMenu, hmSubMenu, 0, uIDAdjust, uIDAdjustMax, uFlags&MM_SUBMENUSHAVEIDS);
1287 if (uIDMax <= uTemp)
1290 bAlreadySeparated = FALSE;
1293 { /* Adjust the ID and check it*/
1294 miiSrc.wID += uIDAdjust;
1295 if (miiSrc.wID > uIDAdjustMax)
1298 if (uIDMax <= miiSrc.wID)
1299 { uIDMax = miiSrc.wID + 1;
1301 bAlreadySeparated = FALSE;
1303 if (!InsertMenuItem32A(hmDst, uInsert, TRUE, &miiSrc))
1308 /* Ensure the correct number of separators at the beginning of the
1309 inserted menu items*/
1311 { if (bAlreadySeparated)
1312 { DeleteMenu32(hmDst, uInsert, MF_BYPOSITION);
1316 { if (_SHIsMenuSeparator(hmDst, uInsert-1))
1317 { if (bAlreadySeparated)
1318 { DeleteMenu32(hmDst, uInsert, MF_BYPOSITION);
1322 { if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
1323 { /* Add a separator between the menus*/
1324 InsertMenu32A(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
1331 /*************************************************************************
1332 * PathGetDriveNumber32 [SHELL32.57]
1335 HRESULT WINAPI PathGetDriveNumber32(LPSTR u)
1336 { FIXME(shell,"%s stub\n",debugstr_a(u));
1339 /*************************************************************************
1340 * DriveType32 [SHELL32.64]
1343 HRESULT WINAPI DriveType32(DWORD u)
1344 { FIXME(shell,"0x%04lx stub\n",u);
1347 /*************************************************************************
1348 * SHAbortInvokeCommand [SHELL32.198]
1351 HRESULT WINAPI SHAbortInvokeCommand()
1352 { FIXME(shell,"stub\n");
1355 /*************************************************************************
1356 * SHOutOfMemoryMessageBox [SHELL32.126]
1359 HRESULT WINAPI SHOutOfMemoryMessageBox(DWORD u, DWORD v, DWORD w)
1360 { FIXME(shell,"0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w);
1363 /*************************************************************************
1364 * SHFlushClipboard [SHELL32.121]
1367 HRESULT WINAPI SHFlushClipboard()
1368 { FIXME(shell,"stub\n");