Changeset 1214 for trunk/src/shell32/misc.cpp
- Timestamp:
- Oct 9, 1999, 1:13:46 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/misc.cpp
r972 r1214 1 /* $Id: misc.cpp,v 1. 4 1999-09-18 15:57:51sandervl Exp $ */1 /* $Id: misc.cpp,v 1.5 1999-10-09 11:13:19 sandervl Exp $ */ 2 2 3 3 /* … … 15 15 *****************************************************************************/ 16 16 17 #include <os2win.h> 18 #include <shellapi.h> 17 #include <odin.h> 19 18 #include <wchar.h> 20 19 #include <wcstr.h> 20 21 #define ICOM_CINTERFACE 1 22 23 //#include <os2win.h> 24 #include <shellapi.h> 21 25 #include <winnls.h> 22 #include "shell32 .h"26 #include "shell32_main.h" 23 27 #include <misc.h> 24 #include <string.h>25 #include "winbase.h"28 //#include <string.h> 29 //#include "winbase.h" 26 30 #include <heapstring.h> 27 31 … … 30 34 *****************************************************************************/ 31 35 32 33 /*****************************************************************************34 * Name : LPWSTR* WIN32API CommandLineToArgvW35 * Purpose :36 * Parameters:37 * Variables :38 * Result :39 * Remark :40 * Status : UNTESTED STUB41 *42 * Author : Patrick Haller [Sat, 1998/07/11 11:55]43 *****************************************************************************/44 45 LPWSTR * WIN32API CommandLineToArgvW(LPCWSTR lpCmdLine,46 int *pNumArgs)47 {48 LPWSTR *argv, s, t;49 int i;50 51 dprintf(("SHELL32: CommandLineToArgvW(%s,%08xh)\n",52 lpCmdLine,53 pNumArgs));54 55 s = (LPWSTR)lpCmdLine;56 i = 0;57 while (*s) {58 /* space */59 if (*s==0x0020) {60 i++;61 s++;62 while (*s && *s==0x0020)63 s++;64 continue;65 }66 s++;67 }68 argv = (LPWSTR *)LocalAlloc(LPTR, sizeof(LPWSTR)*(i+1));69 s = t = (LPWSTR)lpCmdLine;70 i = 0;71 while(*s) {72 if (*s==0x0020) {73 *s=0;74 argv[i++] = t;75 *s=0x0020;76 while (*s && *s==0x0020)77 s++;78 if(*s)79 t=s+1;80 else t=s;81 continue;82 }83 s++;84 }85 if(*t)86 argv[i++] = t;87 88 argv[i]=NULL;89 *pNumArgs = i;90 return argv;91 }92 93 94 /*****************************************************************************95 * Name : HICON WIN32API ExtractIconA96 * Purpose :97 * Parameters:98 * Variables :99 * Result :100 * Remark :101 * Status : UNTESTED STUB102 *103 * Author : Patrick Haller [Sat, 1998/07/11 11:55]104 *****************************************************************************/105 106 HICON WIN32API ExtractIconA(HINSTANCE hInst,107 LPCSTR lpszExeFileName,108 UINT nIconIndex)109 {110 dprintf(("SHELL32: ExtractIconA(%08xh,%s,%08xh) not implemented.\n",111 hInst,112 lpszExeFileName,113 nIconIndex));114 115 return(NULL);116 }117 118 119 /*****************************************************************************120 * Name : HICON WIN32API ExtractIconW121 * Purpose :122 * Parameters:123 * Variables :124 * Result :125 * Remark :126 * Status : UNTESTED STUB127 *128 * Author : Patrick Haller [Sat, 1998/07/11 11:55]129 *****************************************************************************/130 131 HICON WIN32API ExtractIconW(HINSTANCE hInst,132 LPCWSTR lpszExeFileName,133 UINT nIconIndex)134 {135 HICON hicon = NULL;136 char *astring = UnicodeToAsciiString((LPWSTR)lpszExeFileName);137 138 dprintf(("SHELL32: ExtractIconW(%08xh,%s,%08xh) not implemented.\n",139 hInst,140 lpszExeFileName,141 nIconIndex));142 143 144 FreeAsciiString(astring);145 return(hicon);146 }147 148 149 /*****************************************************************************150 * Name : HICON WIN32API ExtractIconExA151 * Purpose :152 * Parameters:153 * Variables :154 * Result :155 * Remark :156 * Status : UNTESTED STUB157 *158 * Author : Patrick Haller [Sat, 1998/07/11 11:55]159 *****************************************************************************/160 161 DWORD WIN32API ExtractIconExA(LPCSTR lpszFile,162 int nIconIndex,163 HICON *phiconLarge,164 HICON *phiconSmall,165 UINT nIcons)166 {167 dprintf(("SHELL32: ExtractIconExA(%s,%08xh,%08xh,%08xh,%u) not implemented.\n",168 lpszFile,169 nIconIndex,170 phiconLarge,171 phiconSmall,172 nIcons));173 174 return (0);175 }176 177 178 /*****************************************************************************179 * Name : HICON WIN32API ExtractIconExW180 * Purpose :181 * Parameters:182 * Variables :183 * Result :184 * Remark :185 * Status : UNTESTED STUB186 *187 * Author : Patrick Haller [Sat, 1998/07/11 11:55]188 *****************************************************************************/189 190 HICON WIN32API ExtractIconExW(LPCWSTR lpszFile,191 int nIconIndex,192 HICON *phiconLarge,193 HICON *phiconSmall,194 UINT nIcons)195 {196 dprintf(("SHELL32: ExtractIconExW(%s,%08xh,%08xh,%08xh,%u) not implemented.\n",197 lpszFile,198 nIconIndex,199 phiconLarge,200 phiconSmall,201 nIcons));202 203 return (0);204 }205 206 207 /*****************************************************************************208 * Name : HINSTANCE WIN32API FindExecutableA209 * Purpose :210 * Parameters:211 * Variables :212 * Result :213 * Remark :214 * Status : UNTESTED STUB215 *216 * Author : Patrick Haller [Sat, 1998/07/11 11:55]217 *****************************************************************************/218 219 HINSTANCE WIN32API FindExecutableA(LPCSTR lpszFile,220 LPCSTR lpszDir,221 LPTSTR lpszResult)222 {223 dprintf(("SHELL32: FindExecutableA (%s,%s,%s) not implemented.\n",224 lpszFile,225 lpszDir,226 lpszResult));227 228 return(NULL);229 }230 231 232 /*****************************************************************************233 * Name : HINSTANCE WIN32API FindExecutableW234 * Purpose :235 * Parameters:236 * Variables :237 * Result :238 * Remark :239 * Status : UNTESTED STUB240 *241 * Author : Patrick Haller [Sat, 1998/07/11 11:55]242 *****************************************************************************/243 244 HINSTANCE WIN32API FindExecutableW(LPCWSTR lpszFile,245 LPCWSTR lpszDir,246 LPWSTR lpszResult)247 {248 dprintf(("SHELL32: FindExecutableW (%s,%s,%s) not implemented.\n",249 lpszFile,250 lpszDir,251 lpszResult));252 253 return(NULL);254 }255 256 257 /*****************************************************************************258 * Name : HICON WIN32API ExtractAssociatedIconA259 * Purpose : Return icon for given file (either from file itself or from associated260 * executable) and patch parameters if needed.261 * Parameters:262 * Variables :263 * Result :264 * Remark : SHELL.36265 * Status : UNTESTED STUB266 *267 * Author : Patrick Haller [Sat, 1998/07/11 11:55]268 *****************************************************************************/269 270 HICON WIN32API ExtractAssociatedIconA(HINSTANCE hInst,271 LPSTR lpIconPath,272 LPWORD lpiIcon)273 {274 HICON hIcon;275 276 dprintf(("SHELL32: ExtractAssociatedIconA(%08xh,%s,%08xh)\n",277 hInst,278 lpIconPath,279 lpiIcon));280 281 hIcon = ExtractIconA(hInst,282 lpIconPath,283 *lpiIcon);284 285 if( hIcon < 2 )286 {287 if( hIcon == 1 ) /* no icons found in given file */288 {289 char tempPath[0x80];290 UINT uRet = FindExecutableA(lpIconPath,291 NULL,292 tempPath);293 294 if(uRet > 32 && tempPath[0])295 {296 strcpy(lpIconPath,tempPath);297 hIcon = ExtractIconA(hInst,298 lpIconPath,299 *lpiIcon);300 if( hIcon > 2 )301 return hIcon;302 }303 else304 hIcon = 0;305 }306 307 if( hIcon == 1 )308 *lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */309 else310 *lpiIcon = 6; /* generic icon - found nothing */311 312 /* @@@PH - how is this supposed to work ?313 GetModuleFileNameA(hInst,314 lpIconPath,315 0x80);316 hIcon = LoadIconA(hInst,317 *lpiIcon);318 */319 }320 return hIcon;321 }322 36 323 37 /***************************************************************************** … … 397 111 398 112 return ExtractAssociatedIconW(hInst,lpIconPath,lpiIcon); 399 }400 401 /*****************************************************************************402 * Name : ParseField403 * Purpose :404 * Parameters:405 * Variables :406 * Result :407 * Remark : SHELL32.58408 * Status : UNTESTED UNKNOWN STUB409 *410 * Author : Patrick Haller [Tue, 1998/06/15 03:00]411 *****************************************************************************/412 413 DWORD WIN32API ParseFieldA(LPCSTR src,414 DWORD field,415 LPSTR dst,416 DWORD len)417 {418 dprintf(("SHELL32: ParseFieldA(%s,%08xh,%08xh,%08xh) not correctly implemented.\n",419 src,420 field,421 dst,422 len));423 424 if (!src || !src[0] || !dst || !len)425 return 0;426 427 if (field >1)428 {429 field--;430 while (field)431 {432 if (*src==0x0) return FALSE;433 if (*src==',') field--;434 src++;435 }436 }437 438 while (*src!=0x00 && *src!=',' && len>0)439 {440 *dst=*src; dst++, src++; len--;441 }442 *dst=0x0;443 return TRUE;444 }445 446 447 /*****************************************************************************448 * Name : PickIconDlg449 * Purpose :450 * Parameters:451 * Variables :452 * Result :453 * Remark : SHELL32.62454 * Status : UNTESTED UNKNOWN STUB455 *456 * Author : Patrick Haller [Tue, 1998/06/15 03:00]457 *****************************************************************************/458 459 DWORD WIN32API PickIconDlg(DWORD x,DWORD y,DWORD z,DWORD a)460 {461 dprintf(("SHELL32: PickIconDlg(%08xh,%08xh,%08xh,%08xh) not implemented.\n",462 x,463 y,464 z,465 a));466 467 return 0xffffffff;468 }469 470 471 /*****************************************************************************472 * Name : GetFileNameFromBrowse473 * Purpose :474 * Parameters:475 * Variables :476 * Result :477 * Remark : SHELL32.63478 * Status : UNTESTED UNKNOWN STUB479 *480 * Author : Patrick Haller [Tue, 1998/06/15 03:00]481 *****************************************************************************/482 483 DWORD WIN32API GetFileNameFromBrowse(HWND howner,484 LPSTR targetbuf,485 DWORD len,486 DWORD x,487 LPCSTR suffix,488 LPCSTR y,489 LPCSTR cmd)490 {491 dprintf(("SHELL32: GetFileNameFromBrowse(%08xh, %08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",492 howner,493 targetbuf,494 len,495 x,496 suffix,497 y,498 cmd));499 500 /* puts up a Open Dialog and requests input into targetbuf */501 /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */502 strcpy(targetbuf,503 "x:\\dummy.exe");504 505 return 1;506 113 } 507 114 … … 570 177 lpWide, 571 178 nWide); 572 }573 574 575 /*****************************************************************************576 * Name : RegisterShellHook577 * Purpose :578 * Parameters:579 * Variables :580 * Result :581 * Remark : SHELL32.181582 * Status : UNTESTED UNKNOWN STUB583 *584 * Author : Patrick Haller [Tue, 1998/06/15 03:00]585 *586 * PARAMS587 * hwnd [I] window handle588 * y [I] flag ????589 *590 * NOTES591 * exported by ordinal592 */593 594 void WIN32API RegisterShellHook(HWND hwnd,595 DWORD y)596 {597 dprintf(("SHELL32: RegisterShellHook(%08xh, %08xh) not implemented.\n",598 hwnd,599 y));600 }601 602 603 /*****************************************************************************604 * Name : RunFileDlg605 * Purpose :606 * Parameters:607 * Variables :608 * Result :609 * Remark : SHELL32.61610 * Status : UNTESTED UNKNOWN STUB611 *612 * Author : Patrick Haller [Tue, 1998/06/15 03:00]613 *****************************************************************************/614 615 DWORD WIN32API RunFileDlg (HWND hwndOwner,616 DWORD dwParam1,617 DWORD dwParam2,618 LPSTR lpszTitle,619 LPSTR lpszPrompt,620 UINT uFlags)621 {622 dprintf(("SHELL32: RunFileDlg(%08xh,%08xh,%08xh,%s,%s,%08xh) not implemented.\n",623 hwndOwner,624 dwParam1,625 dwParam2,626 lpszTitle,627 lpszPrompt,628 uFlags));629 630 return 0;631 }632 633 634 /*****************************************************************************635 * Name : ExitWindowsDialog636 * Purpose :637 * Parameters:638 * Variables :639 * Result :640 * Remark : SHELL32.60641 * Status : UNTESTED UNKNOWN STUB642 *643 * Author : Patrick Haller [Tue, 1998/06/15 03:00]644 *****************************************************************************/645 646 void WIN32API ExitWindowsDialog (HWND hWndOwner)647 {648 dprintf(("SHELL32: ExitWindowsDialog(%08xh)\n",649 hWndOwner));650 651 if (MessageBoxA(hWndOwner,652 "Do you want to exit ODIN?",653 "Shutdown",654 MB_YESNO|MB_ICONQUESTION)655 == IDOK)656 {657 SendMessageA (hWndOwner,658 WM_QUIT,659 0,660 0);661 }662 }663 664 665 /*****************************************************************************666 * Name : ArrangeWindows667 * Purpose :668 * Parameters:669 * Variables :670 * Result :671 * Remark : SHELL32.184672 * Status : UNTESTED UNKNOWN STUB673 *674 * Author : Patrick Haller [Tue, 1998/06/15 03:00]675 *****************************************************************************/676 677 DWORD WIN32API ArrangeWindows (DWORD dwParam1,678 DWORD dwParam2,679 DWORD dwParam3,680 DWORD dwParam4,681 DWORD dwParam5)682 {683 dprintf(("SHELL32: ArrangeWindows(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",684 dwParam1,685 dwParam2,686 dwParam3,687 dwParam4,688 dwParam5));689 690 return 0;691 }692 693 694 /*****************************************************************************695 * Name : SignalFileOpen696 * Purpose :697 * Parameters:698 * Variables :699 * Result :700 * Remark : SHELL32.103701 * Status : UNTESTED UNKNOWN STUB702 *703 * Author : Patrick Haller [Tue, 1998/06/15 03:00]704 *****************************************************************************/705 706 DWORD WIN32API SignalFileOpen (DWORD dwParam1)707 {708 dprintf(("SHELL32: SignalFileOpen(%08xh) not implemented.\n",709 dwParam1));710 711 return 0;712 }713 714 715 /*****************************************************************************716 * Name : DAD_ShowDrawImage717 * Purpose :718 * Parameters:719 * Variables :720 * Result :721 * Remark : SHELL32.137722 * Status : UNTESTED UNKNOWN STUB723 *724 * Author : Patrick Haller [Tue, 1998/06/15 03:00]725 *****************************************************************************/726 727 HRESULT WIN32API DAD_ShowDragImage (DWORD u)728 {729 dprintf(("SHELL32: DAD_ShowDragImage(%08xh) not implemented.\n",730 u));731 732 return 0;733 }734 735 736 /*****************************************************************************737 * Name : ReadCabinetState738 * Purpose :739 * Parameters:740 * Variables :741 * Result :742 * Remark : SHELL32.651743 * Status : UNTESTED UNKNOWN STUB744 *745 * Author : Patrick Haller [Tue, 1998/06/15 03:00]746 *****************************************************************************/747 748 HRESULT WIN32API ReadCabinetState(DWORD u,749 DWORD v)750 {751 dprintf(("SHELL32: ReadCabinetState(%08xh, %08xh) not implemented.\n",752 u,753 v));754 755 return 0;756 }757 758 759 /*****************************************************************************760 * Name : WriteCabinetState761 * Purpose :762 * Parameters:763 * Variables :764 * Result :765 * Remark : SHELL32.652766 * Status : UNTESTED UNKNOWN STUB767 *768 * Author : Patrick Haller [Tue, 1998/06/15 03:00]769 *****************************************************************************/770 771 HRESULT WIN32API WriteCabinetState(DWORD u)772 {773 dprintf(("SHELL32: WriteCabinetState(%08xh) not implemented.\n",774 u));775 776 return 0;777 }778 779 780 /*****************************************************************************781 * Name : FileIconInit782 * Purpose :783 * Parameters:784 * Variables :785 * Result :786 * Remark : SHELL32.660787 * Status : UNTESTED UNKNOWN STUB788 *789 * Author : Patrick Haller [Tue, 1998/06/15 03:00]790 *****************************************************************************/791 792 BOOL WIN32API FileIconInit(BOOL bFullInit)793 {794 dprintf(("SHELL32: FileIconInit(%08xh) not implemented.\n",795 bFullInit));796 797 return 0;798 }799 800 801 /*****************************************************************************802 * Name : IsUserAdmin803 * Purpose :804 * Parameters:805 * Variables :806 * Result :807 * Remark : SHELL32.680808 * Status : UNTESTED UNKNOWN STUB809 *810 * Author : Patrick Haller [Tue, 1998/06/15 03:00]811 *****************************************************************************/812 813 HRESULT WIN32API IsUserAdmin(void)814 {815 dprintf(("SHELL32: IsUserAdmin() not implmented. Yes, user is admin ;-)\n"));816 817 return TRUE;818 179 } 819 180 … … 888 249 } 889 250 890 /*****************************************************************************891 * Name : StrChrW892 * Purpose :893 * Parameters:894 * Variables :895 * Result :896 * Remark : SHELL32.651897 * Status : UNTESTED UNKNOWN STUB898 *899 * Author : Patrick Haller [Tue, 1998/06/15 03:00]900 *****************************************************************************/901 902 LPWSTR WIN32API StrChrW (LPWSTR str,903 WCHAR x)904 {905 dprintf (("SHELL32: StrChrW(%08xh, %08xh)\n",906 str,907 x));908 909 return ((LPWSTR)wcschr((const wchar_t*)str,910 x));911 }912 913 914 /*****************************************************************************915 * Name : StrChrNIW916 * Purpose :917 * Parameters:918 * Variables :919 * Result :920 * Remark : SHELL32.?921 * Status : UNTESTED UNKNOWN STUB922 *923 * Author : Patrick Haller [Tue, 1998/06/15 03:00]924 *****************************************************************************/925 926 INT WIN32API StrCmpNIW (LPWSTR wstr1,927 LPWSTR wstr2,928 INT len)929 {930 dprintf(("SHELL32: StrCmpNIW(%08xh,%08xh,%08xh) not correctly implemented.\n",931 wstr1,932 wstr2,933 len));934 935 return (wcsncmp((const wchar_t*)wstr1,936 (const wchar_t*)wstr2,937 len));938 }939 940 941 /*****************************************************************************942 * Name : DriveType943 * Purpose :944 * Parameters:945 * Variables :946 * Result :947 * Remark : SHELL32.64948 * Status : UNTESTED UNKNOWN STUB949 *950 * Author : Patrick Haller [Tue, 1998/06/15 03:00]951 *****************************************************************************/952 953 HRESULT WIN32API DriveType(DWORD u)954 {955 dprintf(("SHELL32: DriveType(%08xh) not implemented.\n",956 u));957 958 return 0;959 }960 961 962 /*****************************************************************************963 * Name : StrRChrW964 * Purpose :965 * Parameters:966 * Variables :967 * Result :968 * Remark : SHELL32.320, wcsrchr does not work?969 * Status : UNTESTED UNKNOWN STUB970 *971 * Author : Patrick Haller [Tue, 1998/06/15 03:00]972 *****************************************************************************/973 974 LPWSTR WIN32API StrRChrW(LPWSTR lpStart,975 LPWSTR lpEnd,976 DWORD wMatch)977 {978 LPWSTR wptr=NULL;979 980 dprintf(("SHELL32: StrRChrW(%08xh,%08xh,%08xh)\n",981 lpStart,982 lpEnd,983 wMatch));984 985 /* if the end not given, search*/986 if (!lpEnd)987 {988 lpEnd=lpStart;989 while (*lpEnd)990 lpEnd++;991 }992 993 do994 {995 if (*lpStart==(WCHAR)wMatch)996 wptr = lpStart;997 lpStart++;998 }999 while ( lpStart<=lpEnd );1000 return wptr;1001 }1002 1003 1004 /*****************************************************************************1005 * Name : Control_FillCache_RunDLL1006 * Purpose :1007 * Parameters:1008 * Variables :1009 * Result :1010 * Remark : SHELL32.81011 * Status : UNTESTED UNKNOWN STUB1012 *1013 * Author : Patrick Haller [Tue, 1998/06/15 03:00]1014 *****************************************************************************/1015 1016 HRESULT WIN32API Control_FillCache_RunDLL(HWND hWnd,1017 HANDLE hModule,1018 DWORD w,1019 DWORD x)1020 {1021 dprintf(("SHELL32: Control_FillCache_RunDLL(%08xh,%08xh,%08xh,%08xh) not implemented.\n",1022 hWnd,1023 hModule,1024 w,1025 x));1026 1027 return 0;1028 }1029 1030 1031 /*****************************************************************************1032 * Name : RunDLL_CallEntry161033 * Purpose :1034 * Parameters:1035 * Variables :1036 * Result :1037 * Remark : SHELL32.122 - the name is propably wrong1038 * Status : UNTESTED UNKNOWN STUB1039 *1040 * Author : Patrick Haller [Tue, 1998/06/15 03:00]1041 *****************************************************************************/1042 1043 HRESULT WIN32API RunDLL_CallEntry16(DWORD v,1044 DWORD w,1045 DWORD x,1046 DWORD y,1047 DWORD z)1048 {1049 dprintf(("SHELL32: RunDLL_CallEntry16(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",1050 v,1051 w,1052 x,1053 y,1054 z));1055 1056 return 0;1057 }1058 1059 251 1060 252 /***************************************************************************** … … 1076 268 x, 1077 269 y)); 1078 return 0;1079 }1080 1081 1082 /*****************************************************************************1083 * Name : RLBuildListOfPaths1084 * Purpose :1085 * Parameters:1086 * Variables :1087 * Result :1088 * Remark : SHELL32.146 - builds a DPA1089 * Status : UNTESTED UNKNOWN STUB1090 *1091 * Author : Patrick Haller [Tue, 1998/06/15 03:00]1092 *****************************************************************************/1093 1094 DWORD WIN32API RLBuildListOfPaths ()1095 {1096 dprintf(("SHELL32: RLBuildListOfPaths() not implemented.\n"));1097 270 return 0; 1098 271 } … … 1128 301 1129 302 /***************************************************************************** 1130 * Name : SetAppStartingCursor1131 * Purpose :1132 * Parameters:1133 * Variables :1134 * Result :1135 * Remark : SHELL32.991136 * Status : UNTESTED UNKNOWN STUB1137 *1138 * Author : Patrick Haller [Tue, 1998/06/15 03:00]1139 *****************************************************************************/1140 1141 HRESULT WIN32API SetAppStartingCursor(HWND u,1142 DWORD v)1143 {1144 dprintf(("SHELL32: SetAppStartingCursor (SHELL32.99): (%08xh,%08xh) not implemented.\n",1145 u,1146 v));1147 1148 return 0;1149 }1150 1151 /*****************************************************************************1152 303 * Name : StrCpyNW 1153 304 * Purpose : … … 1187 338 } 1188 339 1189 /*****************************************************************************1190 * Name : FreeIconList1191 * Purpose :1192 * Parameters:1193 * Variables :1194 * Result :1195 * Remark : SHELL32.220 - used by progman.exe1196 * Status : UNTESTED UNKNOWN STUB1197 *1198 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]1199 *****************************************************************************/1200 1201 void WIN32API FreeIconList(DWORD dw)1202 {1203 dprintf(("SHELL32: undoc FreeIconList %08xh\n",dw));1204 }1205 340 1206 341 /***************************************************************************** … … 1294 429 } 1295 430 1296 /***************************************************************************** 1297 * Name : DoEnvironmentSubstA 1298 * Purpose : 1299 * Parameters: ??? ported WINE 16 bit function 1300 * Variables : 1301 * Result : 1302 * Remark : SHELL32.44 - used by progman.exe 1303 * Status : UNTESTED UNKNOWN STUB 1304 * 1305 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00] 1306 *****************************************************************************/ 1307 1308 DWORD WIN32API DoEnvironmentSubstA(LPSTR str,DWORD length) 1309 { 1310 LPSTR lpEnv = (LPSTR)GetEnvironmentStringsA(); 1311 LPSTR lpBuffer = (LPSTR)HeapAlloc( GetProcessHeap(), 0, length); 1312 LPSTR lpstr = str; 1313 LPSTR lpbstr = lpBuffer; 1314 1315 dprintf(("SHELL32: undoc DoEnvironmentSubstA\n")); 1316 1317 CharToOemA(str,str); 1318 1319 while( *lpstr && lpbstr - lpBuffer < length ) 1320 { 1321 LPSTR lpend = lpstr; 1322 1323 if( *lpstr == '%' ) 1324 { 1325 do { lpend++; } while( *lpend && *lpend != '%' ); 1326 if( *lpend == '%' && lpend - lpstr > 1 ) /* found key */ 1327 { 1328 LPSTR lpKey; 1329 *lpend = '\0'; 1330 lpKey = SHELL_FindStringA(lpEnv, lpstr+1); 1331 if( lpKey ) /* found key value */ 1332 { 1333 int l = strlen(lpKey); 1334 1335 if( l > length - (lpbstr - lpBuffer) - 1 ) 1336 { 1337 //WARN_(shell)("-- Env subst aborted - string too short\n"); 1338 *lpend = '%'; 1339 break; 1340 } 1341 strcpy(lpbstr, lpKey); 1342 lpbstr += l; 1343 } 1344 else break; 1345 *lpend = '%'; 1346 lpstr = lpend + 1; 1347 } 1348 else break; /* back off and whine */ 1349 1350 continue; 1351 } 1352 1353 *lpbstr++ = *lpstr++; 1354 } 1355 1356 *lpbstr = '\0'; 1357 if( lpstr - str == strlen(str) ) 1358 { 1359 strncpy(str, lpBuffer, length); 1360 length = 1; 1361 } 1362 else 1363 length = 0; 1364 1365 //TRACE_(shell)("-- return %s\n", str); 1366 1367 OemToCharA(str,str); 1368 HeapFree( GetProcessHeap(), 0, lpBuffer); 1369 1370 FreeEnvironmentStringsA(lpEnv); 1371 1372 /* Return str length in the LOWORD 1373 * and 1 in HIWORD if subst was successful. 1374 */ 1375 1376 return (DWORD)MAKELONG(strlen(str), length); 1377 } 1378 1379 /***************************************************************************** 1380 * Name : DoEnvironmentSubstW 1381 * Purpose : 1382 * Parameters: ??? 1383 * Variables : 1384 * Result : 1385 * Remark : SHELL32.193 - used by progman.exe 1386 * Status : UNTESTED UNKNOWN STUB 1387 * 1388 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00] 1389 *****************************************************************************/ 1390 1391 DWORD WIN32API DoEnvironmentSubstW(LPWSTR str,DWORD length) 1392 { 1393 //CB: call DoEnvironmentSubstW 1394 dprintf(("SHELL32: undoc DoEnvironmentSubstW\n")); 431 432 /***************************************************************************** 433 * Name : CheckEscapesA 434 * Purpose : 435 * Parameters: ??? 436 * Variables : 437 * Result : 438 * Remark : SHELL32.3 - used by progman.exe 439 * Status : UNTESTED UNKNOWN STUB 440 * 441 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00] 442 *****************************************************************************/ 443 444 void WIN32API CheckEscapesA(DWORD x1,DWORD x2) 445 { 446 dprintf(("SHELL32: undoc CheckEscapesA\n")); 447 } 448 449 /***************************************************************************** 450 * Name : CheckEscapesW 451 * Purpose : 452 * Parameters: ??? 453 * Variables : 454 * Result : 455 * Remark : SHELL32.6 - used by progman.exe 456 * Status : UNTESTED UNKNOWN STUB 457 * 458 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00] 459 *****************************************************************************/ 460 461 void WIN32API CheckEscapesW(DWORD x1,DWORD x2) 462 { 463 dprintf(("SHELL32: undoc CheckEscapesW\n")); 464 } 465 466 /***************************************************************************** 467 * Name : DuplicateIcon 468 * Purpose : 469 * Parameters: ??? 470 * Variables : 471 * Result : 472 * Remark : SHELL32.138 - used by progman.exe 473 * Status : UNTESTED UNKNOWN STUB 474 * 475 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00] 476 *****************************************************************************/ 477 478 DWORD WIN32API DuplicateIcon(DWORD x1) 479 { 480 dprintf(("SHELL32: undoc DuplicateIcon\n")); 1395 481 1396 482 return 0; 1397 483 } 1398 1399 /*****************************************************************************1400 * Name : CheckEscapesA1401 * Purpose :1402 * Parameters: ???1403 * Variables :1404 * Result :1405 * Remark : SHELL32.3 - used by progman.exe1406 * Status : UNTESTED UNKNOWN STUB1407 *1408 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]1409 *****************************************************************************/1410 1411 void WIN32API CheckEscapesA(DWORD x1,DWORD x2)1412 {1413 dprintf(("SHELL32: undoc CheckEscapesA\n"));1414 }1415 1416 /*****************************************************************************1417 * Name : CheckEscapesW1418 * Purpose :1419 * Parameters: ???1420 * Variables :1421 * Result :1422 * Remark : SHELL32.6 - used by progman.exe1423 * Status : UNTESTED UNKNOWN STUB1424 *1425 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]1426 *****************************************************************************/1427 1428 void WIN32API CheckEscapesW(DWORD x1,DWORD x2)1429 {1430 dprintf(("SHELL32: undoc CheckEscapesW\n"));1431 }1432 1433 /*****************************************************************************1434 * Name : DuplicateIcon1435 * Purpose :1436 * Parameters: ???1437 * Variables :1438 * Result :1439 * Remark : SHELL32.138 - used by progman.exe1440 * Status : UNTESTED UNKNOWN STUB1441 *1442 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]1443 *****************************************************************************/1444 1445 DWORD WIN32API DuplicateIcon(DWORD x1)1446 {1447 dprintf(("SHELL32: undoc DuplicateIcon\n"));1448 1449 return 0;1450 }
Note:
See TracChangeset
for help on using the changeset viewer.