26#include "wine/unicode.h"
33#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; \
92 lpszPath[0] =
'A' +
drive;
111 lpszPath[0] =
'A' +
drive;
142 if(*lpszLastChar ==
' ')
143 *lpszLastChar =
'\0';
160 if (*lpszArgs || (lpszArgs > lpszPath && lpszArgs[-1] ==
' '))
172 static const WCHAR pszExts[][5] = { {
'.',
'p',
'i',
'f', 0},
173 {
'.',
'c',
'o',
'm', 0},
174 {
'.',
'e',
'x',
'e', 0},
175 {
'.',
'b',
'a',
't', 0},
176 {
'.',
'l',
'n',
'k', 0},
177 {
'.',
'c',
'm',
'd', 0},
189 if (!*szExt || dwWhich & 0x40)
199 while ( (dwWhich & 0x1) && pszExts[iChoose][0] )
201 while (pszExts[iChoose][0])
209 lstrcpyW(lpszPath + iLen, pszExts[iChoose]);
218 *(lpszPath + iLen) = (
WCHAR)
'\0';
272 static const WCHAR szSystem[] = {
'S',
'y',
's',
't',
'e',
'm',
'\0'};
273 static const WCHAR szPath[] = {
'P',
'A',
'T',
'H',
'\0'};
309 if (!dwLenPATH || !(lpszPATH =
malloc((dwLenPATH + 1) *
sizeof (
WCHAR))))
319 while (*lpszEnd ==
' ')
321 while (*lpszEnd && *lpszEnd !=
';')
322 *pBuff++ = *lpszEnd++;
326 lpszCurr = lpszEnd + 1;
365 TRACE(
"(%s,%p,%08lx)\n",
debugstr_a(lpszFile), lppszOtherDirs, dwWhich);
373 if (lppszOtherDirs && *lppszOtherDirs)
376 LPCSTR *lpszOtherPath = lppszOtherDirs;
378 while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
408 TRACE(
"(%s,%p,%08lx)\n",
debugstr_w(lpszFile), lppszOtherDirs, dwWhich);
414 if (lppszOtherDirs && *lppszOtherDirs)
416 LPCWSTR *lpszOtherPath = lppszOtherDirs;
417 while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
516 static const WCHAR szEllipses[] = {
'.',
'.',
'.',
'\0' };
518 DWORD dwLen, dwFileLen = 0;
527 WARN(
"Invalid lpszDest would crash under Win32!\n");
547 dwFileLen = lpszPath + dwLen - lpszFile;
549 if (dwFileLen == dwLen)
569 if (dwFileLen + 3 >
cchMax)
597 dwLen =
cchMax - dwFileLen - 3;
654 FIXME(
"UNC Server Share not yet supported - FAILING\n");
698 FIXME(
"UNC Server Share not yet supported - FAILING\n");
804 static const WCHAR szContentType[] = {
'C',
'o',
'n',
't',
'e',
'n',
't',
' ',
'T',
'y',
'p',
'e',
'\0' };
814 !
wcsicmp(lpszContentType, szBuff))
838 if (lpszPath && *lpszPath)
856 if (lpszPath && *lpszPath)
879 LPSTR pszIter = lpszPath;
894 pszIter = lpszPath + 1;
911 LPWSTR pszIter = lpszPath;
926 pszIter = lpszPath + 1;
973 static const WCHAR szEllipses[] = {
'.',
'.',
'.',
'\0' };
996 DWORD dwEllipsesLen = 0, dwPathLen = 0;
999 if (sFile != lpszPath) sFile--;
1003 dwEllipsesLen =
size.cx;
1006 dwPathLen =
size.cx;
1008 if (sFile != lpszPath)
1021 DWORD dwTotalLen = bEllipses? dwPathLen + dwEllipsesLen : dwPathLen;
1024 dwTotalLen +=
size.cx;
1025 if (dwTotalLen <=
dx)
1033 }
while (sPath > lpszPath);
1035 if (sPath > lpszPath)
1063 }
while (dwLen &&
size.cx + dwEllipsesLen >
dx);
1067 DWORD dwWritten = 0;
1072 while (dwWritten + dwEllipsesLen <
dx && dwLen < 3)
1075 dwWritten += dwEllipsesLen;
1103 static BOOL bUseSystemForSystemFolders =
FALSE;
1111 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
1112 "UseSystemForSystemFolders", 0, 0, 0))
1113 bUseSystemForSystemFolders =
TRUE;
1115 return bUseSystemForSystemFolders;
1136 if (lpszPath && *lpszPath)
1157 if (!lpszPath || !*lpszPath)
1316 if (*lpszPath ==
'\\' && lpszPath[1] ==
'\\')
1319 if (dwDriveNum == -1)
1342 if (*lpszPath ==
'\\' && lpszPath[1] ==
'\\')
1345 if (dwDriveNum == -1)
1389 static const WCHAR szAllFiles[] = {
'*',
'.',
'*',
'\0' };
1407 lstrcpyW(szSearch + dwLen, szAllFiles);
1416 if (
find_data.cFileName[1] ==
'\0')
continue;
1456 if (lpszSuffix && lppszArray && dwCount > 0)
1458 dwLen =
strlen(lpszSuffix);
1460 while (dwRet < dwCount)
1462 size_t dwCompareLen =
strlen(*lppszArray);
1463 if (dwCompareLen < dwLen)
1465 if (!
strcmp(lpszSuffix + dwLen - dwCompareLen, *lppszArray))
1487 if (lpszSuffix && lppszArray && dwCount > 0)
1491 while (dwRet < dwCount)
1493 size_t dwCompareLen =
lstrlenW(*lppszArray);
1494 if (dwCompareLen < dwLen)
1496 if (!
wcscmp(lpszSuffix + dwLen - dwCompareLen, *lppszArray))
1582 TRACE(
"(%s,%p,%ld)\n", lpszFile, lpszPath, dwPathLen);
1598 static const WCHAR szWeb[] = {
'\\',
'W',
'e',
'b',
'\\',
'\0'};
1599 static const WCHAR szWebMui[] = {
'm',
'u',
'i',
'\\',
'%',
'0',
'4',
'x',
'\\',
'\0'};
1600 DWORD dwLen, dwFileLen;
1601 LANGID lidSystem, lidUser;
1607 if (dwLen > 0 && lpszPath[dwLen-1] ==
'\\')
1612 if (dwLen + dwFileLen +
ARRAY_SIZE(szWeb) >= dwPathLen)
1617 dwPathLen = dwPathLen - dwLen;
1622 if (lidSystem != lidUser)
1624 if (dwFileLen +
ARRAY_SIZE(szWebMui) < dwPathLen)
1627 wsprintfW(lpszPath + dwLen, szWebMui, lidUser);
1635 lstrcpyW(lpszPath + dwLen, lpszFile);
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void shell(int argc, const char *argv[])
static int find_data(const struct Vector *v, const BYTE *pData, int size)
#define GetEnvironmentVariableW(x, y, z)
#define INVALID_HANDLE_VALUE
#define WideCharToMultiByte
#define MultiByteToWideChar
static const WCHAR *const ext[]
UINT WINAPI SetErrorMode(IN UINT uMode)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
UINT WINAPI GetSystemWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI IsDBCSLeadByte(BYTE testchar)
LANGID WINAPI GetUserDefaultUILanguage(void)
LANGID WINAPI GetSystemDefaultUILanguage(void)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
LPSTR WINAPI PathFindExtensionA(const char *path)
int WINAPI PathGetDriveNumberW(const WCHAR *path)
BOOL WINAPI PathIsUNCServerShareW(const WCHAR *path)
BOOL WINAPI PathIsUNCServerA(const char *path)
BOOL WINAPI PathIsFileSpecA(const char *path)
WCHAR *WINAPI PathFindFileNameW(const WCHAR *path)
char *WINAPI PathGetArgsA(const char *path)
LPWSTR WINAPI PathFindExtensionW(const WCHAR *path)
int WINAPI PathGetDriveNumberA(const char *path)
BOOL WINAPI PathIsUNCServerW(const WCHAR *path)
WCHAR *WINAPI PathGetArgsW(const WCHAR *path)
BOOL WINAPI PathFileExistsW(const WCHAR *path)
BOOL WINAPI PathIsFileSpecW(const WCHAR *path)
BOOL WINAPI PathIsUNCServerShareA(const char *path)
LPSTR WINAPI CharPrevA(const char *start, const char *ptr)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
DWORD WINAPI SHGetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD *type, void *data, DWORD *data_len)
DWORD WINAPI SHGetValueA(HKEY hkey, const char *subkey, const char *value, DWORD *type, void *data, DWORD *data_len)
HRESULT WINAPI SHGetWebFolderFilePathA(LPCSTR lpszFile, LPSTR lpszPath, DWORD dwPathLen)
void WINAPI PathRemoveArgsW(LPWSTR lpszPath)
BOOL WINAPI PathFileExistsDefExtA(LPSTR lpszPath, DWORD dwWhich)
BOOL WINAPI PathIsDirectoryA(LPCSTR lpszPath)
BOOL WINAPI PathMakeSystemFolderA(LPCSTR lpszPath)
BOOL WINAPI PathIsNetworkPathW(LPCWSTR lpszPath)
LPSTR WINAPI PathBuildRootA(LPSTR lpszPath, int drive)
BOOL WINAPI PathMakeSystemFolderW(LPCWSTR lpszPath)
BOOL(WINAPI * fnpIsNetDrive)(int)
BOOL WINAPI PathIsNetworkPathA(LPCSTR lpszPath)
BOOL WINAPI PathFindOnPathExA(LPSTR lpszFile, LPCSTR *lppszOtherDirs, DWORD dwWhich)
void WINAPI PathRemoveArgsA(LPSTR lpszPath)
#define GET_FUNC(func, module, name, fail)
BOOL WINAPI PathFindOnPathW(LPWSTR lpszFile, LPCWSTR *lppszOtherDirs)
BOOL WINAPI PathIsDirectoryEmptyW(LPCWSTR lpszPath)
BOOL WINAPI PathCompactPathExA(LPSTR lpszDest, LPCSTR lpszPath, UINT cchMax, DWORD dwFlags)
void WINAPI PathUndecorateW(WCHAR *path)
BOOL WINAPI PathIsSystemFolderA(LPCSTR lpszPath, DWORD dwAttrib)
BOOL WINAPI PathCompactPathExW(LPWSTR lpszDest, LPCWSTR lpszPath, UINT cchMax, DWORD dwFlags)
static BOOL SHLWAPI_UseSystemForSystemFolders(void)
void WINAPI PathUndecorateA(char *path)
BOOL WINAPI PathMakePrettyW(LPWSTR lpszPath)
static BOOL SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich)
BOOL WINAPI PathCompactPathA(HDC hDC, LPSTR lpszPath, UINT dx)
BOOL WINAPI PathUnmakeSystemFolderW(LPCWSTR lpszPath)
BOOL WINAPI PathFindOnPathA(LPSTR lpszFile, LPCSTR *lppszOtherDirs)
static fnpIsNetDrive pIsNetDrive
LPWSTR WINAPI PathBuildRootW(LPWSTR lpszPath, int drive)
BOOL WINAPI PathFileExistsAndAttributesA(LPCSTR lpszPath, DWORD *dwAttr)
static HMODULE SHLWAPI_hshell32
HRESULT WINAPI SHGetWebFolderFilePathW(LPCWSTR, LPWSTR, DWORD)
VOID WINAPI PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR lpszPath)
BOOL WINAPI PathIsContentTypeW(LPCWSTR lpszPath, LPCWSTR lpszContentType)
BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR lpszPath, UINT dx)
BOOL WINAPI PathIsSystemFolderW(LPCWSTR lpszPath, DWORD dwAttrib)
BOOL WINAPI PathFindOnPathExW(LPWSTR lpszFile, LPCWSTR *lppszOtherDirs, DWORD dwWhich)
BOOL WINAPI PathMakePrettyA(LPSTR lpszPath)
LPCSTR WINAPI PathFindSuffixArrayA(LPCSTR lpszSuffix, LPCSTR *lppszArray, int dwCount)
BOOL WINAPI PathUnmakeSystemFolderA(LPCSTR lpszPath)
VOID WINAPI PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR lpszPath)
LPCWSTR WINAPI PathFindSuffixArrayW(LPCWSTR lpszSuffix, LPCWSTR *lppszArray, int dwCount)
BOOL WINAPI PathFileExistsAndAttributesW(LPCWSTR lpszPath, DWORD *dwAttr)
BOOL WINAPI PathFileExistsDefExtW(LPWSTR lpszPath, DWORD dwWhich)
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
BOOL WINAPI PathIsDirectoryEmptyA(LPCSTR lpszPath)
BOOL WINAPI PathIsContentTypeA(LPCSTR path, LPCSTR content_type)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLenum GLuint GLenum GLsizei const GLchar * buf
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
#define SEM_FAILCRITICALERRORS
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_SYSTEM
#define FILE_ATTRIBUTE_DIRECTORY
#define PathAddBackslashW
static const char *static const char const char DWORD void DWORD *static const char const char DWORD void DWORD *static const char DWORD DWORD void * buff
EXTERN_C int WINAPI IsNetDrive(int drive)
#define INVALID_FILE_ATTRIBUTES
#define GetFileAttributes
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
struct _NETRESOURCEA * LPNETRESOURCEA
#define RESOURCEDISPLAYTYPE_SHARE
#define RESOURCEDISPLAYTYPE_GENERIC
#define RESOURCETYPE_DISK
struct _NETRESOURCEW * LPNETRESOURCEW
#define RESOURCE_GLOBALNET
#define HKEY_LOCAL_MACHINE
#define HKEY_CLASSES_ROOT
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HDC WINAPI GetDC(_In_opt_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD WINAPI WNetGetResourceInformationA(LPNETRESOURCEA lpNetResource, LPVOID lpBuffer, LPDWORD cbBuffer, LPSTR *lplpSystem)
DWORD WINAPI WNetGetResourceInformationW(LPNETRESOURCEW lpNetResource, LPVOID lpBuffer, LPDWORD cbBuffer, LPWSTR *lplpSystem)