23 #include "wine/port.h" 29 #include "wine/unicode.h" 36 #define NO_SHLWAPI_STREAM 47 #define GET_FUNC(func, module, name, fail) \ 50 if (!SHLWAPI_h##module && !(SHLWAPI_h##module = LoadLibraryA(#module ".dll"))) return fail; \ 51 func = (fn##func)GetProcAddress(SHLWAPI_h##module, name); \ 52 if (!func) return fail; \ 105 if (lpszPath && lpszAppend)
108 while (*lpszAppend ==
'\\')
125 if (lpszPath && lpszAppend)
128 while (*lpszAppend ==
'\\')
164 if (!lpszDir && !lpszFile)
199 if (!lpszDir && !lpszFile)
205 if ((!lpszFile || !*lpszFile) && lpszDir)
212 if (!lpszDir || !*lpszDir || *lpszFile !=
'\\' ||
PathIsUNCW(lpszFile))
261 LPSTR prev = lpszPath;
301 if (lpszPath[-1] !=
'\\')
330 lpszPath[0] =
'A' +
drive;
349 lpszPath[0] =
'A' +
drive;
370 LPCSTR lastSlash = lpszPath;
374 while (lpszPath && *lpszPath)
376 if ((*lpszPath ==
'\\' || *lpszPath ==
'/' || *lpszPath ==
':') &&
377 lpszPath[1] && lpszPath[1] !=
'\\' && lpszPath[1] !=
'/')
378 lastSlash = lpszPath + 1;
381 return (
LPSTR)lastSlash;
395 while (lpszPath && *lpszPath)
397 if ((*lpszPath ==
'\\' || *lpszPath ==
'/' || *lpszPath ==
':') &&
398 lpszPath[1] && lpszPath[1] !=
'\\' && lpszPath[1] !=
'/')
399 lastSlash = lpszPath + 1;
427 if (*lpszPath ==
'\\' || *lpszPath==
' ')
429 else if (*lpszPath ==
'.')
430 lastpoint = lpszPath;
434 return (
LPSTR)(lastpoint ? lastpoint : lpszPath);
452 if (*lpszPath ==
'\\' || *lpszPath==
' ')
454 else if (*lpszPath ==
'.')
455 lastpoint = lpszPath;
459 return (
LPWSTR)(lastpoint ? lastpoint : lpszPath);
486 if ((*lpszPath==
' ') && !bSeenQuote)
487 return (
LPSTR)lpszPath + 1;
488 if (*lpszPath ==
'"')
489 bSeenQuote = !bSeenQuote;
493 return (
LPSTR)lpszPath;
511 if ((*lpszPath==
' ') && !bSeenQuote)
512 return (
LPWSTR)lpszPath + 1;
513 if (*lpszPath ==
'"')
514 bSeenQuote = !bSeenQuote;
537 if (lpszPath && !
IsDBCSLeadByte(*lpszPath) && lpszPath[1] ==
':' &&
539 return tolower(*lpszPath) -
'a';
552 static const WCHAR nt_prefixW[] = {
'\\',
'\\',
'?',
'\\'};
583 LPSTR lpszFileSpec = lpszPath;
591 if (*lpszPath ==
'\\')
592 lpszFileSpec = ++lpszPath;
593 if (*lpszPath ==
'\\')
594 lpszFileSpec = ++lpszPath;
598 if(*lpszPath ==
'\\')
599 lpszFileSpec = lpszPath;
600 else if(*lpszPath ==
':')
602 lpszFileSpec = ++lpszPath;
603 if (*lpszPath ==
'\\')
612 *lpszFileSpec =
'\0';
626 LPWSTR lpszFileSpec = lpszPath;
634 if (*lpszPath ==
'\\')
635 lpszFileSpec = ++lpszPath;
636 if (*lpszPath ==
'\\')
637 lpszFileSpec = ++lpszPath;
641 if(*lpszPath ==
'\\')
642 lpszFileSpec = lpszPath;
643 else if(*lpszPath ==
':')
645 lpszFileSpec = ++lpszPath;
646 if (*lpszPath ==
'\\')
654 *lpszFileSpec =
'\0';
679 if(lpszFileName != lpszPath)
695 if(lpszFileName != lpszPath)
763 if(*lpszLastChar ==
' ')
764 *lpszLastChar =
'\0';
781 if (*lpszArgs || (lpszArgs > lpszPath && lpszArgs[-1] ==
' '))
808 if (lpszPath && *lpszPath !=
'\0')
825 if (lpszPath && *lpszPath !=
'\0')
870 szTemp = lpszPath +
strlenW(lpszPath);
871 if (szTemp > lpszPath) szTemp--;
893 if(lpszPath && *lpszPath)
897 while (*lpszPath ==
' ')
901 *
start++ = *lpszPath++;
903 if (
start != lpszPath)
904 while (
start[-1] ==
' ')
919 if(lpszPath && *lpszPath)
923 while (*lpszPath ==
' ')
927 *
start++ = *lpszPath++;
929 if (
start != lpszPath)
930 while (
start[-1] ==
' ')
954 if(lpszPath &&
StrChrA(lpszPath,
' '))
956 size_t iLen =
strlen(lpszPath) + 1;
960 memmove(lpszPath + 1, lpszPath, iLen);
962 lpszPath[iLen] =
'"';
963 lpszPath[iLen + 1] =
'\0';
977 if(lpszPath &&
StrChrW(lpszPath,
' '))
979 int iLen =
strlenW(lpszPath) + 1;
985 lpszPath[iLen] =
'"';
986 lpszPath[iLen + 1] =
'\0';
1011 if (lpszPath && *lpszPath ==
'"')
1015 if (lpszPath[dwLen] ==
'"')
1017 lpszPath[dwLen] =
'\0';
1018 for (; *lpszPath; lpszPath++)
1019 *lpszPath = lpszPath[1];
1033 if (lpszPath && *lpszPath ==
'"')
1037 if (lpszPath[dwLen] ==
'"')
1039 lpszPath[dwLen] =
'\0';
1040 for (; *lpszPath; lpszPath++)
1041 *lpszPath = lpszPath[1];
1071 if ((lpszComma =
strchr(lpszPath,
',')))
1073 *lpszComma++ =
'\0';
1096 if ((lpszComma =
StrChrW(lpszPath,
',')))
1098 *lpszComma++ =
'\0';
1114 static const WCHAR pszExts[][5] = { {
'.',
'p',
'i',
'f', 0},
1115 {
'.',
'c',
'o',
'm', 0},
1116 {
'.',
'e',
'x',
'e', 0},
1117 {
'.',
'b',
'a',
't', 0},
1118 {
'.',
'l',
'n',
'k', 0},
1119 {
'.',
'c',
'm',
'd', 0},
1130 if (!*szExt || dwWhich & 0x40)
1136 while ( (dwWhich & 0
x1) && pszExts[iChoose][0] )
1138 lstrcpyW(lpszPath + iLen, pszExts[iChoose]);
1144 *(lpszPath + iLen) = (
WCHAR)
'\0';
1198 static const WCHAR szSystem[] = {
'S',
'y',
's',
't',
'e',
'm',
'\0'};
1199 static const WCHAR szPath[] = {
'P',
'A',
'T',
'H',
'\0'};
1239 lpszCurr = lpszPATH;
1245 while (*lpszEnd ==
' ')
1247 while (*lpszEnd && *lpszEnd !=
';')
1248 *pBuff++ = *lpszEnd++;
1252 lpszCurr = lpszEnd + 1;
1291 TRACE(
"(%s,%p,%08x)\n",
debugstr_a(lpszFile), lppszOtherDirs, dwWhich);
1299 if (lppszOtherDirs && *lppszOtherDirs)
1302 LPCSTR *lpszOtherPath = lppszOtherDirs;
1304 while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
1334 TRACE(
"(%s,%p,%08x)\n",
debugstr_w(lpszFile), lppszOtherDirs, dwWhich);
1340 if (lppszOtherDirs && *lppszOtherDirs)
1342 LPCWSTR *lpszOtherPath = lppszOtherDirs;
1343 while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
1442 static const WCHAR szEllipses[] = {
'.',
'.',
'.',
'\0' };
1444 DWORD dwLen, dwFileLen = 0;
1453 WARN(
"Invalid lpszDest would crash under Win32!\n");
1462 dwLen =
strlenW(lpszPath) + 1;
1473 dwFileLen = lpszPath + dwLen - lpszFile;
1475 if (dwFileLen == dwLen)
1495 if (dwFileLen + 3 >
cchMax)
1523 dwLen =
cchMax - dwFileLen - 3;
1548 if (*lpszPath ==
'\\' || (*lpszPath && lpszPath[1] ==
':'))
1562 if (!lpszPath || !*lpszPath)
1564 if (*lpszPath ==
'\\' || (*lpszPath && lpszPath[1] ==
':'))
1585 if (lpszPath && *lpszPath)
1587 if (*lpszPath ==
'\\')
1591 else if (lpszPath[1]==
'\\')
1599 if (*lpszPath ==
'\\')
1610 else if (lpszPath[1] ==
':' && lpszPath[2] ==
'\\' && lpszPath[3] ==
'\0')
1625 if (lpszPath && *lpszPath)
1627 if (*lpszPath ==
'\\')
1631 else if (lpszPath[1]==
'\\')
1639 if (*lpszPath ==
'\\')
1650 else if (lpszPath[1] ==
':' && lpszPath[2] ==
'\\' && lpszPath[3] ==
'\0')
1688 FIXME(
"UNC Server Share not yet supported - FAILING\n");
1713 FIXME(
"UNC Server Share not yet supported - FAILING\n");
1855 while (*
mask ==
'*')
1888 while (*
mask ==
'*')
1916 TRACE(
"(%s,%s)\n", lpszPath, lpszMask);
1923 while (*lpszMask ==
' ')
1929 while (*lpszMask && *lpszMask !=
';')
1932 if (*lpszMask ==
';')
1945 static const WCHAR szStarDotStar[] = {
'*',
'.',
'*',
'\0' };
1949 if (!
lstrcmpW(lpszMask, szStarDotStar))
1954 while (*lpszMask ==
' ')
1960 while (*lpszMask && *lpszMask !=
';')
1963 if (*lpszMask ==
';')
1989 if (!lpszPath1 || !lpszPath2 || !(lpszStart =
PathSkipRootA(lpszPath1)))
1993 if (lpszStart - lpszPath1 > dwLen)
2010 if (!lpszPath1 || !lpszPath2 || !(lpszStart =
PathSkipRootW(lpszPath1)))
2014 if (lpszStart - lpszPath1 > dwLen)
2062 static const WCHAR szContentType[] = {
'C',
'o',
'n',
't',
'e',
'n',
't',
' ',
'T',
'y',
'p',
'e',
'\0' };
2072 !
strcmpiW(lpszContentType, szBuff))
2100 if (*lpszPath ==
'\\' || *lpszPath ==
':')
2121 if (*lpszPath ==
'\\' || *lpszPath ==
':')
2145 if (lpszPrefix && lpszPath &&
2160 if (lpszPrefix && lpszPath &&
2183 if (lpszPath && *lpszPath)
2201 if (lpszPath && *lpszPath)
2231 #if (WINVER >= _WIN32_WINNT_VISTA) 2232 if (lpszPath && (lpszPath[0]==
'\\') && (lpszPath[1]==
'\\') && (lpszPath[2]!=
'?'))
2234 if (lpszPath && (lpszPath[0]==
'\\') && (lpszPath[1]==
'\\'))
2254 #if (WINVER >= _WIN32_WINNT_VISTA) 2255 if (lpszPath && (lpszPath[0]==
'\\') && (lpszPath[1]==
'\\') && (lpszPath[2]!=
'?'))
2257 if (lpszPath && (lpszPath[0]==
'\\') && (lpszPath[1]==
'\\'))
2284 if (lpszPath && *lpszPath++ ==
'\\' && *lpszPath++ ==
'\\')
2288 if (*lpszPath ==
'\\')
2306 if (lpszPath && lpszPath[0] ==
'\\' && lpszPath[1] ==
'\\')
2308 return !
strchrW( lpszPath + 2,
'\\' );
2334 if (lpszPath && *lpszPath++ ==
'\\' && *lpszPath++ ==
'\\')
2339 if (*lpszPath ==
'\\')
2361 if (lpszPath && *lpszPath++ ==
'\\' && *lpszPath++ ==
'\\')
2366 if (*lpszPath ==
'\\')
2401 if (!lpszBuf || !lpszPath)
2410 WARN(
"Failed to convert string to widechar (too long?), LE %d.\n",
GetLastError());
2427 LPWSTR lpszDst = lpszBuf;
2435 if (!lpszBuf || !lpszPath)
2449 if (*lpszSrc ==
'\\')
2451 *lpszDst++ = *lpszSrc++;
2453 else if (*lpszSrc && lpszSrc[1] ==
':')
2456 *lpszDst++ = *lpszSrc++;
2457 *lpszDst++ = *lpszSrc++;
2458 if (*lpszSrc ==
'\\')
2459 *lpszDst++ = *lpszSrc++;
2465 if (*lpszSrc ==
'.')
2467 if (lpszSrc[1] ==
'\\' && (lpszSrc == lpszPath || lpszSrc[-1] ==
'\\' || lpszSrc[-1] ==
':'))
2471 else if (lpszSrc[1] ==
'.' && (lpszDst == lpszBuf || lpszDst[-1] ==
'\\'))
2476 if (lpszDst != lpszBuf)
2479 if (lpszDst > lpszBuf+1 && lpszDst[-1] ==
'\\' &&
2480 (lpszDst[-2] !=
'\\' || lpszDst > lpszBuf+2))
2482 if (lpszDst[-2] ==
':' && (lpszDst > lpszBuf+3 || lpszDst[-3] ==
':'))
2485 while (lpszDst > lpszBuf && *lpszDst !=
'\\')
2487 if (*lpszDst ==
'\\')
2495 while (lpszDst > lpszBuf && *lpszDst !=
'\\')
2497 if (lpszDst == lpszBuf)
2506 *lpszDst++ = *lpszSrc++;
2509 *lpszDst++ = *lpszSrc++;
2512 if (lpszDst - lpszBuf == 2 && lpszDst[-1] ==
':')
2541 if(!lpszPath || !*lpszPath)
2544 if ((lpszSlash =
StrChrA(lpszPath,
'\\')))
2546 if (lpszSlash[1] ==
'\\')
2548 return lpszSlash + 1;
2564 if(!lpszPath || !*lpszPath)
2567 if ((lpszSlash =
StrChrW(lpszPath,
'\\')))
2569 if (lpszSlash[1] ==
'\\')
2571 return lpszSlash + 1;
2603 dwLen =
strlen(lpszPath);
2608 strcpy(lpszPath + dwLen, lpszExtension);
2631 strcpyW(lpszPath + dwLen, lpszExtension);
2649 LPSTR pszIter = lpszPath;
2664 pszIter = lpszPath + 1;
2681 LPWSTR pszIter = lpszPath;
2696 pszIter = lpszPath + 1;
2733 LPCSTR lpszIter1 = lpszFile1;
2734 LPCSTR lpszIter2 = lpszFile2;
2741 if (!lpszFile1 || !lpszFile2)
2758 if ((!*lpszIter1 || *lpszIter1 ==
'\\') &&
2759 (!*lpszIter2 || *lpszIter2 ==
'\\'))
2760 iLen = lpszIter1 - lpszFile1;
2772 if (iLen && achPath)
2774 memcpy(achPath,lpszFile1,iLen);
2775 achPath[iLen] =
'\0';
2788 LPCWSTR lpszIter1 = lpszFile1;
2789 LPCWSTR lpszIter2 = lpszFile2;
2796 if (!lpszFile1 || !lpszFile2)
2813 if ((!*lpszIter1 || *lpszIter1 ==
'\\') &&
2814 (!*lpszIter2 || *lpszIter2 ==
'\\'))
2815 iLen = lpszIter1 - lpszFile1;
2827 if (iLen && achPath)
2830 achPath[iLen] =
'\0';
2872 static const WCHAR szEllipses[] = {
'.',
'.',
'.',
'\0' };
2895 DWORD dwEllipsesLen = 0, dwPathLen = 0;
2898 if (sFile != lpszPath) sFile--;
2902 dwEllipsesLen =
size.cx;
2905 dwPathLen =
size.cx;
2907 if (sFile != lpszPath)
2920 DWORD dwTotalLen = bEllipses? dwPathLen + dwEllipsesLen : dwPathLen;
2923 dwTotalLen +=
size.cx;
2924 if (dwTotalLen <=
dx)
2932 }
while (sPath > lpszPath);
2934 if (sPath > lpszPath)
2944 strcpyW(lpszPath, szEllipses);
2962 }
while (dwLen &&
size.cx + dwEllipsesLen >
dx);
2966 DWORD dwWritten = 0;
2971 while (dwWritten + dwEllipsesLen <
dx && dwLen < 3)
2974 dwWritten += dwEllipsesLen;
3019 TRACE(
"(%d)\n", ch);
3021 if (!ch || ch <
' ' || ch ==
'<' || ch ==
'>' ||
3022 ch ==
'"' || ch ==
'|' || ch ==
'/')
3024 else if (ch ==
'*' || ch==
'?')
3026 else if ((ch ==
'\\') || (ch ==
':'))
3032 if (((ch & 0
x1) && ch !=
';') || !ch ||
isalnum(ch) || ch ==
'$' || ch ==
'&' || ch ==
'(' ||
3033 ch ==
'.' || ch ==
'@' || ch ==
'^' ||
3034 ch ==
'\'' || ch == 130 || ch ==
'`')
3052 static BOOL bUseSystemForSystemFolders =
FALSE;
3060 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
3061 "UseSystemForSystemFolders", 0, 0, 0))
3062 bUseSystemForSystemFolders =
TRUE;
3064 return bUseSystemForSystemFolders;
3085 if (lpszPath && *lpszPath)
3106 if (!lpszPath || !*lpszPath)
3145 LPSTR lpszExtension;
3151 if (!lpszExtension || (lpszExtension - lpszPath +
strlen(lpszExt) >=
MAX_PATH))
3154 strcpy(lpszExtension, lpszExt);
3171 if (!lpszExtension || (lpszExtension - lpszPath +
strlenW(lpszExt) >=
MAX_PATH))
3174 strcpyW(lpszExtension, lpszExt);
3230 if (!lpszPath || !*lpszPath)
3233 if (*lpszPath ==
'\\' && lpszPath[1] ==
'\\')
3237 if ((lpszPath =
StrChrA(lpszPath,
'\\')) &&
3238 (lpszPath =
StrChrA(lpszPath + 1,
'\\')))
3240 return (
LPSTR)lpszPath;
3247 if (lpszPath[0] && lpszPath[1] ==
':' && lpszPath[2] ==
'\\')
3248 return (
LPSTR)lpszPath + 3;
3261 if (!lpszPath || !*lpszPath)
3264 if (*lpszPath ==
'\\' && lpszPath[1] ==
'\\')
3268 if ((lpszPath =
StrChrW(lpszPath,
'\\')) &&
3269 (lpszPath =
StrChrW(lpszPath + 1,
'\\')))
3275 if (lpszPath[0] && lpszPath[1] ==
':' && lpszPath[2] ==
'\\')
3276 return (
LPWSTR)lpszPath + 3;
3289 WCHAR *pathW = bufW;
3292 DWORD lenW =
sizeof(bufW)/
sizeof(
WCHAR), lenA;
3337 static const WCHAR file_colon[] = {
'f',
'i',
'l',
'e',
':',0 };
3338 static const WCHAR localhost[] = {
'l',
'o',
'c',
'a',
'l',
'h',
'o',
's',
't',0 };
3360 while (*
src ==
'/' || *
src ==
'\\') {
3411 while (*
src && *
src !=
'/' && *
src !=
'\\')
3440 if (*
dst ==
'/') *
dst =
'\\';
3441 if (
isalphaW(*tpath) && tpath[1] ==
'|')
3463 if (tpath != pszPath)
3466 if (tpath != pszPath)
3533 if(lpszPath && lpszFrom && lpszTo)
3554 static const WCHAR szPrevDirSlash[] = {
'.',
'.',
'\\',
'\0' };
3555 static const WCHAR szPrevDir[] = {
'.',
'.',
'\0' };
3563 if(!lpszPath || !lpszFrom || !lpszTo)
3580 lpszFrom =
szFrom + dwLen;
3586 if (*lpszFrom ==
'\\')
3592 strcatW(lpszPath, *lpszFrom ? szPrevDirSlash : szPrevDir);
3600 if (*lpszTo && lpszTo[-1])
3602 if (*lpszTo !=
'\\')
3610 strcpyW(lpszPath + dwLen, lpszTo);
3750 if (*lpszPath ==
'\\' && lpszPath[1] ==
'\\')
3753 if (dwDriveNum == -1)
3776 if (*lpszPath ==
'\\' && lpszPath[1] ==
'\\')
3779 if (dwDriveNum == -1)
3803 DWORD dwNameLen = 0, dwExtLen = 0;
3812 if (*lpszPath ==
' ')
3814 if (*lpszPath ==
'.')
3844 DWORD dwNameLen = 0, dwExtLen = 0;
3853 if (*lpszPath ==
' ')
3855 if (*lpszPath ==
'.')
3912 static const WCHAR szAllFiles[] = {
'*',
'.',
'*',
'\0' };
3930 strcpyW(szSearch + dwLen, szAllFiles);
3939 if (
find_data.cFileName[1] ==
'\0')
continue;
3979 if (lpszSuffix && lppszArray && dwCount > 0)
3981 dwLen =
strlen(lpszSuffix);
3983 while (dwRet < dwCount)
3985 size_t dwCompareLen =
strlen(*lppszArray);
3986 if (dwCompareLen < dwLen)
3988 if (!
strcmp(lpszSuffix + dwLen - dwCompareLen, *lppszArray))
4010 if (lpszSuffix && lppszArray && dwCount > 0)
4014 while (dwRet < dwCount)
4016 size_t dwCompareLen =
strlenW(*lppszArray);
4017 if (dwCompareLen < dwLen)
4019 if (!
strcmpW(lpszSuffix + dwLen - dwCompareLen, *lppszArray))
4050 if (lpszExt > lpszPath && lpszExt[-1] ==
']')
4052 LPSTR lpszSkip = lpszExt - 2;
4053 if (*lpszSkip ==
'[')
4056 while (lpszSkip > lpszPath &&
isdigit(lpszSkip[-1]))
4058 if (lpszSkip > lpszPath && lpszSkip[-1] ==
'[' && lpszSkip[-2] !=
'\\')
4063 *lpszSkip++ = *lpszExt++;
4082 if (lpszExt > lpszPath && lpszExt[-1] ==
']')
4084 LPWSTR lpszSkip = lpszExt - 2;
4085 if (*lpszSkip ==
'[')
4088 while (lpszSkip > lpszPath &&
isdigitW(lpszSkip[-1]))
4090 if (lpszSkip > lpszPath && lpszSkip[-1] ==
'[' && lpszSkip[-2] !=
'\\')
4095 *lpszSkip++ = *lpszExt++;
4126 if (!pathW)
return FALSE;
4133 if (buf_len <
len + 1)
return FALSE;
4139 static const WCHAR allusersprofileW[] = {
'%',
'A',
'L',
'L',
'U',
'S',
'E',
'R',
'S',
'P',
'R',
'O',
'F',
'I',
'L',
'E',
'%',0};
4141 static const WCHAR programfilesW[] = {
'%',
'P',
'r',
'o',
'g',
'r',
'a',
'm',
'F',
'i',
'l',
'e',
's',
'%',0};
4142 static const WCHAR systemrootW[] = {
'%',
'S',
'y',
's',
't',
'e',
'm',
'R',
'o',
'o',
't',
'%',0};
4143 static const WCHAR systemdriveW[] = {
'%',
'S',
'y',
's',
't',
'e',
'm',
'D',
'r',
'i',
'v',
'e',
'%',0};
4144 static const WCHAR userprofileW[] = {
'%',
'U',
'S',
'E',
'R',
'P',
'R',
'O',
'F',
'I',
'L',
'E',
'%',0};
4160 if (
map->len)
map->len--;
4194 if (cur->len == 0 || cur->len > pathlen ||
strncmpiW(cur->path,
path, cur->len))
4200 if (cur->len >
match->len)
4206 needed =
match->varlen + pathlen -
match->len;
4207 if (
match->len == 0 || needed > buf_len)
return FALSE;
4235 TRACE(
"(%s,%p,%d)\n", lpszFile, lpszPath, dwPathLen);
4251 static const WCHAR szWeb[] = {
'\\',
'W',
'e',
'b',
'\\',
'\0'};
4252 static const WCHAR szWebMui[] = {
'm',
'u',
'i',
'\\',
'%',
'0',
'4',
'x',
'\\',
'\0'};
4253 #define szWebLen (sizeof(szWeb)/sizeof(WCHAR)) 4254 #define szWebMuiLen ((sizeof(szWebMui)+1)/sizeof(WCHAR)) 4255 DWORD dwLen, dwFileLen;
4256 LANGID lidSystem, lidUser;
4262 if (dwLen > 0 && lpszPath[dwLen-1] ==
'\\')
4265 dwFileLen =
strlenW(lpszFile);
4267 if (dwLen + dwFileLen +
szWebLen >= dwPathLen)
4270 strcpyW(lpszPath+dwLen, szWeb);
4272 dwPathLen = dwPathLen - dwLen;
4277 if (lidSystem != lidUser)
4282 wsprintfW(lpszPath + dwLen, szWebMui, lidUser);
4290 strcpyW(lpszPath + dwLen, lpszFile);
4296 #define PATH_CHAR_CLASS_LETTER 0x00000001 4297 #define PATH_CHAR_CLASS_ASTERIX 0x00000002 4298 #define PATH_CHAR_CLASS_DOT 0x00000004 4299 #define PATH_CHAR_CLASS_BACKSLASH 0x00000008 4300 #define PATH_CHAR_CLASS_COLON 0x00000010 4301 #define PATH_CHAR_CLASS_SEMICOLON 0x00000020 4302 #define PATH_CHAR_CLASS_COMMA 0x00000040 4303 #define PATH_CHAR_CLASS_SPACE 0x00000080 4304 #define PATH_CHAR_CLASS_OTHER_VALID 0x00000100 4305 #define PATH_CHAR_CLASS_DOUBLEQUOTE 0x00000200 4307 #define PATH_CHAR_CLASS_INVALID 0x00000000 4308 #define PATH_CHAR_CLASS_ANY 0xffffffff 4385 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
#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)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteSize(PULONG MbSize, PCWCH UnicodeString, ULONG UnicodeSize)
BOOL WINAPI PathUnExpandEnvStringsA(LPCSTR path, LPSTR buffer, UINT buf_len)
static const WCHAR szFrom[]
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)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteN(PCHAR MbString, ULONG MbSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
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)
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)