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,LONG x2)
60 { FIXME(shell,"(0x%08lx,0x%08lx):stub.\n",x1,x2);
64 /*************************************************************************
65 * PathIsRoot [SHELL32.29]
67 BOOL32 WINAPI PathIsRoot32A(LPCSTR x)
68 { TRACE(shell,"%s\n",x);
69 if (*(x+1)==':' && *(x+2)=='\\') /* "X:\" */
71 if (*x=='\\') /* "\" */
73 if (x[0]=='\\' && x[1]=='\\') /* UNC "\\<xx>\" */
74 { int foundbackslash = 0;
80 if (foundbackslash<=1) /* max 1 \ more ... */
85 BOOL32 WINAPI PathIsRoot32W(LPCWSTR x)
86 { TRACE(shell,"%s\n",debugstr_w(x));
87 if (*(x+1)==':' && *(x+2)=='\\') /* "X:\" */
89 if (*x == (WCHAR) '\\') /* "\" */
91 if (x[0]==(WCHAR)'\\' && x[1]==(WCHAR)'\\') /* UNC "\\<xx>\" */
92 { int foundbackslash = 0;
95 { if (*x++==(WCHAR)'\\')
98 if (foundbackslash<=1) /* max 1 \ more ... */
103 BOOL32 WINAPI PathIsRoot32AW(LPCVOID x)
104 { if (VERSION_OsIsUnicode())
105 return PathIsRoot32W(x);
106 return PathIsRoot32A(x);
109 /*************************************************************************
110 * PathBuildRoot [SHELL32.30]
112 LPSTR WINAPI PathBuildRoot(LPSTR root,BYTE drive) {
113 TRACE(shell,"%p %i\n",root, drive);
119 /*************************************************************************
120 * PathFindExtension [SHELL32.31]
123 * returns pointer to last . in last pathcomponent or at \0.
125 LPCSTR WINAPI PathFindExtension32A(LPCSTR path)
126 { LPCSTR lastpoint = NULL;
127 TRACE(shell,"%p %s\n",path,path);
129 { if (*path=='\\'||*path==' ')
135 return lastpoint?lastpoint:path;
137 LPCWSTR WINAPI PathFindExtension32W(LPCWSTR path)
138 { LPCWSTR lastpoint = NULL;
139 TRACE(shell,"%p L%s\n",path,debugstr_w(path));
141 { if (*path==(WCHAR)'\\'||*path==(WCHAR)' ')
143 if (*path==(WCHAR)'.')
147 return lastpoint?lastpoint:path;
149 LPCVOID WINAPI PathFindExtension32AW(LPCVOID path)
150 { if (VERSION_OsIsUnicode())
151 return PathFindExtension32W(path);
152 return PathFindExtension32A(path);
156 /*************************************************************************
157 * PathAddBackslash [SHELL32.32]
160 * append \ if there is none
162 LPSTR WINAPI PathAddBackslash32A(LPSTR path)
164 TRACE(shell,"%p->%s\n",path,path);
167 if (len && path[len-1]!='\\')
174 LPWSTR WINAPI PathAddBackslash32W(LPWSTR path)
176 TRACE(shell,"%p->%s\n",path,debugstr_w(path));
178 len = lstrlen32W(path);
179 if (len && path[len-1]!=(WCHAR)'\\')
180 { path[len] = (WCHAR)'\\';
186 LPVOID WINAPI PathAddBackslash32AW(LPVOID path)
187 { if(VERSION_OsIsUnicode())
188 return PathAddBackslash32W(path);
189 return PathAddBackslash32A(path);
192 /*************************************************************************
193 * PathRemoveBlanks [SHELL32.33]
196 * remove spaces from beginning and end of passed string
198 LPSTR WINAPI PathRemoveBlanks(LPSTR str)
200 TRACE(shell,"%s\n",str);
215 /*************************************************************************
216 * PathFindFilename [SHELL32.34]
219 * basename(char *fn);
221 LPVOID WINAPI PathFindFilename(LPVOID fn)
225 if(VERSION_OsIsUnicode())
226 { wslash = wptr = (LPWSTR) fn;
227 TRACE(shell,"L%s\n",debugstr_w(wslash));
229 { if (((wptr[0]=='\\') || (wptr[0]==':')) && wptr[1] && wptr[1]!='\\')
233 return (LPVOID) wslash;
235 aslash = aptr = (LPSTR) fn;
236 TRACE(shell,"%s\n",aslash);
238 { if (((aptr[0]=='\\') || (aptr[0]==':')) && aptr[1] && aptr[1]!='\\')
242 return (LPVOID) aslash;
245 /*************************************************************************
246 * PathRemoveFileSpec [SHELL32.35]
249 * bool getpath(char *pathname); truncates passed argument to a valid path
250 * returns if the string was modified or not.
251 * "\foo\xx\foo"-> "\foo\xx"
255 DWORD WINAPI PathRemoveFileSpec(LPSTR fn) {
257 TRACE(shell,"%s\n",fn);
271 continue; /* already x++ed */
289 /*************************************************************************
290 * PathAppend [SHELL32.36]
293 * concat_paths(char*target,const char*add);
294 * concats "target\\add" and writes them to target
296 LPSTR WINAPI PathAppend(LPSTR x1,LPSTR x2) {
297 TRACE(shell,"%s %s\n",x1,x2);
298 while (x2[0]=='\\') x2++;
299 return PathCombine32A(x1,x1,x2);
302 /*************************************************************************
303 * PathCombine [SHELL32.37]
306 * if lpszFile='.' skip it
307 * szDest can be equal to lpszFile. Thats why we use sTemp
309 LPSTR WINAPI PathCombine32A(LPSTR szDest, LPCSTR lpszDir, LPCSTR lpszFile)
310 { char sTemp[MAX_PATH];
311 TRACE(shell,"%p %p->%s %p->%s\n",szDest, lpszDir, lpszDir, lpszFile, lpszFile);
314 if (!lpszFile || !lpszFile[0] || (lpszFile[0]=='.' && !lpszFile[1]) )
315 { strcpy(szDest,lpszDir);
319 /* if lpszFile is a complete path don't care about lpszDir */
320 if (PathIsRoot32A(lpszFile))
321 { strcpy(szDest,lpszFile);
323 strcpy(sTemp,lpszDir);
324 PathAddBackslash32A(sTemp);
325 strcat(sTemp,lpszFile);
326 strcpy(szDest,sTemp);
329 LPWSTR WINAPI PathCombine32W(LPWSTR szDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
330 { WCHAR sTemp[MAX_PATH];
331 TRACE(shell,"%p %p->%s %p->%s\n",szDest, lpszDir, debugstr_w(lpszDir),
332 lpszFile, debugstr_w(lpszFile));
335 if (!lpszFile || !lpszFile[0] || (lpszFile[0]==(WCHAR)'.' && !lpszFile[1]) )
336 { lstrcpy32W(szDest,lpszDir);
340 /* if lpszFile is a complete path don't care about lpszDir */
341 if (PathIsRoot32W(lpszFile))
342 { lstrcpy32W(szDest,lpszFile);
344 lstrcpy32W(sTemp,lpszDir);
345 PathAddBackslash32W(sTemp);
346 lstrcat32W(sTemp,lpszFile);
347 lstrcpy32W(szDest,sTemp);
350 LPVOID WINAPI PathCombine32AW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile)
351 { if (VERSION_OsIsUnicode())
352 return PathCombine32W( szDest, lpszDir, lpszFile );
353 return PathCombine32A( szDest, lpszDir, lpszFile );
356 /*************************************************************************
357 * PathIsUNC [SHELL32.39]
360 * PathIsUNC(char*path);
362 BOOL32 WINAPI PathIsUNC(LPCSTR path) {
363 TRACE(shell,"%s\n",path);
364 if ((path[0]=='\\') && (path[1]=='\\'))
368 /*************************************************************************
369 * PathIsExe [SHELL32.43]
372 BOOL32 WINAPI PathIsExe (LPCSTR path)
373 { TRACE(shell,"path=%s\n",path);
377 /*************************************************************************
378 * PathFileExists [SHELL32.45]
381 * file_exists(char *fn);
383 BOOL32 WINAPI PathFileExists(LPSTR fn) {
384 TRACE(shell,"%s\n",fn);
385 if (GetFileAttributes32A(fn)==-1)
390 /*************************************************************************
391 * PathMatchSpec [SHELL32.46]
397 BOOL32 WINAPI PathMatchSpec(LPSTR x, LPSTR y)
398 { FIXME(shell,"%s %s stub\n",x,y);
402 /*************************************************************************
403 * PathResolve [SHELL32.51]
405 DWORD WINAPI PathResolve(LPCSTR s,DWORD x2,DWORD x3) {
406 FIXME(shell,"(%s,0x%08lx,0x%08lx),stub!\n",s,x2,x3);
410 /*************************************************************************
411 * PathGetArgs [SHELL32.52]
414 * look for next arg in string. handle "quoted" strings
415 * returns pointer to argument *AFTER* the space. Or to the \0.
417 LPVOID WINAPI PathGetArgs(LPVOID cmdline)
418 { BOOL32 qflag = FALSE;
422 if (VERSION_OsIsUnicode())
423 { TRACE(shell,"%sL\n",debugstr_w((LPWSTR)cmdline));
424 wptr=(LPWSTR) cmdline;
426 { if ((*wptr==' ') && !qflag)
432 return (LPVOID) wptr;
434 TRACE(shell,"%s\n",(LPSTR)cmdline);
435 aptr=(LPSTR) cmdline;
437 { if ((*aptr==' ') && !qflag)
443 return (LPVOID) aptr;
446 /*************************************************************************
447 * PathUnquoteSpaces [SHELL32.56]
450 * unquote string (remove ")
452 VOID WINAPI PathUnquoteSpaces(LPSTR str) {
453 DWORD len = lstrlen32A(str);
454 TRACE(shell,"%s\n",str);
455 if (*str!='"') return;
456 if (str[len-1]!='"') return;
458 lstrcpy32A(str,str+1);
462 /*************************************************************************
463 * ParseField [SHELL32.58]
466 DWORD WINAPI ParseField(LPCSTR src,DWORD x2,LPSTR target,DWORD pathlen) {
467 FIXME(shell,"(%s,0x%08lx,%p,%ld):stub.\n",
468 src,x2,target,pathlen
475 /*************************************************************************
476 * PickIconDlg [SHELL32.62]
479 DWORD WINAPI PickIconDlg(DWORD x,DWORD y,DWORD z,DWORD a) {
480 FIXME(shell,"(%08lx,%08lx,%08lx,%08lx):stub.\n",x,y,z,a);
484 /*************************************************************************
485 * GetFileNameFromBrowse [SHELL32.63]
488 DWORD WINAPI GetFileNameFromBrowse(HWND32 howner, LPSTR targetbuf, DWORD len, DWORD x, LPCSTR suffix, LPCSTR y, LPCSTR cmd) {
489 FIXME(shell,"(%04x,%p,%ld,%08lx,%s,%s,%s):stub.\n",
490 howner,targetbuf,len,x,suffix,y,cmd
492 /* puts up a Open Dialog and requests input into targetbuf */
493 /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
494 lstrcpy32A(targetbuf,"x:\\s3.exe");
498 /*************************************************************************
499 * SHGetSettings [SHELL32.68]
502 DWORD WINAPI SHGetSettings(DWORD x,DWORD y,DWORD z) {
503 FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx):stub.\n",
509 /*************************************************************************
510 * Shell_GetCachedImageIndex [SHELL32.72]
513 void WINAPI Shell_GetCachedImageIndex(LPVOID x,DWORD y,DWORD z)
514 { if( VERSION_OsIsUnicode())
515 { FIXME(shell,"(L%s,%08lx,%08lx):stub.\n",debugstr_w((LPWSTR)x),y,z);
518 { FIXME(shell,"(%s,%08lx,%08lx):stub.\n",debugstr_a((LPSTR)x),y,z);
522 /*************************************************************************
523 * SHShellFolderView_Message [SHELL32.73]
526 * hwndCabinet defines the explorer cabinet window that contains the
527 * shellview you need to communicate with
528 * uMsg identifying the SFVM enum to perform
532 * Message SFVM_REARRANGE = 1
533 * This message gets sent when a column gets clicked to instruct the
534 * shell view to re-sort the item list. lParam identifies the column
537 int WINAPI SHShellFolderView_Message(HWND32 hwndCabinet,UINT32 uMsg,LPARAM lParam)
538 { FIXME(shell,"%04x %08ux %08lx stub\n",hwndCabinet,uMsg,lParam);
542 /*************************************************************************
543 * PathYetAnotherMakeUniqueName [SHELL32.75]
546 * exported by ordinal
548 BOOL32 WINAPI PathYetAnotherMakeUniqueName(LPDWORD x,LPDWORD y) {
549 FIXME(shell,"(%p,%p):stub.\n",x,y);
553 /*************************************************************************
554 * SHMapPIDLToSystemImageListIndex [SHELL32.77]
557 * x pointer to an instance of IShellFolder
560 * exported by ordinal
564 SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh,DWORD y,DWORD z)
565 { FIXME(shell,"(SF=%p,pidl=%08lx,%08lx):stub.\n",sh,y,z);
569 /*************************************************************************
570 * OleStrToStrN [SHELL32.78]
573 * exported by ordinal
575 * wrong implemented OleStr is NOT wide string !!!! (jsch)
578 OleStrToStrN (LPSTR lpMulti, INT32 nMulti, LPCWSTR lpWide, INT32 nWide) {
579 return WideCharToMultiByte (0, 0, lpWide, nWide,
580 lpMulti, nMulti, NULL, NULL);
583 /*************************************************************************
584 * StrToOleStrN [SHELL32.79]
587 * exported by ordinal
589 * wrong implemented OleStr is NOT wide string !!!! (jsch)
592 StrToOleStrN (LPWSTR lpWide, INT32 nWide, LPCSTR lpMulti, INT32 nMulti) {
593 return MultiByteToWideChar (0, 0, lpMulti, nMulti, lpWide, nWide);
596 /*************************************************************************
597 * SHCloneSpecialIDList [SHELL32.89]
601 * nFolder [in] CSIDL_xxxxx ??
606 * exported by ordinal
608 LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND32 hwndOwner,DWORD nFolder,DWORD x3)
609 { LPITEMIDLIST ppidl;
610 WARN(shell,"(hwnd=0x%x,csidl=0x%lx,0x%lx):semi-stub.\n",
611 hwndOwner,nFolder,x3);
613 SHGetSpecialFolderLocation(hwndOwner, nFolder, &ppidl);
618 /*************************************************************************
619 * IsLFNDrive [SHELL32.119]
622 * exported by ordinal Name
624 BOOL32 WINAPI IsLFNDrive(LPCSTR path) {
627 if (!GetVolumeInformation32A(path,NULL,0,NULL,&fnlen,NULL,NULL,0))
632 /*************************************************************************
633 * SHGetSpecialFolderPath [SHELL32.175]
636 * exported by ordinal
638 void WINAPI SHGetSpecialFolderPath(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
639 FIXME(shell,"(0x%04lx,0x%04lx,csidl=0x%04lx,0x%04lx):stub.\n",
644 /*************************************************************************
645 * RegisterShellHook [SHELL32.181]
648 * hwnd [I] window handle
652 * exported by ordinal
654 void WINAPI RegisterShellHook32(HWND32 hwnd, DWORD y) {
655 FIXME(shell,"(0x%08x,0x%08lx):stub.\n",hwnd,y);
658 /*************************************************************************
659 * ShellMessageBoxA [SHELL32.183]
661 * Format and output errormessage.
664 * exported by ordinal
667 ShellMessageBoxA(HMODULE32 hmod,HWND32 hwnd,DWORD id,DWORD x,DWORD type,LPVOID arglist) {
668 char buf[100],buf2[100]/*,*buf3*/;
669 /* LPVOID args = &arglist;*/
671 if (!LoadString32A(hmod,x,buf,100))
672 strcpy(buf,"Desktop");
673 // LoadString32A(hmod,id,buf2,100);
674 /* FIXME: the varargs handling doesn't. */
675 // FormatMessage32A(0x500,buf2,0,0,(LPSTR)&buf3,256,(LPDWORD)&args);
677 FIXME(shell,"(%08lx,%08lx,%08lx(%s),%08lx(%s),%08lx,%p):stub.\n",
678 (DWORD)hmod,(DWORD)hwnd,id,buf2,x,buf,type,arglist
680 /*MessageBox32A(hwnd,buf3,buf,id|0x10000);*/
683 /*************************************************************************
684 * SHRestricted [SHELL32.100]
686 * walks through policy table, queries <app> key, <type> value, returns
687 * queried (DWORD) value.
688 * {0x00001,Explorer,NoRun}
689 * {0x00002,Explorer,NoClose}
690 * {0x00004,Explorer,NoSaveSettings}
691 * {0x00008,Explorer,NoFileMenu}
692 * {0x00010,Explorer,NoSetFolders}
693 * {0x00020,Explorer,NoSetTaskbar}
694 * {0x00040,Explorer,NoDesktop}
695 * {0x00080,Explorer,NoFind}
696 * {0x00100,Explorer,NoDrives}
697 * {0x00200,Explorer,NoDriveAutoRun}
698 * {0x00400,Explorer,NoDriveTypeAutoRun}
699 * {0x00800,Explorer,NoNetHood}
700 * {0x01000,Explorer,NoStartBanner}
701 * {0x02000,Explorer,RestrictRun}
702 * {0x04000,Explorer,NoPrinterTabs}
703 * {0x08000,Explorer,NoDeletePrinter}
704 * {0x10000,Explorer,NoAddPrinter}
705 * {0x20000,Explorer,NoStartMenuSubFolders}
706 * {0x40000,Explorer,MyDocsOnNet}
707 * {0x80000,WinOldApp,NoRealMode}
710 * exported by ordinal
712 DWORD WINAPI SHRestricted (DWORD pol) {
715 FIXME(shell,"(%08lx):stub.\n",pol);
716 if (RegOpenKey32A(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies",&xhkey))
718 /* FIXME: do nothing for now, just return 0 (== "allowed") */
723 /*************************************************************************
724 * PathGetExtension [SHELL32.158]
727 * exported by ordinal
729 LPCSTR WINAPI PathGetExtension32A(LPCSTR path,DWORD y,DWORD z)
730 { TRACE(shell,"(%s,%08lx,%08lx)\n",path,y,z);
731 path = PathFindExtension32A(path);
732 return *path?(path+1):path;
734 LPCWSTR WINAPI PathGetExtension32W(LPCWSTR path,DWORD y,DWORD z)
735 { TRACE(shell,"(L%s,%08lx,%08lx)\n",debugstr_w(path),y,z);
736 path = PathFindExtension32W(path);
737 return *path?(path+1):path;
739 LPCVOID WINAPI PathGetExtension32AW(LPCVOID path,DWORD y,DWORD z)
740 { if (VERSION_OsIsUnicode())
741 return PathGetExtension32W(path,y,z);
742 return PathGetExtension32A(path,y,z);
746 /*************************************************************************
747 * SHCreateDirectory [SHELL32.165]
750 * exported by ordinal
751 * not sure about LPSECURITY_ATTRIBUTES
753 DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) {
754 TRACE(shell,"(%p,%s):stub.\n",sec,path);
755 if (CreateDirectory32A(path,sec))
757 /* SHChangeNotify(8,1,path,0); */
760 if (SHELL32_79(path,(LPVOID)x))
762 FIXME(shell,"(%08lx,%s):stub.\n",x,path);
767 /*************************************************************************
768 * SHFree [SHELL32.195]
771 * free_ptr() - frees memory using IMalloc
772 * exported by ordinal
774 DWORD WINAPI SHFree(LPVOID x) {
775 TRACE(shell,"%p\n",x);
776 /*return LocalFree32((HANDLE32)x);*/ /* crashes */
777 return HeapFree(GetProcessHeap(),0,x);
780 /*************************************************************************
781 * SHAlloc [SHELL32.196]
784 * void *task_alloc(DWORD len), uses SHMalloc allocator
785 * exported by ordinal
787 LPVOID WINAPI SHAlloc(DWORD len) {
788 /* void * ret = (LPVOID)LocalAlloc32(len,LMEM_ZEROINIT);*/ /* chrashes */
789 void * ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len);
790 TRACE(shell,"%lu bytes at %p\n",len, ret);
794 /*************************************************************************
795 * OpenRegStream [SHELL32.85]
798 * exported by ordinal
800 DWORD WINAPI OpenRegStream(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
801 FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub.\n",
807 /*************************************************************************
808 * SHRegisterDragDrop [SHELL32.86]
811 * exported by ordinal
813 DWORD WINAPI SHRegisterDragDrop(HWND32 hwnd,DWORD x2) {
814 FIXME (shell, "(0x%08x,0x%08lx):stub.\n", hwnd, x2);
818 /*************************************************************************
819 * SHRevokeDragDrop [SHELL32.87]
822 * exported by ordinal
824 DWORD WINAPI SHRevokeDragDrop(DWORD x) {
825 FIXME(shell,"(0x%08lx):stub.\n",x);
829 /*************************************************************************
830 * RunFileDlg [SHELL32.61]
833 * Original name: RunFileDlg (exported by ordinal)
836 RunFileDlg (HWND32 hwndOwner, DWORD dwParam1, DWORD dwParam2,
837 LPSTR lpszTitle, LPSTR lpszPrompt, UINT32 uFlags)
839 FIXME (shell,"(0x%08x 0x%lx 0x%lx \"%s\" \"%s\" 0x%x):stub.\n",
840 hwndOwner, dwParam1, dwParam2, lpszTitle, lpszPrompt, uFlags);
844 /*************************************************************************
845 * ExitWindowsDialog [SHELL32.60]
848 * exported by ordinal
851 ExitWindowsDialog (HWND32 hwndOwner)
853 FIXME (shell,"(0x%08x):stub.\n", hwndOwner);
857 /*************************************************************************
858 * ArrangeWindows [SHELL32.184]
862 ArrangeWindows (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3,
863 DWORD dwParam4, DWORD dwParam5)
865 FIXME (shell,"(0x%lx 0x%lx 0x%lx 0x%lx 0x%lx):stub.\n",
866 dwParam1, dwParam2, dwParam3, dwParam4, dwParam5);
870 /*************************************************************************
871 * SHCLSIDFromString [SHELL32.147]
874 * exported by ordinal
877 SHCLSIDFromString (DWORD dwParam1, DWORD dwParam2)
879 FIXME (shell,"(0x%lx 0x%lx):stub.\n", dwParam1, dwParam2);
880 FIXME (shell,"(\"%s\" \"%s\"):stub.\n", (LPSTR)dwParam1, (LPSTR)dwParam2);
886 /*************************************************************************
887 * SignalFileOpen [SHELL32.103]
890 * exported by ordinal
893 SignalFileOpen (DWORD dwParam1)
895 FIXME (shell,"(0x%08lx):stub.\n", dwParam1);
900 /*************************************************************************
901 * SHAddToRecentDocs [SHELL32.234]
904 * uFlags [IN] SHARD_PATH or SHARD_PIDL
905 * pv [IN] string or pidl, NULL clears the list
910 DWORD WINAPI SHAddToRecentDocs32 (UINT32 uFlags,LPCVOID pv)
911 { if (SHARD_PIDL==uFlags)
912 { FIXME (shell,"(0x%08x,pidl=%p):stub.\n", uFlags,pv);
915 { FIXME (shell,"(0x%08x,%s):stub.\n", uFlags,(char*)pv);
919 /*************************************************************************
920 * SHFileOperation32 [SHELL32.242]
923 DWORD WINAPI SHFileOperation32(DWORD x)
924 { FIXME(shell,"0x%08lx stub\n",x);
929 /*************************************************************************
930 * SHFileOperation32A [SHELL32.243]
935 DWORD WINAPI SHFileOperation32A (LPSHFILEOPSTRUCT32A lpFileOp)
936 { FIXME (shell,"(%p):stub.\n", lpFileOp);
939 /*************************************************************************
940 * SHFileOperation32W [SHELL32.244]
945 DWORD WINAPI SHFileOperation32W (LPSHFILEOPSTRUCT32W lpFileOp)
946 { FIXME (shell,"(%p):stub.\n", lpFileOp);
950 /*************************************************************************
951 * SHChangeNotify [SHELL32.239]
956 DWORD WINAPI SHChangeNotify32 (
957 INT32 wEventId, /* [IN] flags that specifies the event*/
958 UINT32 uFlags, /* [IN] the meaning of dwItem[1|2]*/
961 { FIXME (shell,"(0x%08x,0x%08ux,%p,%p):stub.\n", wEventId,uFlags,dwItem1,dwItem2);
964 /*************************************************************************
965 * SHCreateShellFolderViewEx [SHELL32.174]
968 * see IShellFolder::CreateViewObject
970 HRESULT WINAPI SHCreateShellFolderViewEx32(
971 LPSHELLVIEWDATA psvcbi, /*[in ] shelltemplate struct*/
972 LPVOID* ppv) /*[out] IShellView pointer*/
973 { FIXME (shell,"(%p,%p):stub.\n", psvcbi,ppv);
976 /*************************************************************************
977 * SHFind_InitMenuPopup [SHELL32.149]
980 * Registers the menu behind the "Start" button
983 * hMenu [in] handel of menu previously created
984 * hWndParent [in] parent window
988 HRESULT WINAPI SHFind_InitMenuPopup (HMENU32 hMenu, HWND32 hWndParent, DWORD w, DWORD x)
989 { FIXME(shell,"hmenu=0x%08x hwnd=0x%08x 0x%08lx 0x%08lx stub\n",
990 hMenu,hWndParent,w,x);
993 /*************************************************************************
994 * FileMenu_InitMenuPopup [SHELL32.109]
997 HRESULT WINAPI FileMenu_InitMenuPopup (DWORD hmenu)
998 { FIXME(shell,"hmenu=0x%lx stub\n",hmenu);
1001 /*************************************************************************
1002 * FileMenu_Create [SHELL32.114]
1004 * w retval from LoadBitmapA
1008 HRESULT WINAPI FileMenu_Create (DWORD u, DWORD v, DWORD w, DWORD x, DWORD z)
1009 { FIXME(shell,"0x%08lx 0x%08lx hbmp=0x%lx 0x%08lx 0x%08lx stub\n",u,v,w,x,z);
1012 /*************************************************************************
1013 * FileMenu_TrackPopupMenuEx [SHELL32.116]
1016 * uFlags [in] according to TrackPopupMenuEx
1020 * z could be rect (trace) or TPMPARAMS (TrackPopupMenuEx)
1022 HRESULT WINAPI FileMenu_TrackPopupMenuEx (DWORD t, DWORD uFlags, DWORD posX, DWORD posY, HWND32 hWndParent, DWORD z)
1023 { FIXME(shell,"0x%lx flags=0x%lx posx=0x%lx posy=0x%lx hwndp=0x%x 0x%lx stub\n",
1024 t,uFlags,posX,posY, hWndParent,z);
1027 /*************************************************************************
1028 * SHWinHelp [SHELL32.127]
1031 HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
1032 { FIXME(shell,"0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
1035 /*************************************************************************
1036 * SHRunControlPanel [SHELL32.161]
1039 HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
1040 { FIXME(shell,"0x%08lx 0x%08lx stub\n",x,z);
1043 /*************************************************************************
1044 * SHSimpleIDListFromPath [SHELL32.162]
1047 LPITEMIDLIST WINAPI SHSimpleIDListFromPath (LPCSTR lpszPath)
1049 FIXME(shell,"(%s): stub\n",lpszPath);
1052 /*************************************************************************
1053 * ShellExecuteEx [SHELL32.291]
1056 BOOL32 WINAPI ShellExecuteEx32A (LPSHELLEXECUTEINFO32A sei)
1057 { CHAR szTemp[MAX_PATH];
1059 FIXME(shell,"(%p): stub\n",sei);
1061 if (sei->fMask & SEE_MASK_IDLIST)
1062 { SHGetPathFromIDList32A (sei->lpIDList,szTemp);
1063 TRACE (shell,"-- idlist=%p (%s)\n", sei->lpIDList, szTemp);
1066 if (sei->fMask & SEE_MASK_CLASSNAME)
1067 { TRACE (shell,"-- classname= %s\n", sei->lpClass);
1071 { TRACE (shell,"-- action=%s\n", sei->lpVerb);
1076 /*************************************************************************
1077 * SHSetInstanceExplorer [SHELL32.176]
1080 HRESULT WINAPI SHSetInstanceExplorer (DWORD u)
1081 { FIXME(shell,"0x%08lx stub\n",u);
1084 /*************************************************************************
1085 * SHGetInstanceExplorer [SHELL32.256]
1090 HRESULT WINAPI SHGetInstanceExplorer (DWORD u)
1091 { FIXME(shell,"0x%08lx stub\n",u);
1094 /*************************************************************************
1095 * SHFreeUnusedLibraries [SHELL32.123]
1100 HRESULT WINAPI SHFreeUnusedLibraries (DWORD u)
1101 { FIXME(shell,"0x%08lx stub\n",u);
1104 /*************************************************************************
1105 * DAD_ShowDragImage [SHELL32.137]
1110 HRESULT WINAPI DAD_ShowDragImage (DWORD u)
1111 { FIXME(shell,"0x%08lx stub\n",u);
1114 /*************************************************************************
1115 * FileMenu_Destroy [SHELL32.118]
1120 HRESULT WINAPI FileMenu_Destroy (DWORD u)
1121 { FIXME(shell,"0x%08lx stub\n",u);
1124 /*************************************************************************
1125 * SHGetDataFromIDListA [SHELL32.247]
1128 HRESULT WINAPI SHGetDataFromIDListA(DWORD u, DWORD v, DWORD w, DWORD x, DWORD y)
1129 { FIXME(shell,"0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w,x,y);
1132 /*************************************************************************
1133 * SHRegCloseKey32 [NT4.0:SHELL32.505]
1136 HRESULT WINAPI SHRegCloseKey32 (HKEY hkey)
1137 { TRACE(shell,"0x%04x\n",hkey);
1138 return RegCloseKey( hkey );
1140 /*************************************************************************
1141 * SHRegOpenKey32A [SHELL32.506]
1144 HRESULT WINAPI SHRegOpenKey32A(HKEY hKey, LPSTR lpSubKey, LPHKEY phkResult)
1145 { FIXME(shell,"(0x%08x, %s, %p)\n", hKey, debugstr_a(lpSubKey),
1147 return RegOpenKey32A(hKey, lpSubKey, phkResult);
1150 /*************************************************************************
1151 * SHRegOpenKey32W [NT4.0:SHELL32.507]
1154 HRESULT WINAPI SHRegOpenKey32W (HKEY hkey, LPCWSTR lpszSubKey, LPHKEY retkey)
1155 { WARN(shell,"0x%04x %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
1156 return RegOpenKey32W( hkey, lpszSubKey, retkey );
1158 /*************************************************************************
1159 * SHRegQueryValueExA [SHELL32.509]
1162 HRESULT WINAPI SHRegQueryValueEx32A(DWORD u, LPSTR v, DWORD w, DWORD x,
1164 { FIXME(shell,"0x%04lx %s 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",
1165 u,debugstr_a(v),w,x,y,z);
1168 /*************************************************************************
1169 * SHRegQueryValue32W [NT4.0:SHELL32.510]
1172 HRESULT WINAPI SHRegQueryValue32W (HKEY hkey, LPWSTR lpszSubKey,
1173 LPWSTR lpszData, LPDWORD lpcbData )
1174 { WARN(shell,"0x%04x %s %p %p semi-stub\n",
1175 hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
1176 return RegQueryValue32W( hkey, lpszSubKey, lpszData, lpcbData );
1179 /*************************************************************************
1180 * SHRegQueryValueEx32W [NT4.0:SHELL32.511]
1183 * if the datatype REG_EXPAND_SZ then expand the string and change
1184 * *pdwType to REG_SZ.
1186 HRESULT WINAPI SHRegQueryValueEx32W (HKEY hkey, LPWSTR pszValue, LPDWORD pdwReserved,
1187 LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData)
1189 WARN(shell,"0x%04x %s %p %p %p %p semi-stub\n",
1190 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
1191 ret = RegQueryValueEx32W ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
1195 /*************************************************************************
1196 * ReadCabinetState [NT 4.0:SHELL32.651]
1199 HRESULT WINAPI ReadCabinetState(DWORD u, DWORD v)
1200 { FIXME(shell,"0x%04lx 0x%04lx stub\n",u,v);
1203 /*************************************************************************
1204 * WriteCabinetState [NT 4.0:SHELL32.652]
1207 HRESULT WINAPI WriteCabinetState(DWORD u)
1208 { FIXME(shell,"0x%04lx stub\n",u);
1211 /*************************************************************************
1212 * FileIconInit [SHELL32.660]
1215 BOOL32 WINAPI FileIconInit(BOOL32 bFullInit)
1216 { FIXME(shell,"(%s)\n", bFullInit ? "true" : "false");
1219 /*************************************************************************
1220 * IsUserAdmin [NT 4.0:SHELL32.680]
1223 HRESULT WINAPI IsUserAdmin()
1224 { FIXME(shell,"stub\n");
1227 /*************************************************************************
1228 * StrRetToStrN [SHELL32.96]
1230 * converts a STRRET to a normal string
1233 * FIXME the string handling is to simple (different STRRET choices)
1234 * at the moment only CSTR
1235 * the pidl is for STRRET OFFSET
1237 HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
1238 { TRACE(shell,"dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
1242 WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL);
1243 SHFree(src->u.pOleStr);
1247 if (VERSION_OsIsUnicode())
1248 lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
1250 strncpy((LPSTR)dest, src->u.cStr, len);
1253 case STRRET_OFFSETA:
1255 { if(VERSION_OsIsUnicode())
1256 lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
1258 strncpy((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
1263 FIXME(shell,"unknown type!\n");
1265 { *(LPSTR)dest = '\0';
1272 /*************************************************************************
1273 * StrChrW [NT 4.0:SHELL32.651]
1276 LPWSTR WINAPI StrChrW (LPWSTR str, WCHAR x )
1279 TRACE(shell,"%s 0x%04x\n",debugstr_w(str),x);
1289 /*************************************************************************
1290 * StrCmpNIW [NT 4.0:SHELL32.*]
1293 INT32 WINAPI StrCmpNIW ( LPWSTR wstr1, LPWSTR wstr2, INT32 len)
1294 { FIXME( shell,"%s %s %i stub\n", debugstr_w(wstr1),debugstr_w(wstr2),len);
1298 /*************************************************************************
1299 * SHAllocShared [SHELL32.520]
1302 * parameter1 is return value from HeapAlloc
1303 * parameter2 is equal to the size allocated with HeapAlloc
1304 * parameter3 is return value from GetCurrentProcessId
1306 * the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
1307 * WM_USER+2 could be the undocumented CWM_SETPATH
1308 * the allocated memory contains a pidl
1310 HGLOBAL32 WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
1314 TRACE(shell,"ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID);
1315 hmem = GlobalAlloc32(GMEM_FIXED, size);
1319 pmem = GlobalLock32 (hmem);
1324 memcpy (pmem, psrc, size);
1325 GlobalUnlock32(hmem);
1328 /*************************************************************************
1329 * SHLockShared [SHELL32.521]
1332 * parameter1 is return value from SHAllocShared
1333 * parameter2 is return value from GetCurrentProcessId
1334 * the receiver of (WM_USER+2) trys to lock the HANDLE (?)
1335 * the returnvalue seems to be a memoryadress
1337 void * WINAPI SHLockShared(HANDLE32 hmem, DWORD procID)
1338 { TRACE(shell,"handle=0x%04x procID=0x%04lx\n",hmem,procID);
1339 return GlobalLock32(hmem);
1341 /*************************************************************************
1342 * SHUnlockShared [SHELL32.522]
1345 * parameter1 is return value from SHLockShared
1347 BOOL32 WINAPI SHUnlockShared(HANDLE32 pmem)
1348 { TRACE(shell,"handle=0x%04x\n",pmem);
1349 return GlobalUnlock32(pmem);
1351 /*************************************************************************
1352 * SHFreeShared [SHELL32.523]
1355 * parameter1 is return value from SHAllocShared
1356 * parameter2 is return value from GetCurrentProcessId
1358 HANDLE32 WINAPI SHFreeShared(HANDLE32 hmem, DWORD procID)
1359 { TRACE(shell,"handle=0x%04x 0x%04lx\n",hmem,procID);
1360 return GlobalFree32(hmem);
1363 /*************************************************************************
1364 * SetAppStartingCursor32 [SHELL32.99]
1367 HRESULT WINAPI SetAppStartingCursor32(DWORD u, DWORD v)
1368 { FIXME(shell,"0x%04lx 0x%04lx stub\n",u,v );
1371 /*************************************************************************
1372 * SHLoadOLE32 [SHELL32.151]
1375 HRESULT WINAPI SHLoadOLE32(DWORD u)
1376 { FIXME(shell,"0x%04lx stub\n",u);
1379 /*************************************************************************
1380 * Shell_MergeMenus32 [SHELL32.67]
1383 BOOL32 _SHIsMenuSeparator(HMENU32 hm, int i)
1385 MENUITEMINFO32A mii;
1387 mii.cbSize = sizeof(MENUITEMINFO32A);
1388 mii.fMask = MIIM_TYPE;
1389 mii.cch = 0; /* WARNING: We MUST initialize it to 0*/
1390 if (!GetMenuItemInfo32A(hm, i, TRUE, &mii))
1394 if (mii.fType & MFT_SEPARATOR)
1400 #define MM_ADDSEPARATOR 0x00000001L
1401 #define MM_SUBMENUSHAVEIDS 0x00000002L
1402 HRESULT WINAPI Shell_MergeMenus32 (HMENU32 hmDst, HMENU32 hmSrc, UINT32 uInsert, UINT32 uIDAdjust, UINT32 uIDAdjustMax, ULONG uFlags)
1405 BOOL32 bAlreadySeparated;
1406 MENUITEMINFO32A miiSrc;
1408 UINT32 uTemp, uIDMax = uIDAdjust;
1410 FIXME(shell,"hmenu1=0x%04x hmenu2=0x%04x 0x%04x 0x%04x 0x%04x 0x%04lx stub\n",
1411 hmDst, hmSrc, uInsert, uIDAdjust, uIDAdjustMax, uFlags);
1413 if (!hmDst || !hmSrc)
1417 nItem = GetMenuItemCount32(hmDst);
1418 if (uInsert >= (UINT32)nItem)
1419 { uInsert = (UINT32)nItem;
1420 bAlreadySeparated = TRUE;
1423 { bAlreadySeparated = _SHIsMenuSeparator(hmDst, uInsert);;
1425 if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
1426 { /* Add a separator between the menus */
1427 InsertMenu32A(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
1428 bAlreadySeparated = TRUE;
1432 /* Go through the menu items and clone them*/
1433 for (nItem = GetMenuItemCount32(hmSrc) - 1; nItem >= 0; nItem--)
1434 { miiSrc.cbSize = sizeof(MENUITEMINFO32A);
1435 miiSrc.fMask = MIIM_STATE | MIIM_ID | MIIM_SUBMENU | MIIM_CHECKMARKS | MIIM_TYPE | MIIM_DATA;
1436 /* We need to reset this every time through the loop in case
1437 menus DON'T have IDs*/
1438 miiSrc.fType = MFT_STRING;
1439 miiSrc.dwTypeData = szName;
1440 miiSrc.dwItemData = 0;
1441 miiSrc.cch = sizeof(szName);
1443 if (!GetMenuItemInfo32A(hmSrc, nItem, TRUE, &miiSrc))
1446 if (miiSrc.fType & MFT_SEPARATOR)
1447 { /* This is a separator; don't put two of them in a row*/
1448 if (bAlreadySeparated)
1451 bAlreadySeparated = TRUE;
1453 else if (miiSrc.hSubMenu)
1454 { if (uFlags & MM_SUBMENUSHAVEIDS)
1455 { /* Adjust the ID and check it*/
1456 miiSrc.wID += uIDAdjust;
1457 if (miiSrc.wID > uIDAdjustMax)
1460 if (uIDMax <= miiSrc.wID)
1461 { uIDMax = miiSrc.wID + 1;
1465 { /* Don't set IDs for submenus that didn't have them already */
1466 miiSrc.fMask &= ~MIIM_ID;
1468 hmSubMenu = miiSrc.hSubMenu;
1469 miiSrc.hSubMenu = CreatePopupMenu32();
1470 if (!miiSrc.hSubMenu)
1473 uTemp = Shell_MergeMenus32(miiSrc.hSubMenu, hmSubMenu, 0, uIDAdjust, uIDAdjustMax, uFlags&MM_SUBMENUSHAVEIDS);
1474 if (uIDMax <= uTemp)
1477 bAlreadySeparated = FALSE;
1480 { /* Adjust the ID and check it*/
1481 miiSrc.wID += uIDAdjust;
1482 if (miiSrc.wID > uIDAdjustMax)
1485 if (uIDMax <= miiSrc.wID)
1486 { uIDMax = miiSrc.wID + 1;
1488 bAlreadySeparated = FALSE;
1490 if (!InsertMenuItem32A(hmDst, uInsert, TRUE, &miiSrc))
1495 /* Ensure the correct number of separators at the beginning of the
1496 inserted menu items*/
1498 { if (bAlreadySeparated)
1499 { DeleteMenu32(hmDst, uInsert, MF_BYPOSITION);
1503 { if (_SHIsMenuSeparator(hmDst, uInsert-1))
1504 { if (bAlreadySeparated)
1505 { DeleteMenu32(hmDst, uInsert, MF_BYPOSITION);
1509 { if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
1510 { /* Add a separator between the menus*/
1511 InsertMenu32A(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
1518 /*************************************************************************
1519 * PathGetDriveNumber32 [SHELL32.57]
1522 HRESULT WINAPI PathGetDriveNumber32(LPSTR u)
1523 { FIXME(shell,"%s stub\n",debugstr_a(u));
1526 /*************************************************************************
1527 * DriveType32 [SHELL32.64]
1530 HRESULT WINAPI DriveType32(DWORD u)
1531 { FIXME(shell,"0x%04lx stub\n",u);
1534 /*************************************************************************
1535 * SHAbortInvokeCommand [SHELL32.198]
1538 HRESULT WINAPI SHAbortInvokeCommand()
1539 { FIXME(shell,"stub\n");
1542 /*************************************************************************
1543 * SHOutOfMemoryMessageBox [SHELL32.126]
1546 HRESULT WINAPI SHOutOfMemoryMessageBox(DWORD u, DWORD v, DWORD w)
1547 { FIXME(shell,"0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w);
1550 /*************************************************************************
1551 * SHFlushClipboard [SHELL32.121]
1554 HRESULT WINAPI SHFlushClipboard()
1555 { FIXME(shell,"stub\n");
1558 /*************************************************************************
1559 * SheGetDirW [SHELL32.281]
1562 HRESULT WINAPI SheGetDirW(LPWSTR u, LPWSTR v)
1563 { FIXME(shell,"%s %s stub\n",debugstr_w(u),debugstr_w(v) );
1566 /*************************************************************************
1567 * StrRChrW [SHELL32.320]
1570 LPWSTR WINAPI StrRChrW(LPWSTR lpStart, LPWSTR lpEnd, DWORD wMatch)
1572 TRACE(shell,"%s %s 0x%04x\n",debugstr_w(lpStart),debugstr_w(lpEnd), (WCHAR)wMatch );
1574 /* if the end not given, search*/
1582 { if (*lpStart==(WCHAR)wMatch)
1585 } while ( lpStart<=lpEnd );