4 * Copyright 1999, 2000 Juergen Schmied
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "wine/unicode.h"
31 #define NO_SHLWAPI_STREAM
33 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(shell);
38 INT __cdecl _wtoi(LPWSTR string);
40 #define isSlash(x) ((x)=='\\' || (x)=='/')
42 ########## Combining and Constructing paths ##########
45 /*************************************************************************
46 * PathAppendA [SHLWAPI.@]
49 * concat path lpszPath2 onto lpszPath1
52 * the resulting path is also canonicalized
54 BOOL WINAPI PathAppendA(
58 TRACE("%s %s\n",lpszPath1, lpszPath2);
59 while (lpszPath2[0]=='\\') lpszPath2++;
60 PathCombineA(lpszPath1,lpszPath1,lpszPath2);
64 /*************************************************************************
65 * PathAppendW [SHLWAPI.@]
67 BOOL WINAPI PathAppendW(
71 TRACE("%s %s\n",debugstr_w(lpszPath1), debugstr_w(lpszPath2));
72 while (lpszPath2[0]=='\\') lpszPath2++;
73 PathCombineW(lpszPath1,lpszPath1,lpszPath2);
77 /*************************************************************************
78 * PathCombineA [SHLWAPI.@]
81 * if lpszFile='.' skip it
82 * szDest can be equal to lpszFile. Thats why we use sTemp
85 * the resulting path is also canonicalized
87 LPSTR WINAPI PathCombineA(
93 TRACE("%p %p->%s %p->%s\n",szDest, lpszDir, lpszDir, lpszFile, lpszFile);
96 if (!lpszFile || !lpszFile[0] || (lpszFile[0]=='.' && !lpszFile[1]) )
98 strcpy(szDest,lpszDir);
102 /* if lpszFile is a complete path don't care about lpszDir */
103 if (PathGetDriveNumberA(lpszFile) != -1)
105 strcpy(szDest,lpszFile);
107 else if (lpszFile[0] == '\\' )
109 strcpy(sTemp,lpszDir);
110 PathStripToRootA(sTemp);
111 strcat(sTemp,lpszFile);
112 strcpy(szDest,sTemp);
116 strcpy(sTemp,lpszDir);
117 PathAddBackslashA(sTemp);
118 strcat(sTemp,lpszFile);
119 strcpy(szDest,sTemp);
124 /*************************************************************************
125 * PathCombineW [SHLWAPI.@]
127 LPWSTR WINAPI PathCombineW(
132 WCHAR sTemp[MAX_PATH];
133 TRACE("%p %p->%s %p->%s\n",szDest, lpszDir, debugstr_w(lpszDir),
134 lpszFile, debugstr_w(lpszFile));
137 if (!lpszFile || !lpszFile[0] || (lpszFile[0]==(WCHAR)'.' && !lpszFile[1]) )
139 strcpyW(szDest,lpszDir);
143 /* if lpszFile is a complete path don't care about lpszDir */
144 if (PathGetDriveNumberW(lpszFile) != -1)
146 strcpyW(szDest,lpszFile);
148 else if (lpszFile[0] == (WCHAR)'\\' )
150 strcpyW(sTemp,lpszDir);
151 PathStripToRootW(sTemp);
152 strcatW(sTemp,lpszFile);
153 strcpyW(szDest,sTemp);
157 strcpyW(sTemp,lpszDir);
158 PathAddBackslashW(sTemp);
159 strcatW(sTemp,lpszFile);
160 strcpyW(szDest,sTemp);
165 /*************************************************************************
166 * PathAddBackslashA [SHLWAPI.@]
169 * append \ if there is none
171 LPSTR WINAPI PathAddBackslashA(LPSTR lpszPath)
174 TRACE("%p->%s\n",lpszPath,lpszPath);
176 len = strlen(lpszPath);
177 if (len && lpszPath[len-1]!='\\')
179 lpszPath[len] = '\\';
180 lpszPath[len+1]= 0x00;
181 return lpszPath+len+1;
186 /*************************************************************************
187 * PathAddBackslashW [SHLWAPI.@]
189 LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
192 TRACE("%p->%s\n",lpszPath,debugstr_w(lpszPath));
194 len = strlenW(lpszPath);
195 if (len && lpszPath[len-1]!=(WCHAR)'\\')
197 lpszPath[len] = (WCHAR)'\\';
198 lpszPath[len+1]= 0x00;
199 return lpszPath+len+1;
204 /*************************************************************************
205 * PathBuildRootA [SHLWAPI.@]
207 LPSTR WINAPI PathBuildRootA(LPSTR lpszPath, int drive)
209 TRACE("%p %i\n",lpszPath, drive);
211 strcpy(lpszPath,"A:\\");
216 /*************************************************************************
217 * PathBuildRootW [SHLWAPI.@]
219 LPWSTR WINAPI PathBuildRootW(LPWSTR lpszPath, int drive)
221 lpszPath[0] = 'A' + drive;
225 TRACE("%p %i\n",debugstr_w(lpszPath), drive);
230 Extracting Component Parts
233 /*************************************************************************
234 * PathFindFileNameA [SHLWAPI.@]
236 LPSTR WINAPI PathFindFileNameA(LPCSTR lpszPath)
238 LPCSTR lastSlash = lpszPath;
240 TRACE("%s\n",lpszPath);
243 if ( isSlash(lpszPath[0]) && lpszPath[1])
244 lastSlash = lpszPath+1;
245 lpszPath = CharNextA(lpszPath);
247 return (LPSTR)lastSlash;
251 /*************************************************************************
252 * PathFindFileNameW [SHLWAPI.@]
254 LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
259 TRACE("%s\n",debugstr_w(wslash));
262 if (((lpszPath[0]=='\\') || (lpszPath[0]==':')) && lpszPath[1] && lpszPath[1]!='\\')
264 lpszPath = CharNextW(lpszPath);
266 return (LPWSTR)wslash;
269 /*************************************************************************
270 * PathFindExtensionA [SHLWAPI.@]
273 * returns pointer to last . in last lpszPath component or at \0.
276 LPSTR WINAPI PathFindExtensionA(LPCSTR lpszPath)
278 LPCSTR lastpoint = NULL;
280 TRACE("%p %s\n",lpszPath,lpszPath);
284 if (*lpszPath=='\\'||*lpszPath==' ')
288 lpszPath = CharNextA(lpszPath);
290 return (LPSTR)(lastpoint?lastpoint:lpszPath);
293 /*************************************************************************
294 * PathFindExtensionW [SHLWAPI.@]
296 LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
298 LPCWSTR lastpoint = NULL;
300 TRACE("(%p %s)\n",lpszPath,debugstr_w(lpszPath));
304 if (*lpszPath==(WCHAR)'\\'||*lpszPath==(WCHAR)' ')
306 if (*lpszPath==(WCHAR)'.')
308 lpszPath = CharNextW(lpszPath);
310 return (LPWSTR)(lastpoint?lastpoint:lpszPath);
313 /*************************************************************************
314 * PathGetArgsA [SHLWAPI.@]
317 * look for next arg in string. handle "quoted" strings
318 * returns pointer to argument *AFTER* the space. Or to the \0.
323 LPSTR WINAPI PathGetArgsA(LPCSTR lpszPath)
327 TRACE("%s\n",lpszPath);
331 if ((*lpszPath==' ') && !qflag)
332 return (LPSTR)lpszPath+1;
335 lpszPath = CharNextA(lpszPath);
337 return (LPSTR)lpszPath;
340 /*************************************************************************
341 * PathGetArgsW [SHLWAPI.@]
343 LPWSTR WINAPI PathGetArgsW(LPCWSTR lpszPath)
347 TRACE("%s\n",debugstr_w(lpszPath));
351 if ((*lpszPath==' ') && !qflag)
352 return (LPWSTR)lpszPath+1;
355 lpszPath = CharNextW(lpszPath);
357 return (LPWSTR)lpszPath;
360 /*************************************************************************
361 * PathGetDriveNumberA [SHLWAPI.@]
363 int WINAPI PathGetDriveNumberA(LPCSTR lpszPath)
365 int chr = tolower(lpszPath[0]);
367 TRACE ("%s\n",debugstr_a(lpszPath));
369 if (!lpszPath || lpszPath[1]!=':' || chr < 'a' || chr > 'z') return -1;
370 return tolower(lpszPath[0]) - 'a' ;
373 /*************************************************************************
374 * PathGetDriveNumberW [SHLWAPI.@]
376 int WINAPI PathGetDriveNumberW(LPCWSTR lpszPath)
378 int chr = tolowerW(lpszPath[0]);
380 TRACE ("%s\n",debugstr_w(lpszPath));
382 if (!lpszPath || lpszPath[1]!=':' || chr < 'a' || chr > 'z') return -1;
383 return tolowerW(lpszPath[0]) - 'a' ;
386 /*************************************************************************
387 * PathRemoveFileSpecA [SHLWAPI.@]
390 * truncates passed argument to a valid path
391 * returns if the string was modified or not.
392 * "\foo\xx\foo"-> "\foo\xx"
396 BOOL WINAPI PathRemoveFileSpecA(LPSTR lpszPath)
398 LPSTR cutplace = lpszPath;
401 TRACE("%s\n",lpszPath);
405 while (*lpszPath == '\\') cutplace = ++lpszPath;
409 if(lpszPath[0] == '\\') cutplace = lpszPath;
411 if(lpszPath[0] == ':')
413 cutplace = lpszPath + 1;
414 if (lpszPath[1] == '\\') cutplace++;
417 lpszPath = CharNextA(lpszPath);
418 if (!lpszPath) break;
421 ret = (*cutplace!='\0');
427 /*************************************************************************
428 * PathRemoveFileSpecW [SHLWAPI.@]
430 BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
432 LPWSTR cutplace = lpszPath;
435 TRACE("%s\n",debugstr_w(lpszPath));
439 while (*lpszPath == '\\') cutplace = ++lpszPath;
443 if(lpszPath[0] == '\\') cutplace = lpszPath;
445 if(lpszPath[0] == ':')
447 cutplace = lpszPath + 1;
448 if (lpszPath[1] == '\\') cutplace++;
451 lpszPath = CharNextW(lpszPath);
452 if (!lpszPath) break;
455 ret = (*cutplace!='\0');
461 /*************************************************************************
462 * PathStripPathA [SHLWAPI.@]
465 * removes the path from the beginning of a filename
467 void WINAPI PathStripPathA(LPSTR lpszPath)
469 LPSTR lpszFileName = PathFindFileNameA(lpszPath);
471 TRACE("%s\n", lpszPath);
474 RtlMoveMemory(lpszPath, lpszFileName, strlen(lpszFileName)+1);
477 /*************************************************************************
478 * PathStripPathW [SHLWAPI.@]
480 void WINAPI PathStripPathW(LPWSTR lpszPath)
482 LPWSTR lpszFileName = PathFindFileNameW(lpszPath);
484 TRACE("%s\n", debugstr_w(lpszPath));
486 RtlMoveMemory(lpszPath, lpszFileName, (strlenW(lpszFileName)+1)*sizeof(WCHAR));
489 /*************************************************************************
490 * PathStripToRootA [SHLWAPI.@]
492 BOOL WINAPI PathStripToRootA(LPSTR lpszPath)
494 TRACE("%s\n", lpszPath);
496 if (!lpszPath) return FALSE;
497 while(!PathIsRootA(lpszPath))
498 if (!PathRemoveFileSpecA(lpszPath)) return FALSE;
502 /*************************************************************************
503 * PathStripToRootW [SHLWAPI.@]
505 BOOL WINAPI PathStripToRootW(LPWSTR lpszPath)
507 TRACE("%s\n", debugstr_w(lpszPath));
509 if (!lpszPath) return FALSE;
510 while(!PathIsRootW(lpszPath))
511 if (!PathRemoveFileSpecW(lpszPath)) return FALSE;
515 /*************************************************************************
516 * PathRemoveArgsA [SHLWAPI.@]
519 void WINAPI PathRemoveArgsA(LPSTR lpszPath)
521 TRACE("%s\n",lpszPath);
525 LPSTR lpszArgs = PathGetArgsA(lpszPath);
528 LPSTR lpszLastChar = CharPrevA(lpszPath, lpszArgs);
529 if(*lpszLastChar==' ') *lpszLastChar = '\0';
534 /*************************************************************************
535 * PathRemoveArgsW [SHLWAPI.@]
537 void WINAPI PathRemoveArgsW(LPWSTR lpszPath)
539 TRACE("%s\n", debugstr_w(lpszPath));
543 LPWSTR lpszArgs = PathGetArgsW(lpszPath);
546 LPWSTR lpszLastChar = CharPrevW(lpszPath, lpszArgs);
547 if(*lpszLastChar==' ') *lpszLastChar = '\0';
552 /*************************************************************************
553 * PathRemoveExtensionA [SHLWAPI.@]
555 void WINAPI PathRemoveExtensionA(LPSTR lpszPath)
557 LPSTR lpszExtension = PathFindExtensionA(lpszPath);
559 TRACE("%s\n", lpszPath);
561 if (lpszExtension) *lpszExtension='\0';
564 /*************************************************************************
565 * PathRemoveExtensionW [SHLWAPI.@]
567 void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
569 LPWSTR lpszExtension = PathFindExtensionW(lpszPath);
571 TRACE("%s\n", debugstr_w(lpszPath));
573 if (lpszExtension) *lpszExtension='\0';
576 /*************************************************************************
577 * PathRemoveBackslashA [SHLWAPI.@]
579 * If the path ends in a backslash it is replaced by a NULL
580 * and the address of the NULL is returned
582 * the address of the last character is returned.
585 * "c:\": keep backslash
587 LPSTR WINAPI PathRemoveBackslashA( LPSTR lpszPath )
594 len = strlen(lpszPath);
595 szTemp = CharPrevA(lpszPath, lpszPath+len);
596 if (! PathIsRootA(lpszPath))
598 if (*szTemp == '\\') *szTemp = '\0';
604 /*************************************************************************
605 * PathRemoveBackslashW [SHLWAPI.@]
607 LPWSTR WINAPI PathRemoveBackslashW( LPWSTR lpszPath )
610 LPWSTR szTemp = NULL;
614 len = strlenW(lpszPath);
615 szTemp = CharPrevW(lpszPath, lpszPath+len);
616 if (! PathIsRootW(lpszPath))
618 if (*szTemp == '\\') *szTemp = '\0';
629 /*************************************************************************
630 * PathRemoveBlanksA [SHLWAPI.@]
633 * remove spaces from beginning and end of passed string
635 void WINAPI PathRemoveBlanksA(LPSTR str)
643 while (*x==' ') x = CharNextA(x);
644 if (x!=str) strcpy(str,x);
646 while (*x==' ') x = CharPrevA(str, x);
647 if (*x==' ') *x='\0';
651 /*************************************************************************
652 * PathRemoveBlanksW [SHLWAPI.@]
654 void WINAPI PathRemoveBlanksW(LPWSTR str)
658 TRACE("%s\n",debugstr_w(str));
662 while (*x==' ') x = CharNextW(x);
663 if (x!=str) strcpyW(str,x);
664 x=str+strlenW(str)-1;
665 while (*x==' ') x = CharPrevW(str, x);
666 if (*x==' ') *x='\0';
670 /*************************************************************************
671 * PathQuoteSpacesA [SHLWAPI.@]
674 LPSTR WINAPI PathQuoteSpacesA(LPSTR lpszPath)
676 TRACE("%s\n",lpszPath);
678 if(StrChrA(lpszPath,' '))
680 int len = strlen(lpszPath);
681 RtlMoveMemory(lpszPath+1, lpszPath, len);
691 /*************************************************************************
692 * PathQuoteSpacesW [SHLWAPI.@]
694 LPWSTR WINAPI PathQuoteSpacesW(LPWSTR lpszPath)
696 TRACE("%s\n",debugstr_w(lpszPath));
698 if(StrChrW(lpszPath,' '))
700 int len = strlenW(lpszPath);
701 RtlMoveMemory(lpszPath+1, lpszPath, len*sizeof(WCHAR));
711 /*************************************************************************
712 * PathUnquoteSpacesA [SHLWAPI.@]
715 * unquote string (remove ")
717 VOID WINAPI PathUnquoteSpacesA(LPSTR str)
719 DWORD len = strlen(str);
732 /*************************************************************************
733 * PathUnquoteSpacesW [SHLWAPI.@]
735 VOID WINAPI PathUnquoteSpacesW(LPWSTR str)
737 DWORD len = strlenW(str);
739 TRACE("%s\n",debugstr_w(str));
750 /*************************************************************************
751 * PathParseIconLocationA [SHLWAPI.@]
753 int WINAPI PathParseIconLocationA(LPSTR lpszPath)
755 LPSTR lpstrComma = strchr(lpszPath, ',');
758 TRACE("%s\n", debugstr_a(lpszPath));
760 if (lpstrComma && lpstrComma[1])
763 ret = atoi(&lpstrComma[1]);
766 PathUnquoteSpacesA(lpszPath);
770 /*************************************************************************
771 * PathParseIconLocationW [SHLWAPI.@]
773 int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
775 LPWSTR lpstrComma = strchrW(lpszPath, ',');
778 TRACE("%s\n", debugstr_w(lpszPath));
780 if (lpstrComma && lpstrComma[1])
783 ret = _wtoi(&lpstrComma[1]);
785 PathUnquoteSpacesW(lpszPath);
790 ########## cleaning and resolving paths ##########
793 /*************************************************************************
794 * PathFindOnPathA [SHLWAPI.@]
796 BOOL WINAPI PathFindOnPathA(LPSTR sFile, LPCSTR *sOtherDirs)
798 FIXME("%s %p\n",sFile, sOtherDirs);
802 /*************************************************************************
803 * PathFindOnPathW [SHLWAPI.@]
805 BOOL WINAPI PathFindOnPathW(LPWSTR sFile, LPCWSTR *sOtherDirs)
807 FIXME("%s %p\n",debugstr_w(sFile), sOtherDirs);
811 /*************************************************************************
812 * PathCompactPathExA [SHLWAPI.@]
814 BOOL WINAPI PathCompactPathExA(
820 FIXME("%p %s 0x%08x 0x%08lx\n", pszOut, pszSrc, cchMax, dwFlags);
824 /*************************************************************************
825 * PathCompactPathExW [SHLWAPI.@]
827 BOOL WINAPI PathCompactPathExW(
833 FIXME("%p %s 0x%08x 0x%08lx\n", pszOut, debugstr_w(pszSrc), cchMax, dwFlags);
838 ########## Path Testing ##########
841 /*************************************************************************
842 * PathIsUNCA [SHLWAPI.@]
845 * PathIsUNC(char*path);
847 BOOL WINAPI PathIsUNCA(LPCSTR lpszPath)
849 TRACE("%s\n",lpszPath);
851 return (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\'));
854 /*************************************************************************
855 * PathIsUNCW [SHLWAPI.@]
857 BOOL WINAPI PathIsUNCW(LPCWSTR lpszPath)
859 TRACE("%s\n",debugstr_w(lpszPath));
861 return (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\'));
864 /*************************************************************************
865 * PathIsRelativeA [SHLWAPI.@]
867 BOOL WINAPI PathIsRelativeA (LPCSTR lpszPath)
869 TRACE("lpszPath=%s\n",lpszPath);
871 return (lpszPath && (lpszPath[0]!='\\' && lpszPath[1]!=':'));
874 /*************************************************************************
875 * PathIsRelativeW [SHLWAPI.@]
877 BOOL WINAPI PathIsRelativeW (LPCWSTR lpszPath)
879 TRACE("lpszPath=%s\n",debugstr_w(lpszPath));
881 return (lpszPath && (lpszPath[0]!='\\' && lpszPath[1]!=':'));
884 /*************************************************************************
885 * PathIsRootA [SHLWAPI.@]
888 * TRUE if the path points to a root directory
890 BOOL WINAPI PathIsRootA(LPCSTR lpszPath)
892 TRACE("%s\n",lpszPath);
895 if (lpszPath[1]==':' && lpszPath[2]=='\\' && lpszPath[3]=='\0')
899 if (lpszPath[0]=='\\' && lpszPath[1]=='\0')
902 /* UNC "\\<computer>\<share>" */
903 if (lpszPath[0]=='\\' && lpszPath[1]=='\\')
905 int foundbackslash = 0;
909 if (*lpszPath=='\\') foundbackslash++;
910 lpszPath = CharNextA(lpszPath);
912 if (foundbackslash <= 1)
918 /*************************************************************************
919 * PathIsRootW [SHLWAPI.@]
921 BOOL WINAPI PathIsRootW(LPCWSTR lpszPath)
923 TRACE("%s\n",debugstr_w(lpszPath));
926 if (lpszPath[1]==':' && lpszPath[2]=='\\' && lpszPath[3]=='\0')
930 if (lpszPath[0]=='\\' && lpszPath[1]=='\0')
933 /* UNC "\\<computer>\<share>" */
934 if (lpszPath[0]=='\\' && lpszPath[1]=='\\')
936 int foundbackslash = 0;
940 if (*lpszPath=='\\') foundbackslash++;
941 lpszPath = CharNextW(lpszPath);
943 if (foundbackslash <= 1)
950 /*************************************************************************
951 * PathIsDirectoryA [SHLWAPI.@]
953 BOOL WINAPI PathIsDirectoryA(LPCSTR lpszPath)
957 TRACE("%s\n", debugstr_a(lpszPath));
959 dwAttr = GetFileAttributesA(lpszPath);
960 return (dwAttr != -1) ? dwAttr & FILE_ATTRIBUTE_DIRECTORY : 0;
963 /*************************************************************************
964 * PathIsDirectoryW [SHLWAPI.@]
966 BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
970 TRACE("%s\n", debugstr_w(lpszPath));
972 dwAttr = GetFileAttributesW(lpszPath);
973 return (dwAttr != -1) ? dwAttr & FILE_ATTRIBUTE_DIRECTORY : 0;
976 /*************************************************************************
977 * PathFileExistsA [SHLWAPI.@]
980 * file_exists(char *fn);
982 BOOL WINAPI PathFileExistsA(LPCSTR lpszPath)
984 TRACE("%s\n",lpszPath);
985 return (GetFileAttributesA(lpszPath)!=-1);
988 /*************************************************************************
989 * PathFileExistsW [SHLWAPI.@]
991 BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
993 TRACE("%s\n",debugstr_w(lpszPath));
994 return (GetFileAttributesW(lpszPath)!=-1);
997 /*************************************************************************
998 * PathMatchSingleMaskA [internal]
1001 * internal (used by PathMatchSpec)
1003 static BOOL PathMatchSingleMaskA(LPCSTR name, LPCSTR mask)
1005 while (*name && *mask && *mask!=';')
1011 if (PathMatchSingleMaskA(name,mask+1)) return 1; /* try substrings */
1015 if (toupper(*mask)!=toupper(*name) && *mask!='?') return 0;
1016 name = CharNextA(name);
1017 mask = CharNextA(mask);
1021 while (*mask=='*') mask++;
1022 if (!*mask || *mask==';') return 1;
1027 /*************************************************************************
1028 * PathMatchSingleMaskW [internal]
1030 static BOOL PathMatchSingleMaskW(LPCWSTR name, LPCWSTR mask)
1032 while (*name && *mask && *mask!=';')
1038 if (PathMatchSingleMaskW(name,mask+1)) return 1; /* try substrings */
1042 if (toupperW(*mask)!=toupperW(*name) && *mask!='?') return 0;
1043 name = CharNextW(name);
1044 mask = CharNextW(mask);
1048 while (*mask=='*') mask++;
1049 if (!*mask || *mask==';') return 1;
1053 /*************************************************************************
1054 * PathMatchSpecA [SHLWAPI.@]
1057 * used from COMDLG32
1059 BOOL WINAPI PathMatchSpecA(LPCSTR name, LPCSTR mask)
1061 TRACE("%s %s\n",name,mask);
1063 if (!lstrcmpA( mask, "*.*" )) return 1; /* we don't require a period */
1067 if (PathMatchSingleMaskA(name,mask)) return 1; /* helper function */
1068 while (*mask && *mask!=';') mask = CharNextA(mask);
1072 while (*mask==' ') mask++; /* masks may be separated by "; " */
1078 /*************************************************************************
1079 * PathMatchSpecW [SHLWAPI.@]
1081 BOOL WINAPI PathMatchSpecW(LPCWSTR name, LPCWSTR mask)
1083 static const WCHAR stemp[] = { '*','.','*',0 };
1084 TRACE("%s %s\n",debugstr_w(name),debugstr_w(mask));
1086 if (!lstrcmpW( mask, stemp )) return 1; /* we don't require a period */
1090 if (PathMatchSingleMaskW(name,mask)) return 1; /* helper function */
1091 while (*mask && *mask!=';') mask = CharNextW(mask);
1095 while (*mask==' ') mask++; /* masks may be separated by "; " */
1101 /*************************************************************************
1102 * PathIsSameRootA [SHLWAPI.@]
1105 * what to do with "\path" ??
1107 BOOL WINAPI PathIsSameRootA(LPCSTR lpszPath1, LPCSTR lpszPath2)
1109 TRACE("%s %s\n", lpszPath1, lpszPath2);
1111 if (PathIsRelativeA(lpszPath1) || PathIsRelativeA(lpszPath2)) return FALSE;
1114 if ( toupper(lpszPath1[0])==toupper(lpszPath2[0]) &&
1115 lpszPath1[1]==':' && lpszPath2[1]==':' &&
1116 lpszPath1[2]=='\\' && lpszPath2[2]=='\\')
1120 if (lpszPath1[0]=='\\' && lpszPath2[0]=='\\' &&
1121 lpszPath1[1]=='\\' && lpszPath2[1]=='\\')
1123 int pos=2, bsfound=0;
1124 while (lpszPath1[pos] && lpszPath2[pos] &&
1125 (lpszPath1[pos] == lpszPath2[pos]))
1127 if (lpszPath1[pos]=='\\') bsfound++;
1128 if (bsfound == 2) return TRUE;
1129 pos++; /* FIXME: use CharNext*/
1131 return (lpszPath1[pos] == lpszPath2[pos]);
1136 /*************************************************************************
1137 * PathIsSameRootW [SHLWAPI.@]
1139 BOOL WINAPI PathIsSameRootW(LPCWSTR lpszPath1, LPCWSTR lpszPath2)
1141 TRACE("%s %s\n", debugstr_w(lpszPath1), debugstr_w(lpszPath2));
1143 if (PathIsRelativeW(lpszPath1) || PathIsRelativeW(lpszPath2)) return FALSE;
1146 if ( toupperW(lpszPath1[0])==toupperW(lpszPath2[0]) &&
1147 lpszPath1[1]==':' && lpszPath2[1]==':' &&
1148 lpszPath1[2]=='\\' && lpszPath2[2]=='\\')
1152 if (lpszPath1[0]=='\\' && lpszPath2[0]=='\\' &&
1153 lpszPath1[1]=='\\' && lpszPath2[1]=='\\')
1155 int pos=2, bsfound=0;
1156 while (lpszPath1[pos] && lpszPath2[pos] &&
1157 (lpszPath1[pos] == lpszPath2[pos]))
1159 if (lpszPath1[pos]=='\\') bsfound++;
1160 if (bsfound == 2) return TRUE;
1161 pos++;/* FIXME: use CharNext*/
1163 return (lpszPath1[pos] == lpszPath2[pos]);
1168 /*************************************************************************
1169 * PathIsURLA (SHLWAPI.@)
1171 BOOL WINAPI PathIsURLA(LPCSTR lpstrPath)
1173 UNKNOWN_SHLWAPI_1 base;
1176 if (!lpstrPath || !*lpstrPath) return FALSE;
1180 res1 = SHLWAPI_1(lpstrPath, &base);
1181 return (base.fcncde) ? TRUE : FALSE;
1184 /*************************************************************************
1185 * PathIsURLW (SHLWAPI.@)
1187 BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
1189 UNKNOWN_SHLWAPI_2 base;
1192 if (!lpstrPath || !*lpstrPath) return FALSE;
1196 res1 = SHLWAPI_2(lpstrPath, &base);
1197 return (base.fcncde) ? TRUE : FALSE;
1201 /*************************************************************************
1202 * PathIsContentTypeA [SHLWAPI.@]
1204 BOOL WINAPI PathIsContentTypeA(LPCSTR pszPath, LPCSTR pszContentType)
1206 FIXME("%s %s\n", pszPath, pszContentType);
1210 /*************************************************************************
1211 * PathIsContentTypeW [SHLWAPI.@]
1213 BOOL WINAPI PathIsContentTypeW(LPCWSTR pszPath, LPCWSTR pszContentType)
1215 FIXME("%s %s\n", debugstr_w(pszPath), debugstr_w(pszContentType));
1219 /*************************************************************************
1220 * PathIsFileSpecA [SHLWAPI.@]
1222 BOOL WINAPI PathIsFileSpecA(LPCSTR pszPath)
1224 FIXME("%s\n", pszPath);
1228 /*************************************************************************
1229 * PathIsFileSpecW [SHLWAPI.@]
1231 BOOL WINAPI PathIsFileSpecW(LPCWSTR pszPath)
1233 FIXME("%s\n", debugstr_w(pszPath));
1237 /*************************************************************************
1238 * PathIsPrefixA [SHLWAPI.@]
1240 BOOL WINAPI PathIsPrefixA(LPCSTR pszPrefix, LPCSTR pszPath)
1242 FIXME("%s %s\n", pszPrefix, pszPath);
1246 /*************************************************************************
1247 * PathIsPrefixW [SHLWAPI.@]
1249 BOOL WINAPI PathIsPrefixW(LPCWSTR pszPrefix, LPCWSTR pszPath)
1251 FIXME("%s %s\n", debugstr_w(pszPrefix), debugstr_w(pszPath));
1255 /*************************************************************************
1256 * PathIsSystemFolderA [SHLWAPI.@]
1258 BOOL WINAPI PathIsSystemFolderA(LPCSTR pszPath, DWORD dwAttrb)
1260 FIXME("%s 0x%08lx\n", pszPath, dwAttrb);
1264 /*************************************************************************
1265 * PathIsSystemFolderW [SHLWAPI.@]
1267 BOOL WINAPI PathIsSystemFolderW(LPCWSTR pszPath, DWORD dwAttrb)
1269 FIXME("%s 0x%08lx\n", debugstr_w(pszPath), dwAttrb);
1273 /*************************************************************************
1274 * PathIsUNCServerA [SHLWAPI.@]
1276 BOOL WINAPI PathIsUNCServerA(
1279 TRACE("%s\n", debugstr_a(lpszPath));
1280 if (lpszPath[0]=='\\' && lpszPath[1]=='\\')
1282 int foundbackslash = 0;
1286 if (*lpszPath=='\\') foundbackslash++;
1287 lpszPath = CharNextA(lpszPath);
1289 if (foundbackslash == 0)
1295 /*************************************************************************
1296 * PathIsUNCServerW [SHLWAPI.@]
1298 BOOL WINAPI PathIsUNCServerW(
1301 TRACE("%s\n", debugstr_w(lpszPath));
1302 if (lpszPath[0]=='\\' && lpszPath[1]=='\\')
1304 int foundbackslash = 0;
1308 if (*lpszPath=='\\') foundbackslash++;
1309 lpszPath = CharNextW(lpszPath);
1311 if (foundbackslash == 0)
1317 /*************************************************************************
1318 * PathIsUNCServerShareA [SHLWAPI.@]
1320 BOOL WINAPI PathIsUNCServerShareA(
1323 TRACE("%s\n", debugstr_a(lpszPath));
1324 if (!lpszPath) return FALSE;
1325 if (lpszPath[0]=='\\' && lpszPath[1]=='\\')
1327 int foundbackslash = 0;
1331 if (*lpszPath=='\\') foundbackslash++;
1332 lpszPath = CharNextA(lpszPath);
1334 if (foundbackslash == 1)
1340 /*************************************************************************
1341 * PathIsUNCServerShareW [SHLWAPI.@]
1343 BOOL WINAPI PathIsUNCServerShareW(
1346 TRACE("%s\n", debugstr_w(lpszPath));
1347 if (!lpszPath) return FALSE;
1348 if (lpszPath[0]=='\\' && lpszPath[1]=='\\')
1350 int foundbackslash = 0;
1354 if (*lpszPath=='\\') foundbackslash++;
1355 lpszPath = CharNextW(lpszPath);
1357 if (foundbackslash == 1)
1363 /*************************************************************************
1364 * PathCanonicalizeA [SHLWAPI.@]
1367 * returnvalue, use CharNext
1370 BOOL WINAPI PathCanonicalizeA(LPSTR pszBuf, LPCSTR pszPath)
1372 int OffsetMin = 0, OffsetSrc = 0, OffsetDst = 0, LenSrc = strlen(pszPath);
1373 BOOL bModifyed = FALSE;
1375 TRACE("%p %s\n", pszBuf, pszPath);
1377 pszBuf[OffsetDst]='\0';
1379 /* keep the root of the path */
1380 if( LenSrc && (pszPath[OffsetSrc]=='\\'))
1382 pszBuf[OffsetDst++] = pszPath[OffsetSrc++]; OffsetMin++; LenSrc--;
1384 else if ( (LenSrc >= 2) && (pszPath[OffsetSrc+1] == ':'))
1386 pszBuf[OffsetDst++] = pszPath[OffsetSrc++]; OffsetMin++; LenSrc--;
1387 pszBuf[OffsetDst++] = pszPath[OffsetSrc++]; OffsetMin++; LenSrc--;
1388 if (LenSrc && (pszPath[OffsetSrc] == '\\'))
1390 pszBuf[OffsetDst++] = pszPath[OffsetSrc++]; OffsetMin++; LenSrc--;
1391 if (LenSrc == 1 && pszPath[OffsetSrc]=='.')
1394 OffsetSrc++; LenSrc--; bModifyed = TRUE;
1396 else if (LenSrc == 2 && pszPath[OffsetSrc]=='.' && pszPath[OffsetSrc+1]=='.')
1399 OffsetSrc+=2; LenSrc-=2; bModifyed = TRUE;
1404 /* ".\" at the beginning of the path */
1405 if (LenSrc >= 2 && pszPath[OffsetSrc]=='.' && pszPath[OffsetSrc+1]=='\\')
1407 OffsetSrc+=2; LenSrc-=2; bModifyed = TRUE;
1412 if((LenSrc>=3) && (pszPath[OffsetSrc]=='\\') && (pszPath[OffsetSrc+1]=='.') && (pszPath[OffsetSrc+2]=='.'))
1414 /* "\.." found, go one deeper */
1415 while((OffsetDst > OffsetMin) && (pszBuf[OffsetDst]!='\\')) OffsetDst--;
1416 OffsetSrc += 3; LenSrc -= 3; bModifyed = TRUE;
1417 if(OffsetDst == OffsetMin && pszPath[OffsetSrc]=='\\') OffsetSrc++;
1418 pszBuf[OffsetDst] = '\0'; /* important for \..\.. */
1420 else if(LenSrc>=2 && pszPath[OffsetSrc]=='\\' && pszPath[OffsetSrc+1]=='.' )
1422 /* "\." found, skip it */
1423 OffsetSrc += 2; LenSrc-=2; bModifyed = TRUE;
1427 pszBuf[OffsetDst++] = pszPath[OffsetSrc++]; LenSrc--;
1430 pszBuf[OffsetDst] = '\0';
1431 TRACE("-- %s %u\n", pszBuf, bModifyed);
1436 /*************************************************************************
1437 * PathCanonicalizeW [SHLWAPI.@]
1440 * returnvalue, use CharNext
1442 BOOL WINAPI PathCanonicalizeW(LPWSTR pszBuf, LPCWSTR pszPath)
1444 int OffsetMin = 0, OffsetSrc = 0, OffsetDst = 0, LenSrc = strlenW(pszPath);
1445 BOOL bModifyed = FALSE;
1447 TRACE("%p %s\n", pszBuf, debugstr_w(pszPath));
1449 pszBuf[OffsetDst]='\0';
1451 /* keep the root of the path */
1452 if( LenSrc && (pszPath[OffsetSrc]=='\\'))
1454 pszBuf[OffsetDst++] = pszPath[OffsetSrc++]; OffsetMin++; LenSrc--;
1456 else if ( (LenSrc >= 2) && (pszPath[OffsetSrc+1] == ':'))
1458 pszBuf[OffsetDst++] = pszPath[OffsetSrc++]; OffsetMin++; LenSrc--;
1459 pszBuf[OffsetDst++] = pszPath[OffsetSrc++]; OffsetMin++; LenSrc--;
1460 if (LenSrc && (pszPath[OffsetSrc] == '\\'))
1462 pszBuf[OffsetDst++] = pszPath[OffsetSrc++]; OffsetMin++; LenSrc--;
1463 if (LenSrc == 1 && pszPath[OffsetSrc]=='.')
1466 OffsetSrc++; LenSrc--; bModifyed = TRUE;
1468 else if (LenSrc == 2 && pszPath[OffsetSrc]=='.' && pszPath[OffsetSrc+1]=='.')
1471 OffsetSrc+=2; LenSrc-=2; bModifyed = TRUE;
1476 /* ".\" at the beginning of the path */
1477 if (LenSrc >= 2 && pszPath[OffsetSrc]=='.' && pszPath[OffsetSrc+1]=='\\')
1479 OffsetSrc+=2; LenSrc-=2; bModifyed = TRUE;
1484 if((LenSrc>=3) && (pszPath[OffsetSrc]=='\\') && (pszPath[OffsetSrc+1]=='.') && (pszPath[OffsetSrc+2]=='.'))
1486 /* "\.." found, go one deeper */
1487 while((OffsetDst > OffsetMin) && (pszBuf[OffsetDst]!='\\')) OffsetDst--;
1488 OffsetSrc += 3; LenSrc -= 3; bModifyed = TRUE;
1489 if(OffsetDst == OffsetMin && pszPath[OffsetSrc]=='\\') OffsetSrc++;
1490 pszBuf[OffsetDst] = '\0'; /* important for \..\.. */
1492 else if(LenSrc>=2 && pszPath[OffsetSrc]=='\\' && pszPath[OffsetSrc+1]=='.' )
1494 /* "\." found, skip it */
1495 OffsetSrc += 2; LenSrc-=2; bModifyed = TRUE;
1499 pszBuf[OffsetDst++] = pszPath[OffsetSrc++]; LenSrc--;
1502 pszBuf[OffsetDst] = '\0';
1503 TRACE("-- %s %u\n", debugstr_w(pszBuf), bModifyed);
1507 /*************************************************************************
1508 * PathFindNextComponentA [SHLWAPI.@]
1513 * aa "" (pointer to traling NULL)
1514 * aa\ "" (pointer to traling NULL)
1515 * aa\\ "" (pointer to traling NULL)
1522 LPSTR WINAPI PathFindNextComponentA(LPCSTR pszPath)
1526 TRACE("%s\n", pszPath);
1528 if(!pszPath || !*pszPath) return NULL;
1529 if(!(pos = StrChrA(pszPath, '\\')))
1530 return (LPSTR) pszPath + strlen(pszPath);
1532 if(pos[0] == '\\') pos++;
1536 /*************************************************************************
1537 * PathFindNextComponentW [SHLWAPI.@]
1539 LPWSTR WINAPI PathFindNextComponentW(LPCWSTR pszPath)
1543 TRACE("%s\n", debugstr_w(pszPath));
1545 if(!pszPath || !*pszPath) return NULL;
1546 if (!(pos = StrChrW(pszPath, '\\')))
1547 return (LPWSTR) pszPath + strlenW(pszPath);
1549 if(pos[0] == '\\') pos++;
1553 /*************************************************************************
1554 * PathAddExtensionA [SHLWAPI.@]
1557 * it adds never a dot
1560 BOOL WINAPI PathAddExtensionA(
1562 LPCSTR pszExtension)
1566 if (*(PathFindExtensionA(pszPath))) return FALSE;
1568 if (!pszExtension || *pszExtension=='\0')
1569 strcat(pszPath, "exe");
1571 strcat(pszPath, pszExtension);
1577 /*************************************************************************
1578 * PathAddExtensionW [SHLWAPI.@]
1580 BOOL WINAPI PathAddExtensionW(
1582 LPCWSTR pszExtension)
1584 static const WCHAR ext[] = { 'e','x','e',0 };
1588 if (*(PathFindExtensionW(pszPath))) return FALSE;
1590 if (!pszExtension || *pszExtension=='\0')
1591 strcatW(pszPath, ext);
1593 strcatW(pszPath, pszExtension);
1599 /*************************************************************************
1600 * PathMakePrettyA [SHLWAPI.@]
1602 BOOL WINAPI PathMakePrettyA(
1605 FIXME("%s\n", lpPath);
1609 /*************************************************************************
1610 * PathMakePrettyW [SHLWAPI.@]
1612 BOOL WINAPI PathMakePrettyW(
1615 FIXME("%s\n", debugstr_w(lpPath));
1620 /*************************************************************************
1621 * PathCommonPrefixA [SHLWAPI.@]
1623 int WINAPI PathCommonPrefixA(
1628 FIXME("%s %s %p\n", pszFile1, pszFile2, achPath);
1632 /*************************************************************************
1633 * PathCommonPrefixW [SHLWAPI.@]
1635 int WINAPI PathCommonPrefixW(
1640 FIXME("%s %s %p\n", debugstr_w(pszFile1), debugstr_w(pszFile2),achPath );
1644 /*************************************************************************
1645 * PathCompactPathA [SHLWAPI.@]
1647 BOOL WINAPI PathCompactPathA(HDC hDC, LPSTR pszPath, UINT dx)
1649 FIXME("0x%08x %s 0x%08x\n", hDC, pszPath, dx);
1653 /*************************************************************************
1654 * PathCompactPathW [SHLWAPI.@]
1656 BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR pszPath, UINT dx)
1658 FIXME("0x%08x %s 0x%08x\n", hDC, debugstr_w(pszPath), dx);
1662 /*************************************************************************
1663 * PathGetCharTypeA [SHLWAPI.@]
1665 UINT WINAPI PathGetCharTypeA(UCHAR ch)
1671 /* We could use them in filenames, but this would confuse 'ls' */
1674 if ((ch == '*') || (ch=='?'))
1676 if ((ch == '\\') || (ch=='/'))
1677 return GCT_SEPARATOR;
1679 /* all normal characters, no lower case letters */
1680 if ((ch > ' ') && (ch < 0x7f) && !islower(ch))
1681 flags |= GCT_SHORTCHAR;
1682 /* All other characters are valid in long filenames, even umlauts */
1683 return flags | GCT_LFNCHAR;
1686 /*************************************************************************
1687 * PathGetCharTypeW [SHLWAPI.@]
1689 UINT WINAPI PathGetCharTypeW(WCHAR ch)
1691 FIXME("%c, using ascii version\n", ch);
1692 return PathGetCharTypeA(ch);
1695 /*************************************************************************
1696 * PathMakeSystemFolderA [SHLWAPI.@]
1698 BOOL WINAPI PathMakeSystemFolderA(LPCSTR pszPath)
1700 FIXME("%s\n", pszPath);
1704 /*************************************************************************
1705 * PathMakeSystemFolderW [SHLWAPI.@]
1707 BOOL WINAPI PathMakeSystemFolderW(LPCWSTR pszPath)
1709 FIXME("%s\n", debugstr_w(pszPath));
1713 /*************************************************************************
1714 * PathRenameExtensionA [SHLWAPI.@]
1716 BOOL WINAPI PathRenameExtensionA(LPSTR pszPath, LPCSTR pszExt)
1718 LPSTR pszExtension = PathFindExtensionA(pszPath);
1720 if (!pszExtension) return FALSE;
1721 if (pszExtension-pszPath + strlen(pszExt) > MAX_PATH) return FALSE;
1723 strcpy(pszExtension, pszExt);
1724 TRACE("%s\n", pszPath);
1728 /*************************************************************************
1729 * PathRenameExtensionW [SHLWAPI.@]
1731 BOOL WINAPI PathRenameExtensionW(LPWSTR pszPath, LPCWSTR pszExt)
1733 LPWSTR pszExtension = PathFindExtensionW(pszPath);
1735 if (!pszExtension) return FALSE;
1736 if (pszExtension-pszPath + strlenW(pszExt) > MAX_PATH) return FALSE;
1738 strcpyW(pszExtension, pszExt);
1739 TRACE("%s\n", debugstr_w(pszPath));
1743 /*************************************************************************
1744 * PathSearchAndQualifyA [SHLWAPI.@]
1746 BOOL WINAPI PathSearchAndQualifyA(
1751 FIXME("%s %s 0x%08x\n", pszPath, pszBuf, cchBuf);
1755 /*************************************************************************
1756 * PathSearchAndQualifyW [SHLWAPI.@]
1758 BOOL WINAPI PathSearchAndQualifyW(
1763 FIXME("%s %s 0x%08x\n", debugstr_w(pszPath), debugstr_w(pszBuf), cchBuf);
1767 /*************************************************************************
1768 * PathSkipRootA [SHLWAPI.@]
1770 LPSTR WINAPI PathSkipRootA(LPCSTR pszPath)
1772 FIXME("%s\n", pszPath);
1773 return (LPSTR)pszPath;
1776 /*************************************************************************
1777 * PathSkipRootW [SHLWAPI.@]
1779 LPWSTR WINAPI PathSkipRootW(LPCWSTR pszPath)
1781 FIXME("%s\n", debugstr_w(pszPath));
1782 return (LPWSTR)pszPath;
1785 /*************************************************************************
1786 * PathCreateFromUrlA [SHLWAPI.@]
1788 HRESULT WINAPI PathCreateFromUrlA(
1794 /* extracts thing prior to : in pszURL and checks against:
1798 * about - if match returns E_INVALIDARG
1800 FIXME("%s %p %p 0x%08lx\n",
1801 pszUrl, pszPath, pcchPath, dwFlags);
1802 return E_INVALIDARG;
1805 /*************************************************************************
1806 * PathCreateFromUrlW [SHLWAPI.@]
1808 HRESULT WINAPI PathCreateFromUrlW(
1814 /* extracts thing prior to : in pszURL and checks against:
1818 * about - if match returns E_INVALIDARG
1820 FIXME("%s %p %p 0x%08lx\n",
1821 debugstr_w(pszUrl), pszPath, pcchPath, dwFlags);
1822 return E_INVALIDARG;
1825 /*************************************************************************
1826 * PathRelativePathToA [SHLWAPI.@]
1828 BOOL WINAPI PathRelativePathToA(
1835 FIXME("%s %s 0x%08lx %s 0x%08lx\n",
1836 pszPath, pszFrom, dwAttrFrom, pszTo, dwAttrTo);
1840 /*************************************************************************
1841 * PathRelativePathToW [SHLWAPI.@]
1843 BOOL WINAPI PathRelativePathToW(
1850 FIXME("%s %s 0x%08lx %s 0x%08lx\n",
1851 debugstr_w(pszPath), debugstr_w(pszFrom), dwAttrFrom, debugstr_w(pszTo), dwAttrTo);
1855 /*************************************************************************
1856 * PathUnmakeSystemFolderA [SHLWAPI.@]
1858 BOOL WINAPI PathUnmakeSystemFolderA(LPCSTR pszPath)
1860 FIXME("%s\n", pszPath);
1864 /*************************************************************************
1865 * PathUnmakeSystemFolderW [SHLWAPI.@]
1867 BOOL WINAPI PathUnmakeSystemFolderW(LPCWSTR pszPath)
1869 FIXME("%s\n", debugstr_w(pszPath));
1874 ########## special ##########
1877 /*************************************************************************
1878 * PathSetDlgItemPathA [SHLWAPI.@]
1881 * use PathCompactPath to make sure, the path fits into the control
1883 BOOL WINAPI PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR pszPath)
1884 { TRACE("%x %x %s\n",hDlg, id, pszPath);
1885 return SetDlgItemTextA(hDlg, id, pszPath);
1888 /*************************************************************************
1889 * PathSetDlgItemPathW [SHLWAPI.@]
1891 BOOL WINAPI PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR pszPath)
1892 { TRACE("%x %x %s\n",hDlg, id, debugstr_w(pszPath));
1893 return SetDlgItemTextW(hDlg, id, pszPath);