23 #include "wine/port.h" 29 #include "wine/unicode.h" 36 #define NO_SHLWAPI_STREAM 52 #define GET_FUNC(func, module, name, fail) \ 55 if (!SHLWAPI_h##module && !(SHLWAPI_h##module = LoadLibraryA(#module ".dll"))) return fail; \ 56 func = (fn##func)GetProcAddress(SHLWAPI_h##module, name); \ 57 if (!func) return fail; \ 110 if (lpszPath && lpszAppend)
113 while (*lpszAppend ==
'\\')
130 if (lpszPath && lpszAppend)
133 while (*lpszAppend ==
'\\')
169 if (!lpszDir && !lpszFile)
204 if (!lpszDir && !lpszFile)
210 if ((!lpszFile || !*lpszFile) && lpszDir)
217 if (!lpszDir || !*lpszDir || *lpszFile !=
'\\' ||
PathIsUNCW(lpszFile))
266 LPSTR prev = lpszPath;
306 if (lpszPath[-1] !=
'\\')
335 lpszPath[0] =
'A' +
drive;
354 lpszPath[0] =
'A' +
drive;
375 LPCSTR lastSlash = lpszPath;
379 while (lpszPath && *lpszPath)
381 if ((*lpszPath ==
'\\' || *lpszPath ==
'/' || *lpszPath ==
':') &&
382 lpszPath[1] && lpszPath[1] !=
'\\' && lpszPath[1] !=
'/')
383 lastSlash = lpszPath + 1;
386 return (
LPSTR)lastSlash;
400 while (lpszPath && *lpszPath)
402 if ((*lpszPath ==
'\\' || *lpszPath ==
'/' || *lpszPath ==
':') &&
403 lpszPath[1] && lpszPath[1] !=
'\\' && lpszPath[1] !=
'/')
404 lastSlash = lpszPath + 1;
432 if (*lpszPath ==
'\\' || *lpszPath==
' ')
434 else if (*lpszPath ==
'.')
435 lastpoint = lpszPath;
439 return (
LPSTR)(lastpoint ? lastpoint : lpszPath);
457 if (*lpszPath ==
'\\' || *lpszPath==
' ')
459 else if (*lpszPath ==
'.')
460 lastpoint = lpszPath;
464 return (
LPWSTR)(lastpoint ? lastpoint : lpszPath);
491 if ((*lpszPath==
' ') && !bSeenQuote)
492 return (
LPSTR)lpszPath + 1;
493 if (*lpszPath ==
'"')
494 bSeenQuote = !bSeenQuote;
498 return (
LPSTR)lpszPath;
516 if ((*lpszPath==
' ') && !bSeenQuote)
517 return (
LPWSTR)lpszPath + 1;
518 if (*lpszPath ==
'"')
519 bSeenQuote = !bSeenQuote;
542 if (lpszPath && !
IsDBCSLeadByte(*lpszPath) && lpszPath[1] ==
':' &&
544 return tolower(*lpszPath) -
'a';
557 static const WCHAR nt_prefixW[] = {
'\\',
'\\',
'?',
'\\'};
588 LPSTR lpszFileSpec = lpszPath;
596 if (*lpszPath ==
'\\')
597 lpszFileSpec = ++lpszPath;
598 if (*lpszPath ==
'\\')
599 lpszFileSpec = ++lpszPath;
603 if(*lpszPath ==
'\\')
604 lpszFileSpec = lpszPath;
605 else if(*lpszPath ==
':')
607 lpszFileSpec = ++lpszPath;
608 if (*lpszPath ==
'\\')
617 *lpszFileSpec =
'\0';
631 LPWSTR lpszFileSpec = lpszPath;
639 if (*lpszPath ==
'\\')
640 lpszFileSpec = ++lpszPath;
641 if (*lpszPath ==
'\\')
642 lpszFileSpec = ++lpszPath;
646 if(*lpszPath ==
'\\')
647 lpszFileSpec = lpszPath;
648 else if(*lpszPath ==
':')
650 lpszFileSpec = ++lpszPath;
651 if (*lpszPath ==
'\\')
659 *lpszFileSpec =
'\0';
684 if(lpszFileName != lpszPath)
700 if(lpszFileName != lpszPath)
768 if(*lpszLastChar ==
' ')
769 *lpszLastChar =
'\0';
786 if (*lpszArgs || (lpszArgs > lpszPath && lpszArgs[-1] ==
' '))
813 if (lpszPath && *lpszPath !=
'\0')
830 if (lpszPath && *lpszPath !=
'\0')
875 szTemp = lpszPath +
strlenW(lpszPath);
876 if (szTemp > lpszPath) szTemp--;
898 if(lpszPath && *lpszPath)
902 while (*lpszPath ==
' ')
906 *
start++ = *lpszPath++;
908 if (
start != lpszPath)
909 while (
start[-1] ==
' ')
924 if(lpszPath && *lpszPath)
928 while (*lpszPath ==
' ')
932 *
start++ = *lpszPath++;
934 if (
start != lpszPath)
935 while (
start[-1] ==
' ')
959 if(lpszPath &&
StrChrA(lpszPath,
' '))
961 size_t iLen =
strlen(lpszPath) + 1;
965 memmove(lpszPath + 1, lpszPath, iLen);
967 lpszPath[iLen] =
'"';
968 lpszPath[iLen + 1] =
'\0';
982 if(lpszPath &&
StrChrW(lpszPath,
' '))
984 int iLen =
strlenW(lpszPath) + 1;
990 lpszPath[iLen] =
'"';
991 lpszPath[iLen + 1] =
'\0';
1016 if (lpszPath && *lpszPath ==
'"')
1020 if (lpszPath[dwLen] ==
'"')
1022 lpszPath[dwLen] =
'\0';
1023 for (; *lpszPath; lpszPath++)
1024 *lpszPath = lpszPath[1];
1038 if (lpszPath && *lpszPath ==
'"')
1042 if (lpszPath[dwLen] ==
'"')
1044 lpszPath[dwLen] =
'\0';
1045 for (; *lpszPath; lpszPath++)
1046 *lpszPath = lpszPath[1];
1076 if ((lpszComma =
strchr(lpszPath,
',')))
1078 *lpszComma++ =
'\0';
1101 if ((lpszComma =
StrChrW(lpszPath,
',')))
1103 *lpszComma++ =
'\0';
1119 static const WCHAR pszExts[][5] = { {
'.',
'p',
'i',
'f', 0},
1120 {
'.',
'c',
'o',
'm', 0},
1121 {
'.',
'e',
'x',
'e', 0},
1122 {
'.',
'b',
'a',
't', 0},
1123 {
'.',
'l',
'n',
'k', 0},
1124 {
'.',
'c',
'm',
'd', 0},
1136 if (!*szExt || dwWhich & 0x40)
1146 while ( (dwWhich & 0
x1) && pszExts[iChoose][0] )
1148 while (pszExts[iChoose][0])
1155 lstrcpyW(lpszPath + iLen, pszExts[iChoose]);
1164 *(lpszPath + iLen) = (
WCHAR)
'\0';
1218 static const WCHAR szSystem[] = {
'S',
'y',
's',
't',
'e',
'm',
'\0'};
1219 static const WCHAR szPath[] = {
'P',
'A',
'T',
'H',
'\0'};
1259 lpszCurr = lpszPATH;
1265 while (*lpszEnd ==
' ')
1267 while (*lpszEnd && *lpszEnd !=
';')
1268 *pBuff++ = *lpszEnd++;
1272 lpszCurr = lpszEnd + 1;
1311 TRACE(
"(%s,%p,%08x)\n",
debugstr_a(lpszFile), lppszOtherDirs, dwWhich);
1319 if (lppszOtherDirs && *lppszOtherDirs)
1322 LPCSTR *lpszOtherPath = lppszOtherDirs;
1324 while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
1354 TRACE(
"(%s,%p,%08x)\n",
debugstr_w(lpszFile), lppszOtherDirs, dwWhich);
1360 if (lppszOtherDirs && *lppszOtherDirs)
1362 LPCWSTR *lpszOtherPath = lppszOtherDirs;
1363 while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
1462 static const WCHAR szEllipses[] = {
'.',
'.',
'.',
'\0' };
1464 DWORD dwLen, dwFileLen = 0;
1473 WARN(
"Invalid lpszDest would crash under Win32!\n");
1482 dwLen =
strlenW(lpszPath) + 1;
1493 dwFileLen = lpszPath + dwLen - lpszFile;
1495 if (dwFileLen == dwLen)
1515 if (dwFileLen + 3 >
cchMax)
1543 dwLen =
cchMax - dwFileLen - 3;
1568 if (*lpszPath ==
'\\' || (*lpszPath && lpszPath[1] ==
':'))
1582 if (!lpszPath || !*lpszPath)
1584 if (*lpszPath ==
'\\' || (*lpszPath && lpszPath[1] ==
':'))
1605 if (lpszPath && *lpszPath)
1607 if (*lpszPath ==
'\\')
1611 else if (lpszPath[1]==
'\\')
1619 if (*lpszPath ==
'\\')
1630 else if (lpszPath[1] ==
':' && lpszPath[2] ==
'\\' && lpszPath[3] ==
'\0')
1645 if (lpszPath && *lpszPath)
1647 if (*lpszPath ==
'\\')
1651 else if (lpszPath[1]==
'\\')
1659 if (*lpszPath ==
'\\')
1670 else if (lpszPath[1] ==
':' && lpszPath[2] ==
'\\' && lpszPath[3] ==
'\0')
1708 FIXME(
"UNC Server Share not yet supported - FAILING\n");
1733 FIXME(
"UNC Server Share not yet supported - FAILING\n");
1875 while (*
mask ==
'*')
1908 while (*
mask ==
'*')
1936 TRACE(
"(%s,%s)\n", lpszPath, lpszMask);
1943 while (*lpszMask ==
' ')
1949 while (*lpszMask && *lpszMask !=
';')
1952 if (*lpszMask ==
';')
1965 static const WCHAR szStarDotStar[] = {
'*',
'.',
'*',
'\0' };
1969 if (!
lstrcmpW(lpszMask, szStarDotStar))
1974 while (*lpszMask ==
' ')
1980 while (*lpszMask && *lpszMask !=
';')
1983 if (*lpszMask ==
';')
2009 if (!lpszPath1 || !lpszPath2 || !(lpszStart =
PathSkipRootA(lpszPath1)))
2013 if (lpszStart - lpszPath1 > dwLen)
2030 if (!lpszPath1 || !lpszPath2 || !(lpszStart =
PathSkipRootW(lpszPath1)))
2034 if (lpszStart - lpszPath1 > dwLen)
2082 static const WCHAR szContentType[] = {
'C',
'o',
'n',
't',
'e',
'n',
't',
' ',
'T',
'y',
'p',
'e',
'\0' };
2092 !
strcmpiW(lpszContentType, szBuff))
2120 if (*lpszPath ==
'\\' || *lpszPath ==
':')
2141 if (*lpszPath ==
'\\' || *lpszPath ==
':')
2165 if (lpszPrefix && lpszPath &&
2180 if (lpszPrefix && lpszPath &&
2203 if (lpszPath && *lpszPath)
2221 if (lpszPath && *lpszPath)
2251 #if (WINVER >= _WIN32_WINNT_VISTA) 2252 if (lpszPath && (lpszPath[0]==
'\\') && (lpszPath[1]==
'\\') && (lpszPath[2]!=
'?'))
2254 if (lpszPath && (lpszPath[0]==
'\\') && (lpszPath[1]==
'\\'))
2274 #if (WINVER >= _WIN32_WINNT_VISTA) 2275 if (lpszPath && (lpszPath[0]==
'\\') && (lpszPath[1]==
'\\') && (lpszPath[2]!=
'?'))
2277 if (lpszPath && (lpszPath[0]==
'\\') && (lpszPath[1]==
'\\'))
2304 if (lpszPath && *lpszPath++ ==
'\\' && *lpszPath++ ==
'\\')
2308 if (*lpszPath ==
'\\')
2326 if (lpszPath && lpszPath[0] ==
'\\' && lpszPath[1] ==
'\\')
2328 return !
strchrW( lpszPath + 2,
'\\' );
2354 if (lpszPath && *lpszPath++ ==
'\\' && *lpszPath++ ==
'\\')
2359 if (*lpszPath ==
'\\')
2381 if (lpszPath && *lpszPath++ ==
'\\' && *lpszPath++ ==
'\\')
2386 if (*lpszPath ==
'\\')
2421 if (!lpszBuf || !lpszPath)
2430 WARN(
"Failed to convert string to widechar (too long?), LE %d.\n",
GetLastError());
2447 LPWSTR lpszDst = lpszBuf;
2455 if (!lpszBuf || !lpszPath)
2469 if (*lpszSrc ==
'\\')
2471 *lpszDst++ = *lpszSrc++;
2473 else if (*lpszSrc && lpszSrc[1] ==
':')
2476 *lpszDst++ = *lpszSrc++;
2477 *lpszDst++ = *lpszSrc++;
2478 if (*lpszSrc ==
'\\')
2479 *lpszDst++ = *lpszSrc++;
2485 if (*lpszSrc ==
'.')
2487 if (lpszSrc[1] ==
'\\' && (lpszSrc == lpszPath || lpszSrc[-1] ==
'\\' || lpszSrc[-1] ==
':'))
2491 else if (lpszSrc[1] ==
'.' && (lpszDst == lpszBuf || lpszDst[-1] ==
'\\'))
2496 if (lpszDst != lpszBuf)
2499 if (lpszDst > lpszBuf+1 && lpszDst[-1] ==
'\\' &&
2500 (lpszDst[-2] !=
'\\' || lpszDst > lpszBuf+2))
2502 if (lpszDst[-2] ==
':' && (lpszDst > lpszBuf+3 || lpszDst[-3] ==
':'))
2505 while (lpszDst > lpszBuf && *lpszDst !=
'\\')
2507 if (*lpszDst ==
'\\')
2515 while (lpszDst > lpszBuf && *lpszDst !=
'\\')
2517 if (lpszDst == lpszBuf)
2526 *lpszDst++ = *lpszSrc++;
2529 *lpszDst++ = *lpszSrc++;
2532 if (lpszDst - lpszBuf == 2 && lpszDst[-1] ==
':')
2561 if(!lpszPath || !*lpszPath)
2564 if ((lpszSlash =
StrChrA(lpszPath,
'\\')))
2566 if (lpszSlash[1] ==
'\\')
2568 return lpszSlash + 1;
2584 if(!lpszPath || !*lpszPath)
2587 if ((lpszSlash =
StrChrW(lpszPath,
'\\')))
2589 if (lpszSlash[1] ==
'\\')
2591 return lpszSlash + 1;
2623 dwLen =
strlen(lpszPath);
2628 strcpy(lpszPath + dwLen, lpszExtension);
2651 strcpyW(lpszPath + dwLen, lpszExtension);
2669 LPSTR pszIter = lpszPath;
2684 pszIter = lpszPath + 1;
2701 LPWSTR pszIter = lpszPath;
2716 pszIter = lpszPath + 1;
2753 LPCSTR lpszIter1 = lpszFile1;
2754 LPCSTR lpszIter2 = lpszFile2;
2761 if (!lpszFile1 || !lpszFile2)
2778 if ((!*lpszIter1 || *lpszIter1 ==
'\\') &&
2779 (!*lpszIter2 || *lpszIter2 ==
'\\'))
2780 iLen = lpszIter1 - lpszFile1;
2792 if (iLen && achPath)
2794 memcpy(achPath,lpszFile1,iLen);
2795 achPath[iLen] =
'\0';
2808 LPCWSTR lpszIter1 = lpszFile1;
2809 LPCWSTR lpszIter2 = lpszFile2;
2816 if (!lpszFile1 || !lpszFile2)
2833 if ((!*lpszIter1 || *lpszIter1 ==
'\\') &&
2834 (!*lpszIter2 || *lpszIter2 ==
'\\'))
2835 iLen = lpszIter1 - lpszFile1;
2847 if (iLen && achPath)
2850 achPath[iLen] =
'\0';
2892 static const WCHAR szEllipses[] = {
'.',
'.',
'.',
'\0' };
2915 DWORD dwEllipsesLen = 0, dwPathLen = 0;
2918 if (sFile != lpszPath) sFile--;
2922 dwEllipsesLen =
size.cx;
2925 dwPathLen =
size.cx;
2927 if (sFile != lpszPath)
2940 DWORD dwTotalLen = bEllipses? dwPathLen + dwEllipsesLen : dwPathLen;
2943 dwTotalLen +=
size.cx;
2944 if (dwTotalLen <=
dx)
2952 }
while (sPath > lpszPath);
2954 if (sPath > lpszPath)
2964 strcpyW(lpszPath, szEllipses);
2982 }
while (dwLen &&
size.cx + dwEllipsesLen >
dx);
2986 DWORD dwWritten = 0;
2991 while (dwWritten + dwEllipsesLen <
dx && dwLen < 3)
2994 dwWritten += dwEllipsesLen;
3039 TRACE(
"(%d)\n", ch);
3041 if (!ch || ch <
' ' || ch ==
'<' || ch ==
'>' ||
3042 ch ==
'"' || ch ==
'|' || ch ==
'/')
3044 else if (ch ==
'*' || ch==
'?')
3046 else if ((ch ==
'\\') || (ch ==
':'))
3052 if (((ch & 0
x1) && ch !=
';') || !ch ||
isalnum(ch) || ch ==
'$' || ch ==
'&' || ch ==
'(' ||
3053 ch ==
'.' || ch ==
'@' || ch ==
'^' ||
3054 ch ==
'\'' || ch == 130 || ch ==
'`')
3072 static BOOL bUseSystemForSystemFolders =
FALSE;
3080 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
3081 "UseSystemForSystemFolders", 0, 0, 0))
3082 bUseSystemForSystemFolders =
TRUE;
3084 return bUseSystemForSystemFolders;
3105 if (lpszPath && *lpszPath)
3126 if (!lpszPath || !*lpszPath)
3165 LPSTR lpszExtension;
3171 if (!lpszExtension || (lpszExtension - lpszPath +
strlen(lpszExt) >=
MAX_PATH))
3174 strcpy(lpszExtension, lpszExt);
3191 if (!lpszExtension || (lpszExtension - lpszPath +
strlenW(lpszExt) >=
MAX_PATH))
3194 strcpyW(lpszExtension, lpszExt);
3250 if (!lpszPath || !*lpszPath)
3253 if (*lpszPath ==
'\\' && lpszPath[1] ==
'\\')
3257 if ((lpszPath =
StrChrA(lpszPath,
'\\')) &&
3258 (lpszPath =
StrChrA(lpszPath + 1,
'\\')))
3260 return (
LPSTR)lpszPath;
3267 if (lpszPath[0] && lpszPath[1] ==
':' && lpszPath[2] ==
'\\')
3268 return (
LPSTR)lpszPath + 3;
3281 if (!lpszPath || !*lpszPath)
3284 if (*lpszPath ==
'\\' && lpszPath[1] ==
'\\')
3288 if ((lpszPath =
StrChrW(lpszPath,
'\\')) &&
3289 (lpszPath =
StrChrW(lpszPath + 1,
'\\')))
3295 if (lpszPath[0] && lpszPath[1] ==
':' && lpszPath[2] ==
'\\')
3296 return (
LPWSTR)lpszPath + 3;
3309 WCHAR *pathW = bufW;
3312 DWORD lenW =
sizeof(bufW)/
sizeof(
WCHAR), lenA;
3357 static const WCHAR file_colon[] = {
'f',
'i',
'l',
'e',
':',0 };
3358 static const WCHAR localhost[] = {
'l',
'o',
'c',
'a',
'l',
'h',
'o',
's',
't',0 };
3380 while (*
src ==
'/' || *
src ==
'\\') {
3431 while (*
src && *
src !=
'/' && *
src !=
'\\')
3460 if (*
dst ==
'/') *
dst =
'\\';
3461 if (
isalphaW(*tpath) && tpath[1] ==
'|')
3483 if (tpath != pszPath)
3486 if (tpath != pszPath)
3553 if(lpszPath && lpszFrom && lpszTo)
3574 static const WCHAR szPrevDirSlash[] = {
'.',
'.',
'\\',
'\0' };
3575 static const WCHAR szPrevDir[] = {
'.',
'.',
'\0' };
3583 if(!lpszPath || !lpszFrom || !lpszTo)
3600 lpszFrom = szFrom + dwLen;
3606 if (*lpszFrom ==
'\\')
3612 strcatW(lpszPath, *lpszFrom ? szPrevDirSlash : szPrevDir);
3620 if (*lpszTo && lpszTo[-1])
3622 if (*lpszTo !=
'\\')
3630 strcpyW(lpszPath + dwLen, lpszTo);
3770 if (*lpszPath ==
'\\' && lpszPath[1] ==
'\\')
3773 if (dwDriveNum == -1)
3796 if (*lpszPath ==
'\\' && lpszPath[1] ==
'\\')
3799 if (dwDriveNum == -1)
3823 DWORD dwNameLen = 0, dwExtLen = 0;
3832 if (*lpszPath ==
' ')
3834 if (*lpszPath ==
'.')
3864 DWORD dwNameLen = 0, dwExtLen = 0;
3873 if (*lpszPath ==
' ')
3875 if (*lpszPath ==
'.')
3932 static const WCHAR szAllFiles[] = {
'*',
'.',
'*',
'\0' };
3950 strcpyW(szSearch + dwLen, szAllFiles);
3959 if (
find_data.cFileName[1] ==
'\0')
continue;
3999 if (lpszSuffix && lppszArray && dwCount > 0)
4001 dwLen =
strlen(lpszSuffix);
4003 while (dwRet < dwCount)
4005 size_t dwCompareLen =
strlen(*lppszArray);
4006 if (dwCompareLen < dwLen)
4008 if (!
strcmp(lpszSuffix + dwLen - dwCompareLen, *lppszArray))
4030 if (lpszSuffix && lppszArray && dwCount > 0)
4034 while (dwRet < dwCount)
4036 size_t dwCompareLen =
strlenW(*lppszArray);
4037 if (dwCompareLen < dwLen)
4039 if (!
strcmpW(lpszSuffix + dwLen - dwCompareLen, *lppszArray))
4070 if (lpszExt > lpszPath && lpszExt[-1] ==
']')
4072 LPSTR lpszSkip = lpszExt - 2;
4073 if (*lpszSkip ==
'[')
4076 while (lpszSkip > lpszPath &&
isdigit(lpszSkip[-1]))
4078 if (lpszSkip > lpszPath && lpszSkip[-1] ==
'[' && lpszSkip[-2] !=
'\\')
4083 *lpszSkip++ = *lpszExt++;
4102 if (lpszExt > lpszPath && lpszExt[-1] ==
']')
4104 LPWSTR lpszSkip = lpszExt - 2;
4105 if (*lpszSkip ==
'[')
4108 while (lpszSkip > lpszPath &&
isdigitW(lpszSkip[-1]))
4110 if (lpszSkip > lpszPath && lpszSkip[-1] ==
'[' && lpszSkip[-2] !=
'\\')
4115 *lpszSkip++ = *lpszExt++;
4146 if (!pathW)
return FALSE;
4153 if (buf_len <
len + 1)
return FALSE;
4159 static const WCHAR allusersprofileW[] = {
'%',
'A',
'L',
'L',
'U',
'S',
'E',
'R',
'S',
'P',
'R',
'O',
'F',
'I',
'L',
'E',
'%',0};
4161 static const WCHAR programfilesW[] = {
'%',
'P',
'r',
'o',
'g',
'r',
'a',
'm',
'F',
'i',
'l',
'e',
's',
'%',0};
4162 static const WCHAR systemrootW[] = {
'%',
'S',
'y',
's',
't',
'e',
'm',
'R',
'o',
'o',
't',
'%',0};
4163 static const WCHAR systemdriveW[] = {
'%',
'S',
'y',
's',
't',
'e',
'm',
'D',
'r',
'i',
'v',
'e',
'%',0};
4164 static const WCHAR userprofileW[] = {
'%',
'U',
'S',
'E',
'R',
'P',
'R',
'O',
'F',
'I',
'L',
'E',
'%',0};
4180 if (
map->len)
map->len--;
4226 needed =
match->varlen + pathlen -
match->len;
4227 if (
match->len == 0 || needed > buf_len)
return FALSE;
4255 TRACE(
"(%s,%p,%d)\n", lpszFile, lpszPath, dwPathLen);
4271 static const WCHAR szWeb[] = {
'\\',
'W',
'e',
'b',
'\\',
'\0'};
4272 static const WCHAR szWebMui[] = {
'm',
'u',
'i',
'\\',
'%',
'0',
'4',
'x',
'\\',
'\0'};
4273 #define szWebLen (sizeof(szWeb)/sizeof(WCHAR)) 4274 #define szWebMuiLen ((sizeof(szWebMui)+1)/sizeof(WCHAR)) 4275 DWORD dwLen, dwFileLen;
4276 LANGID lidSystem, lidUser;
4282 if (dwLen > 0 && lpszPath[dwLen-1] ==
'\\')
4285 dwFileLen =
strlenW(lpszFile);
4287 if (dwLen + dwFileLen +
szWebLen >= dwPathLen)
4290 strcpyW(lpszPath+dwLen, szWeb);
4292 dwPathLen = dwPathLen - dwLen;
4297 if (lidSystem != lidUser)
4302 wsprintfW(lpszPath + dwLen, szWebMui, lidUser);
4310 strcpyW(lpszPath + dwLen, lpszFile);
4316 #define PATH_CHAR_CLASS_LETTER 0x00000001 4317 #define PATH_CHAR_CLASS_ASTERIX 0x00000002 4318 #define PATH_CHAR_CLASS_DOT 0x00000004 4319 #define PATH_CHAR_CLASS_BACKSLASH 0x00000008 4320 #define PATH_CHAR_CLASS_COLON 0x00000010 4321 #define PATH_CHAR_CLASS_SEMICOLON 0x00000020 4322 #define PATH_CHAR_CLASS_COMMA 0x00000040 4323 #define PATH_CHAR_CLASS_SPACE 0x00000080 4324 #define PATH_CHAR_CLASS_OTHER_VALID 0x00000100 4325 #define PATH_CHAR_CLASS_DOUBLEQUOTE 0x00000200 4327 #define PATH_CHAR_CLASS_INVALID 0x00000000 4328 #define PATH_CHAR_CLASS_ANY 0xffffffff 4405 if ((
unsigned)
c > 0x7e)
BOOL WINAPI PathIsUNCServerShareA(LPCSTR lpszPath)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
#define ERROR_INVALID_PARAMETER
VOID WINAPI PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR lpszPath)
BOOL WINAPI PathMakePrettyA(LPSTR lpszPath)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
UINT WINAPI SetErrorMode(IN UINT uMode)
HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwReserved)
LANGID WINAPI GetUserDefaultUILanguage(void)
#define memmove(s1, s2, n)
UINT WINAPI GetSystemWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
WINE_UNICODE_INLINE int islowerW(WCHAR wc)
BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
BOOL WINAPI PathFileExistsAndAttributesW(LPCWSTR lpszPath, DWORD *dwAttr)
BOOL WINAPI PathIsDirectoryA(LPCSTR lpszPath)
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
LPWSTR WINAPI PathFindNextComponentW(LPCWSTR lpszPath)
VOID WINAPI PathQuoteSpacesA(LPSTR lpszPath)
LPCWSTR WINAPI PathFindSuffixArrayW(LPCWSTR lpszSuffix, LPCWSTR *lppszArray, int dwCount)
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
void WINAPI PathStripPathW(LPWSTR lpszPath)
#define WideCharToMultiByte
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteN(_Out_ PCHAR MbString, _In_ ULONG MbSize, _Out_opt_ PULONG ResultSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
#define SEM_FAILCRITICALERRORS
void WINAPI PathRemoveArgsW(LPWSTR lpszPath)
int WINAPI PathCommonPrefixW(LPCWSTR lpszFile1, LPCWSTR lpszFile2, LPWSTR achPath)
#define PATH_CHAR_CLASS_DOUBLEQUOTE
LANGID WINAPI GetSystemDefaultUILanguage(void)
HDC WINAPI GetDC(_In_opt_ HWND)
ACPI_SIZE strlen(const char *String)
BOOL WINAPI PathCanonicalizeW(LPWSTR lpszBuf, LPCWSTR lpszPath)
#define PATH_CHAR_CLASS_INVALID
VOID WINAPI PathRemoveBlanksA(LPSTR lpszPath)
#define FILE_ATTRIBUTE_SYSTEM
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
#define URL_UNESCAPE_INPLACE
static const WCHAR appdataW[]
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
BOOL WINAPI PathAppendA(LPSTR lpszPath, LPCSTR lpszAppend)
LPWSTR WINAPI StrCpyNW(LPWSTR dst, LPCWSTR src, int count)
static BOOL PathMatchSingleMaskW(LPCWSTR name, LPCWSTR mask)
BOOL WINAPI PathUnExpandEnvStringsA(LPCSTR path, LPSTR buffer, UINT buf_len)
BOOL WINAPI PathFindOnPathA(LPSTR lpszFile, LPCSTR *lppszOtherDirs)
static const BYTE localhost[]
BOOL WINAPI PathIsPrefixA(LPCSTR lpszPrefix, LPCSTR lpszPath)
BOOL WINAPI PathRelativePathToW(LPWSTR lpszPath, LPCWSTR lpszFrom, DWORD dwAttrFrom, LPCWSTR lpszTo, DWORD dwAttrTo)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI PathRelativePathToA(LPSTR lpszPath, LPCSTR lpszFrom, DWORD dwAttrFrom, LPCSTR lpszTo, DWORD dwAttrTo)
#define INVALID_HANDLE_VALUE
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
BOOL WINAPI PathIsSystemFolderA(LPCSTR lpszPath, DWORD dwAttrib)
BOOL WINAPI PathUnmakeSystemFolderA(LPCSTR lpszPath)
BOOL WINAPI PathFileExistsA(LPCSTR lpszPath)
DWORD WINAPI GetLastError(VOID)
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
UINT WINAPI PathGetCharTypeW(WCHAR ch)
BOOL WINAPI PathIsValidCharA(char c, DWORD class)
BOOL WINAPI PathIsSameRootA(LPCSTR lpszPath1, LPCSTR lpszPath2)
VOID WINAPI PathRemoveBlanksW(LPWSTR lpszPath)
BOOL WINAPI PathRenameExtensionW(LPWSTR lpszPath, LPCWSTR lpszExt)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define PATH_CHAR_CLASS_SEMICOLON
#define strncmpiW(s1, s2, n)
_Check_return_ _CRTIMP int __cdecl isalnum(_In_ int _C)
LPSTR WINAPI CharNextA(_In_ LPCSTR)
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
int WINAPI PathParseIconLocationA(LPSTR lpszPath)
BOOL WINAPI PathRemoveFileSpecA(LPSTR lpszPath)
int WINAPI PathCommonPrefixA(LPCSTR lpszFile1, LPCSTR lpszFile2, LPSTR achPath)
EXTERN_C int WINAPI IsNetDrive(int drive)
static int find_data(const struct Vector *v, const BYTE *pData, int size)
#define RtlMoveMemory(Destination, Source, Length)
#define PATH_CHAR_CLASS_BACKSLASH
WINE_UNICODE_INLINE int strncmpW(const WCHAR *str1, const WCHAR *str2, int n)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
LPSTR WINAPI PathAddBackslashA(LPSTR lpszPath)
#define PATH_CHAR_CLASS_SPACE
static BOOL SHLWAPI_UseSystemForSystemFolders(void)
DWORD WINAPI GetFullPathNameA(IN LPCSTR lpFileName, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart)
HRESULT WINAPI UrlUnescapeW(LPWSTR pszUrl, LPWSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags)
BOOL WINAPI PathAddExtensionW(LPWSTR lpszPath, LPCWSTR lpszExtension)
BOOL WINAPI PathSearchAndQualifyA(LPCSTR lpszPath, LPSTR lpszBuf, UINT cchBuf)
#define PATH_CHAR_CLASS_ANY
LPSTR WINAPI PathBuildRootA(LPSTR lpszPath, int drive)
DWORD WINAPI SearchPathA(IN LPCSTR lpPath OPTIONAL, IN LPCSTR lpFileName, IN LPCSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart OPTIONAL)
BOOL WINAPI PathStripToRootW(LPWSTR lpszPath)
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
LPSTR WINAPI StrChrA(LPCSTR lpszStr, WORD ch)
static const WCHAR systemrootW[]
HRESULT WINAPI SHGetWebFolderFilePathW(LPCWSTR, LPWSTR, DWORD)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
BOOL WINAPI PathIsUNCServerShareW(LPCWSTR lpszPath)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR lpszPath, UINT dx)
BOOL WINAPI PathUnExpandEnvStringsW(LPCWSTR path, LPWSTR buffer, UINT buf_len)
BOOL WINAPI PathIsFileSpecW(LPCWSTR lpszPath)
static fnpIsNetDrive pIsNetDrive
BOOL WINAPI PathIsContentTypeW(LPCWSTR lpszPath, LPCWSTR lpszContentType)
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
BOOL WINAPI PathFileExistsAndAttributesA(LPCSTR lpszPath, DWORD *dwAttr)
BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
BOOL WINAPI PathIsDirectoryEmptyA(LPCSTR lpszPath)
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
BOOL WINAPI PathUnmakeSystemFolderW(LPCWSTR lpszPath)
LPSTR WINAPI PathSkipRootA(LPCSTR lpszPath)
BOOL WINAPI PathStripToRootA(LPSTR lpszPath)
#define FILE_ATTRIBUTE_DIRECTORY
BOOL WINAPI PathCompactPathExA(LPSTR lpszDest, LPCSTR lpszPath, UINT cchMax, DWORD dwFlags)
WINE_UNICODE_INLINE WCHAR toupperW(WCHAR ch)
BOOL WINAPI PathIsLFNFileSpecA(LPCSTR lpszPath)
#define PATH_CHAR_CLASS_COMMA
#define PATH_CHAR_CLASS_LETTER
#define PATH_CHAR_CLASS_ASTERIX
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
BOOL WINAPI PathIsContentTypeA(LPCSTR lpszPath, LPCSTR lpszContentType)
BOOL WINAPI PathIsSystemFolderW(LPCWSTR lpszPath, DWORD dwAttrib)
BOOL WINAPI PathIsUNCServerA(LPCSTR lpszPath)
UINT WINAPI PathGetCharTypeA(UCHAR ch)
BOOL WINAPI PathIsFileSpecA(LPCSTR lpszPath)
#define PATH_CHAR_CLASS_OTHER_VALID
BOOL WINAPI PathIsRootW(LPCWSTR lpszPath)
#define GET_FUNC(func, module, name, fail)
BOOL WINAPI PathIsNetworkPathW(LPCWSTR lpszPath)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI PathRenameExtensionA(LPSTR lpszPath, LPCSTR lpszExt)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI PathFindOnPathExA(LPSTR lpszFile, LPCSTR *lppszOtherDirs, DWORD dwWhich)
BOOL WINAPI PathMakeSystemFolderW(LPCWSTR lpszPath)
BOOL(WINAPI * fnpIsNetDrive)(int)
HRESULT WINAPI PathCreateFromUrlA(LPCSTR pszUrl, LPSTR pszPath, LPDWORD pcchPath, DWORD dwReserved)
#define FILE_ATTRIBUTE_READONLY
WINE_UNICODE_INLINE WCHAR tolowerW(WCHAR ch)
VOID WINAPI PathUndecorateW(LPWSTR lpszPath)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
LPSTR WINAPI PathCombineA(LPSTR lpszDest, LPCSTR lpszDir, LPCSTR lpszFile)
BOOL WINAPI PathIsPrefixW(LPCWSTR lpszPrefix, LPCWSTR lpszPath)
#define INVALID_FILE_ATTRIBUTES
static LPWSTR PDWORD pcchPath
static DWORD LPDWORD LPCSTR src
#define PATH_CHAR_CLASS_DOT
LPWSTR WINAPI PathSkipRootW(LPCWSTR lpszPath)
void WINAPI PathStripPathA(LPSTR lpszPath)
BOOL WINAPI PathFileExistsDefExtA(LPSTR lpszPath, DWORD dwWhich)
static void init_envvars_map(struct envvars_map *map)
BOOL WINAPI PathMakePrettyW(LPWSTR lpszPath)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
int WINAPI PathGetDriveNumberA(LPCSTR lpszPath)
static BOOL PathMatchSingleMaskA(LPCSTR name, LPCSTR mask)
#define memcpy(s1, s2, n)
static const WCHAR systemdriveW[]
BOOL WINAPI PathIsValidCharW(WCHAR c, DWORD class)
LPWSTR WINAPI StrCpyW(LPWSTR lpszStr, LPCWSTR lpszSrc)
LPWSTR WINAPI PathRemoveBackslashW(LPWSTR lpszPath)
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp)
LPSTR WINAPI CharPrevA(_In_ LPCSTR, _In_ LPCSTR)
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
BOOL WINAPI PathIsRootA(LPCSTR lpszPath)
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
static BOOL SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich)
BOOL WINAPI PathIsRelativeA(LPCSTR lpszPath)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI PathFileExistsDefExtW(LPWSTR lpszPath, DWORD dwWhich)
BOOL WINAPI PathIsDirectoryEmptyW(LPCWSTR lpszPath)
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
static const DWORD SHELL_charclass[]
BOOL WINAPI PathMakeSystemFolderA(LPCSTR lpszPath)
void WINAPI PathRemoveArgsA(LPSTR lpszPath)
LPSTR WINAPI PathFindExtensionA(LPCSTR lpszPath)
static BOOL(WINAPI *pPathIsValidCharA)(char
BOOL WINAPI PathIsLFNFileSpecW(LPCWSTR lpszPath)
VOID WINAPI PathUnquoteSpacesA(LPSTR lpszPath)
void shell(int argc, const char *argv[])
BOOL WINAPI PathIsNetworkPathA(LPCSTR lpszPath)
LPSTR WINAPI PathFindNextComponentA(LPCSTR lpszPath)
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteSize(_Out_ PULONG MbSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPWSTR WINAPI PathGetArgsW(LPCWSTR lpszPath)
BOOL WINAPI PathCompactPathExW(LPWSTR lpszDest, LPCWSTR lpszPath, UINT cchMax, DWORD dwFlags)
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
WINE_UNICODE_INLINE int isdigitW(WCHAR wc)
VOID WINAPI PathUnquoteSpacesW(LPWSTR lpszPath)
#define FILE_ATTRIBUTE_HIDDEN
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
BOOL unescape(WCHAR *str, size_t *len)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
DWORD WINAPI SHGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
BOOL WINAPI PathCompactPathA(HDC hDC, LPSTR lpszPath, UINT dx)
BOOL WINAPI PathIsUNCServerW(LPCWSTR lpszPath)
static const WCHAR allusersprofileW[]
INT WINAPI StrToIntW(LPCWSTR lpString)
#define MultiByteToWideChar
int WINAPI PathGetDriveNumberW(const WCHAR *path)
char * strchr(const char *String, int ch)
BOOL WINAPI PathCanonicalizeA(LPSTR lpszBuf, LPCSTR lpszPath)
static HMODULE SHLWAPI_hshell32
BOOL WINAPI PathMatchSpecW(LPCWSTR lpszPath, LPCWSTR lpszMask)
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
BOOL WINAPI PathIsSameRootW(LPCWSTR lpszPath1, LPCWSTR lpszPath2)
static const WCHAR userprofileW[]
char * strcpy(char *DstString, const char *SrcString)
BOOL WINAPI PathSearchAndQualifyW(LPCWSTR lpszPath, LPWSTR lpszBuf, UINT cchBuf)
HRESULT WINAPI SHGetWebFolderFilePathA(LPCSTR lpszFile, LPSTR lpszPath, DWORD dwPathLen)
VOID WINAPI PathUndecorateA(LPSTR lpszPath)
static WCHAR * heap_strdupAtoW(LPCSTR str)
int strcmp(const char *String1, const char *String2)
static const WCHAR programfilesW[]
#define PATH_CHAR_CLASS_COLON
#define HKEY_CLASSES_ROOT
INT WINAPI StrToIntA(LPCSTR lpszStr)
VOID WINAPI PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR lpszPath)
VOID WINAPI PathQuoteSpacesW(LPWSTR lpszPath)
WINE_UNICODE_INLINE int isalphaW(WCHAR wc)
LPSTR WINAPI PathFindFileNameA(LPCSTR lpszPath)
BOOL WINAPI PathIsUNCW(LPCWSTR lpszPath)
LPCSTR WINAPI PathFindSuffixArrayA(LPCSTR lpszSuffix, LPCSTR *lppszArray, int dwCount)
void WINAPI PathRemoveExtensionA(LPSTR lpszPath)
LPSTR WINAPI PathRemoveBackslashA(LPSTR lpszPath)
LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
#define GetEnvironmentVariableW(x, y, z)
BOOL WINAPI PathFindOnPathExW(LPWSTR lpszFile, LPCWSTR *lppszOtherDirs, DWORD dwWhich)
BOOL WINAPI PathFindOnPathW(LPWSTR lpszFile, LPCWSTR *lppszOtherDirs)
BOOL WINAPI PathIsUNCA(LPCSTR lpszPath)
static unsigned char buff[32768]
LPSTR WINAPI PathGetArgsA(LPCSTR lpszPath)
#define HeapFree(x, y, z)
BOOL WINAPI PathMatchSpecA(LPCSTR lpszPath, LPCSTR lpszMask)
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
BOOL WINAPI PathAddExtensionA(LPSTR lpszPath, LPCSTR lpszExtension)
static unsigned(__cdecl *hash_bstr)(bstr_t s)
LPWSTR WINAPI PathBuildRootW(LPWSTR lpszPath, int drive)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define HKEY_LOCAL_MACHINE
HRESULT WINAPI PathCreateFromUrlAlloc(LPCWSTR pszUrl, LPWSTR *pszPath, DWORD dwReserved)
BOOL WINAPI FindClose(HANDLE hFindFile)