ReactOS 0.4.16-dev-847-g386fccd
path.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include "wine/unicode.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winternl.h"
#include "shlwapi.h"
#include "wine/debug.h"
Include dependency graph for path.c:

Go to the source code of this file.

Classes

struct  envvars_map
 

Macros

#define NO_SHLWAPI_STREAM
 
#define GET_FUNC(func, module, name, fail)
 
#define szWebLen   (sizeof(szWeb)/sizeof(WCHAR))
 
#define szWebMuiLen   ((sizeof(szWebMui)+1)/sizeof(WCHAR))
 
#define PATH_CHAR_CLASS_LETTER   0x00000001
 
#define PATH_CHAR_CLASS_ASTERIX   0x00000002
 
#define PATH_CHAR_CLASS_DOT   0x00000004
 
#define PATH_CHAR_CLASS_BACKSLASH   0x00000008
 
#define PATH_CHAR_CLASS_COLON   0x00000010
 
#define PATH_CHAR_CLASS_SEMICOLON   0x00000020
 
#define PATH_CHAR_CLASS_COMMA   0x00000040
 
#define PATH_CHAR_CLASS_SPACE   0x00000080
 
#define PATH_CHAR_CLASS_OTHER_VALID   0x00000100
 
#define PATH_CHAR_CLASS_DOUBLEQUOTE   0x00000200
 
#define PATH_CHAR_CLASS_INVALID   0x00000000
 
#define PATH_CHAR_CLASS_ANY   0xffffffff
 

Typedefs

typedef BOOL(WINAPIfnpIsNetDrive) (int)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
HRESULT WINAPI SHGetWebFolderFilePathW (LPCWSTR, LPWSTR, DWORD)
 
static WCHARheap_strdupAtoW (LPCSTR str)
 
BOOL WINAPI PathAppendA (LPSTR lpszPath, LPCSTR lpszAppend)
 
BOOL WINAPI PathAppendW (LPWSTR lpszPath, LPCWSTR lpszAppend)
 
LPSTR WINAPI PathCombineA (LPSTR lpszDest, LPCSTR lpszDir, LPCSTR lpszFile)
 
LPWSTR WINAPI PathCombineW (LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
 
LPSTR WINAPI PathAddBackslashA (LPSTR lpszPath)
 
LPWSTR WINAPI PathAddBackslashW (LPWSTR lpszPath)
 
LPSTR WINAPI PathBuildRootA (LPSTR lpszPath, int drive)
 
LPWSTR WINAPI PathBuildRootW (LPWSTR lpszPath, int drive)
 
LPSTR WINAPI PathFindFileNameA (LPCSTR lpszPath)
 
LPWSTR WINAPI PathFindFileNameW (LPCWSTR lpszPath)
 
LPSTR WINAPI PathFindExtensionA (LPCSTR lpszPath)
 
LPWSTR WINAPI PathFindExtensionW (LPCWSTR lpszPath)
 
LPSTR WINAPI PathGetArgsA (LPCSTR lpszPath)
 
LPWSTR WINAPI PathGetArgsW (LPCWSTR lpszPath)
 
int WINAPI PathGetDriveNumberA (LPCSTR lpszPath)
 
int WINAPI PathGetDriveNumberW (const WCHAR *path)
 
BOOL WINAPI PathRemoveFileSpecA (LPSTR lpszPath)
 
BOOL WINAPI PathRemoveFileSpecW (LPWSTR lpszPath)
 
void WINAPI PathStripPathA (LPSTR lpszPath)
 
void WINAPI PathStripPathW (LPWSTR lpszPath)
 
BOOL WINAPI PathStripToRootA (LPSTR lpszPath)
 
BOOL WINAPI PathStripToRootW (LPWSTR lpszPath)
 
void WINAPI PathRemoveArgsA (LPSTR lpszPath)
 
void WINAPI PathRemoveArgsW (LPWSTR lpszPath)
 
void WINAPI PathRemoveExtensionA (LPSTR lpszPath)
 
void WINAPI PathRemoveExtensionW (LPWSTR lpszPath)
 
LPSTR WINAPI PathRemoveBackslashA (LPSTR lpszPath)
 
LPWSTR WINAPI PathRemoveBackslashW (LPWSTR lpszPath)
 
void WINAPI PathRemoveBlanksA (LPSTR pszPath)
 
void WINAPI PathRemoveBlanksW (LPWSTR pszPath)
 
VOID WINAPI PathQuoteSpacesA (LPSTR lpszPath)
 
VOID WINAPI PathQuoteSpacesW (LPWSTR lpszPath)
 
VOID WINAPI PathUnquoteSpacesA (LPSTR lpszPath)
 
VOID WINAPI PathUnquoteSpacesW (LPWSTR lpszPath)
 
int WINAPI PathParseIconLocationA (LPSTR lpszPath)
 
int WINAPI PathParseIconLocationW (LPWSTR lpszPath)
 
BOOL WINAPI PathFileExistsDefExtW (LPWSTR lpszPath, DWORD dwWhich)
 
BOOL WINAPI PathFileExistsDefExtA (LPSTR lpszPath, DWORD dwWhich)
 
static BOOL SHLWAPI_PathFindInOtherDirs (LPWSTR lpszFile, DWORD dwWhich)
 
BOOL WINAPI PathFindOnPathExA (LPSTR lpszFile, LPCSTR *lppszOtherDirs, DWORD dwWhich)
 
BOOL WINAPI PathFindOnPathExW (LPWSTR lpszFile, LPCWSTR *lppszOtherDirs, DWORD dwWhich)
 
BOOL WINAPI PathFindOnPathA (LPSTR lpszFile, LPCSTR *lppszOtherDirs)
 
BOOL WINAPI PathFindOnPathW (LPWSTR lpszFile, LPCWSTR *lppszOtherDirs)
 
BOOL WINAPI PathCompactPathExA (LPSTR lpszDest, LPCSTR lpszPath, UINT cchMax, DWORD dwFlags)
 
BOOL WINAPI PathCompactPathExW (LPWSTR lpszDest, LPCWSTR lpszPath, UINT cchMax, DWORD dwFlags)
 
BOOL WINAPI PathIsRelativeA (LPCSTR lpszPath)
 
BOOL WINAPI PathIsRelativeW (LPCWSTR lpszPath)
 
BOOL WINAPI PathIsRootA (LPCSTR lpszPath)
 
BOOL WINAPI PathIsRootW (LPCWSTR lpszPath)
 
BOOL WINAPI PathIsDirectoryA (LPCSTR lpszPath)
 
BOOL WINAPI PathIsDirectoryW (LPCWSTR lpszPath)
 
BOOL WINAPI PathFileExistsA (LPCSTR lpszPath)
 
BOOL WINAPI PathFileExistsW (LPCWSTR lpszPath)
 
BOOL WINAPI PathFileExistsAndAttributesA (LPCSTR lpszPath, DWORD *dwAttr)
 
BOOL WINAPI PathFileExistsAndAttributesW (LPCWSTR lpszPath, DWORD *dwAttr)
 
static BOOL PathMatchSingleMaskA (LPCSTR name, LPCSTR mask)
 
static BOOL PathMatchSingleMaskW (LPCWSTR name, LPCWSTR mask)
 
BOOL WINAPI PathMatchSpecA (LPCSTR lpszPath, LPCSTR lpszMask)
 
BOOL WINAPI PathMatchSpecW (LPCWSTR lpszPath, LPCWSTR lpszMask)
 
BOOL WINAPI PathIsSameRootA (LPCSTR lpszPath1, LPCSTR lpszPath2)
 
BOOL WINAPI PathIsSameRootW (LPCWSTR lpszPath1, LPCWSTR lpszPath2)
 
BOOL WINAPI PathIsContentTypeA (LPCSTR lpszPath, LPCSTR lpszContentType)
 
BOOL WINAPI PathIsContentTypeW (LPCWSTR lpszPath, LPCWSTR lpszContentType)
 
BOOL WINAPI PathIsFileSpecA (LPCSTR lpszPath)
 
BOOL WINAPI PathIsFileSpecW (LPCWSTR lpszPath)
 
BOOL WINAPI PathIsPrefixA (LPCSTR lpszPrefix, LPCSTR lpszPath)
 
BOOL WINAPI PathIsPrefixW (LPCWSTR lpszPrefix, LPCWSTR lpszPath)
 
BOOL WINAPI PathIsSystemFolderA (LPCSTR lpszPath, DWORD dwAttrib)
 
BOOL WINAPI PathIsSystemFolderW (LPCWSTR lpszPath, DWORD dwAttrib)
 
BOOL WINAPI PathIsUNCA (LPCSTR lpszPath)
 
BOOL WINAPI PathIsUNCW (LPCWSTR lpszPath)
 
BOOL WINAPI PathIsUNCServerA (LPCSTR lpszPath)
 
BOOL WINAPI PathIsUNCServerW (LPCWSTR lpszPath)
 
BOOL WINAPI PathIsUNCServerShareA (LPCSTR lpszPath)
 
BOOL WINAPI PathIsUNCServerShareW (LPCWSTR lpszPath)
 
BOOL WINAPI PathCanonicalizeA (LPSTR lpszBuf, LPCSTR lpszPath)
 
BOOL WINAPI PathCanonicalizeW (LPWSTR lpszBuf, LPCWSTR lpszPath)
 
LPSTR WINAPI PathFindNextComponentA (LPCSTR lpszPath)
 
LPWSTR WINAPI PathFindNextComponentW (LPCWSTR lpszPath)
 
BOOL WINAPI PathAddExtensionA (LPSTR lpszPath, LPCSTR lpszExtension)
 
BOOL WINAPI PathAddExtensionW (LPWSTR lpszPath, LPCWSTR lpszExtension)
 
BOOL WINAPI PathMakePrettyA (LPSTR lpszPath)
 
BOOL WINAPI PathMakePrettyW (LPWSTR lpszPath)
 
int WINAPI PathCommonPrefixA (LPCSTR lpszFile1, LPCSTR lpszFile2, LPSTR achPath)
 
int WINAPI PathCommonPrefixW (LPCWSTR lpszFile1, LPCWSTR lpszFile2, LPWSTR achPath)
 
BOOL WINAPI PathCompactPathA (HDC hDC, LPSTR lpszPath, UINT dx)
 
BOOL WINAPI PathCompactPathW (HDC hDC, LPWSTR lpszPath, UINT dx)
 
UINT WINAPI PathGetCharTypeA (UCHAR ch)
 
UINT WINAPI PathGetCharTypeW (WCHAR ch)
 
static BOOL SHLWAPI_UseSystemForSystemFolders (void)
 
BOOL WINAPI PathMakeSystemFolderA (LPCSTR lpszPath)
 
BOOL WINAPI PathMakeSystemFolderW (LPCWSTR lpszPath)
 
BOOL WINAPI PathRenameExtensionA (LPSTR lpszPath, LPCSTR lpszExt)
 
BOOL WINAPI PathRenameExtensionW (LPWSTR lpszPath, LPCWSTR lpszExt)
 
BOOL WINAPI PathSearchAndQualifyA (LPCSTR lpszPath, LPSTR lpszBuf, UINT cchBuf)
 
BOOL WINAPI PathSearchAndQualifyW (LPCWSTR lpszPath, LPWSTR lpszBuf, UINT cchBuf)
 
LPSTR WINAPI PathSkipRootA (LPCSTR lpszPath)
 
LPWSTR WINAPI PathSkipRootW (LPCWSTR lpszPath)
 
HRESULT WINAPI PathCreateFromUrlA (LPCSTR pszUrl, LPSTR pszPath, LPDWORD pcchPath, DWORD dwReserved)
 
HRESULT WINAPI PathCreateFromUrlW (LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwReserved)
 
HRESULT WINAPI PathCreateFromUrlAlloc (LPCWSTR pszUrl, LPWSTR *pszPath, DWORD dwReserved)
 
BOOL WINAPI PathRelativePathToA (LPSTR lpszPath, LPCSTR lpszFrom, DWORD dwAttrFrom, LPCSTR lpszTo, DWORD dwAttrTo)
 
BOOL WINAPI PathRelativePathToW (LPWSTR lpszPath, LPCWSTR lpszFrom, DWORD dwAttrFrom, LPCWSTR lpszTo, DWORD dwAttrTo)
 
BOOL WINAPI PathUnmakeSystemFolderA (LPCSTR lpszPath)
 
BOOL WINAPI PathUnmakeSystemFolderW (LPCWSTR lpszPath)
 
VOID WINAPI PathSetDlgItemPathA (HWND hDlg, int id, LPCSTR lpszPath)
 
VOID WINAPI PathSetDlgItemPathW (HWND hDlg, int id, LPCWSTR lpszPath)
 
BOOL WINAPI PathIsNetworkPathA (LPCSTR lpszPath)
 
BOOL WINAPI PathIsNetworkPathW (LPCWSTR lpszPath)
 
BOOL WINAPI PathIsLFNFileSpecA (LPCSTR lpszPath)
 
BOOL WINAPI PathIsLFNFileSpecW (LPCWSTR lpszPath)
 
BOOL WINAPI PathIsDirectoryEmptyA (LPCSTR lpszPath)
 
BOOL WINAPI PathIsDirectoryEmptyW (LPCWSTR lpszPath)
 
LPCSTR WINAPI PathFindSuffixArrayA (LPCSTR lpszSuffix, LPCSTR *lppszArray, int dwCount)
 
LPCWSTR WINAPI PathFindSuffixArrayW (LPCWSTR lpszSuffix, LPCWSTR *lppszArray, int dwCount)
 
void WINAPI PathUndecorateA (LPSTR pszPath)
 
void WINAPI PathUndecorateW (LPWSTR pszPath)
 
BOOL WINAPI PathUnExpandEnvStringsA (LPCSTR path, LPSTR buffer, UINT buf_len)
 
static void init_envvars_map (struct envvars_map *map)
 
BOOL WINAPI PathUnExpandEnvStringsW (LPCWSTR path, LPWSTR buffer, UINT buf_len)
 
HRESULT WINAPI SHGetWebFolderFilePathA (LPCSTR lpszFile, LPSTR lpszPath, DWORD dwPathLen)
 
BOOL WINAPI PathIsValidCharA (char c, DWORD class)
 
BOOL WINAPI PathIsValidCharW (WCHAR c, DWORD class)
 

Variables

static HMODULE SHLWAPI_hshell32
 
static fnpIsNetDrive pIsNetDrive
 
static const WCHAR allusersprofileW [] = {'%','A','L','L','U','S','E','R','S','P','R','O','F','I','L','E','%',0}
 
static const WCHAR appdataW [] = {'%','A','P','P','D','A','T','A','%',0}
 
static const WCHAR programfilesW [] = {'%','P','r','o','g','r','a','m','F','i','l','e','s','%',0}
 
static const WCHAR systemrootW [] = {'%','S','y','s','t','e','m','R','o','o','t','%',0}
 
static const WCHAR systemdriveW [] = {'%','S','y','s','t','e','m','D','r','i','v','e','%',0}
 
static const WCHAR userprofileW [] = {'%','U','S','E','R','P','R','O','F','I','L','E','%',0}
 
static const DWORD SHELL_charclass []
 

Macro Definition Documentation

◆ GET_FUNC

#define GET_FUNC (   func,
  module,
  name,
  fail 
)
Value:
do { \
if (!func) { \
if (!SHLWAPI_h##module && !(SHLWAPI_h##module = LoadLibraryA(#module ".dll"))) return fail; \
func = (fn##func)GetProcAddress(SHLWAPI_h##module, name); \
if (!func) return fail; \
} \
} while (0)
#define GetProcAddress(x, y)
Definition: compat.h:753
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
GLenum func
Definition: glext.h:6028
Definition: name.c:39
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159

Definition at line 52 of file path.c.

◆ NO_SHLWAPI_STREAM

#define NO_SHLWAPI_STREAM

Definition at line 36 of file path.c.

◆ PATH_CHAR_CLASS_ANY

#define PATH_CHAR_CLASS_ANY   0xffffffff

Definition at line 4320 of file path.c.

◆ PATH_CHAR_CLASS_ASTERIX

#define PATH_CHAR_CLASS_ASTERIX   0x00000002

Definition at line 4309 of file path.c.

◆ PATH_CHAR_CLASS_BACKSLASH

#define PATH_CHAR_CLASS_BACKSLASH   0x00000008

Definition at line 4311 of file path.c.

◆ PATH_CHAR_CLASS_COLON

#define PATH_CHAR_CLASS_COLON   0x00000010

Definition at line 4312 of file path.c.

◆ PATH_CHAR_CLASS_COMMA

#define PATH_CHAR_CLASS_COMMA   0x00000040

Definition at line 4314 of file path.c.

◆ PATH_CHAR_CLASS_DOT

#define PATH_CHAR_CLASS_DOT   0x00000004

Definition at line 4310 of file path.c.

◆ PATH_CHAR_CLASS_DOUBLEQUOTE

#define PATH_CHAR_CLASS_DOUBLEQUOTE   0x00000200

Definition at line 4317 of file path.c.

◆ PATH_CHAR_CLASS_INVALID

#define PATH_CHAR_CLASS_INVALID   0x00000000

Definition at line 4319 of file path.c.

◆ PATH_CHAR_CLASS_LETTER

#define PATH_CHAR_CLASS_LETTER   0x00000001

Definition at line 4308 of file path.c.

◆ PATH_CHAR_CLASS_OTHER_VALID

#define PATH_CHAR_CLASS_OTHER_VALID   0x00000100

Definition at line 4316 of file path.c.

◆ PATH_CHAR_CLASS_SEMICOLON

#define PATH_CHAR_CLASS_SEMICOLON   0x00000020

Definition at line 4313 of file path.c.

◆ PATH_CHAR_CLASS_SPACE

#define PATH_CHAR_CLASS_SPACE   0x00000080

Definition at line 4315 of file path.c.

◆ szWebLen

#define szWebLen   (sizeof(szWeb)/sizeof(WCHAR))

◆ szWebMuiLen

#define szWebMuiLen   ((sizeof(szWebMui)+1)/sizeof(WCHAR))

Typedef Documentation

◆ fnpIsNetDrive

typedef BOOL(WINAPI * fnpIsNetDrive) (int)

Definition at line 65 of file path.c.

Function Documentation

◆ heap_strdupAtoW()

static WCHAR * heap_strdupAtoW ( LPCSTR  str)
inlinestatic

Definition at line 73 of file path.c.

74{
75 WCHAR *ret = NULL;
76
77 if (str)
78 {
80 ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
81 if (ret)
83 }
84
85 return ret;
86}
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define MultiByteToWideChar
Definition: compat.h:110
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str
int ret
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by PathUnExpandEnvStringsA().

◆ init_envvars_map()

static void init_envvars_map ( struct envvars_map map)
static

Definition at line 4165 of file path.c.

4166{
4167 while (map->var)
4168 {
4169 map->len = ExpandEnvironmentStringsW(map->var, map->path, sizeof(map->path)/sizeof(WCHAR));
4170 /* exclude null from length */
4171 if (map->len) map->len--;
4172 map++;
4173 }
4174}
Definition: _map.h:48
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519

Referenced by PathUnExpandEnvStringsW().

◆ PathAddBackslashA()

LPSTR WINAPI PathAddBackslashA ( LPSTR  lpszPath)

Definition at line 263 of file path.c.

264{
265 size_t iLen;
266 LPSTR prev = lpszPath;
267
268 TRACE("(%s)\n",debugstr_a(lpszPath));
269
270 if (!lpszPath || (iLen = strlen(lpszPath)) >= MAX_PATH)
271 return NULL;
272
273 if (iLen)
274 {
275 do {
276 lpszPath = CharNextA(prev);
277 if (*lpszPath)
278 prev = lpszPath;
279 } while (*lpszPath);
280 if (*prev != '\\')
281 {
282 *lpszPath++ = '\\';
283 *lpszPath = '\0';
284 }
285 }
286 return lpszPath;
287}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define MAX_PATH
Definition: compat.h:34
#define debugstr_a
Definition: kernel32.h:31
#define TRACE(s)
Definition: solgame.cpp:4
LPSTR WINAPI CharNextA(_In_ LPCSTR)
char * LPSTR
Definition: xmlstorage.h:182

◆ PathAddBackslashW()

LPWSTR WINAPI PathAddBackslashW ( LPWSTR  lpszPath)

Definition at line 294 of file path.c.

295{
296 size_t iLen;
297
298 TRACE("(%s)\n",debugstr_w(lpszPath));
299
300 if (!lpszPath || (iLen = strlenW(lpszPath)) >= MAX_PATH)
301 return NULL;
302
303 if (iLen)
304 {
305 lpszPath += iLen;
306 if (lpszPath[-1] != '\\')
307 {
308 *lpszPath++ = '\\';
309 *lpszPath = '\0';
310 }
311 }
312 return lpszPath;
313}
#define debugstr_w
Definition: kernel32.h:32
#define strlenW(s)
Definition: unicode.h:34

◆ PathAddExtensionA()

BOOL WINAPI PathAddExtensionA ( LPSTR  lpszPath,
LPCSTR  lpszExtension 
)

Definition at line 2621 of file path.c.

2622{
2623 size_t dwLen;
2624
2625 TRACE("(%s,%s)\n", debugstr_a(lpszPath), debugstr_a(lpszExtension));
2626
2627 if (!lpszPath || !lpszExtension || *(PathFindExtensionA(lpszPath)))
2628 return FALSE;
2629
2630 dwLen = strlen(lpszPath);
2631
2632 if (dwLen + strlen(lpszExtension) >= MAX_PATH)
2633 return FALSE;
2634
2635 strcpy(lpszPath + dwLen, lpszExtension);
2636 return TRUE;
2637}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LPSTR WINAPI PathFindExtensionA(LPCSTR lpszPath)
Definition: path.c:422
strcpy
Definition: string.h:131

◆ PathAddExtensionW()

BOOL WINAPI PathAddExtensionW ( LPWSTR  lpszPath,
LPCWSTR  lpszExtension 
)

Definition at line 2644 of file path.c.

2645{
2646 size_t dwLen;
2647
2648 TRACE("(%s,%s)\n", debugstr_w(lpszPath), debugstr_w(lpszExtension));
2649
2650 if (!lpszPath || !lpszExtension || *(PathFindExtensionW(lpszPath)))
2651 return FALSE;
2652
2653 dwLen = strlenW(lpszPath);
2654
2655 if (dwLen + strlenW(lpszExtension) >= MAX_PATH)
2656 return FALSE;
2657
2658 strcpyW(lpszPath + dwLen, lpszExtension);
2659 return TRUE;
2660}
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
#define strcpyW(d, s)
Definition: unicode.h:35

◆ PathAppendA()

BOOL WINAPI PathAppendA ( LPSTR  lpszPath,
LPCSTR  lpszAppend 
)

Definition at line 106 of file path.c.

107{
108 TRACE("(%s,%s)\n",debugstr_a(lpszPath), debugstr_a(lpszAppend));
109
110 if (lpszPath && lpszAppend)
111 {
112 if (!PathIsUNCA(lpszAppend))
113 while (*lpszAppend == '\\')
114 lpszAppend++;
115 if (PathCombineA(lpszPath, lpszPath, lpszAppend))
116 return TRUE;
117 }
118 return FALSE;
119}
BOOL WINAPI PathIsUNCA(LPCSTR lpszPath)
Definition: path.c:2249
#define PathCombineA
Definition: pathcch.h:316

◆ PathAppendW()

BOOL WINAPI PathAppendW ( LPWSTR  lpszPath,
LPCWSTR  lpszAppend 
)

Definition at line 126 of file path.c.

127{
128 TRACE("(%s,%s)\n",debugstr_w(lpszPath), debugstr_w(lpszAppend));
129
130 if (lpszPath && lpszAppend)
131 {
132 if (!PathIsUNCW(lpszAppend))
133 while (*lpszAppend == '\\')
134 lpszAppend++;
135 if (PathCombineW(lpszPath, lpszPath, lpszAppend))
136 return TRUE;
137 }
138 return FALSE;
139}
BOOL WINAPI PathIsUNCW(LPCWSTR lpszPath)
Definition: path.c:2272
#define PathCombineW
Definition: pathcch.h:317

◆ PathBuildRootA()

LPSTR WINAPI PathBuildRootA ( LPSTR  lpszPath,
int  drive 
)

Definition at line 329 of file path.c.

330{
331 TRACE("(%p,%d)\n", lpszPath, drive);
332
333 if (lpszPath && drive >= 0 && drive < 26)
334 {
335 lpszPath[0] = 'A' + drive;
336 lpszPath[1] = ':';
337 lpszPath[2] = '\\';
338 lpszPath[3] = '\0';
339 }
340 return lpszPath;
341}

Referenced by ATL::CPathT< StringType >::PathBuildRootX(), and test_PathBuildRootA().

◆ PathBuildRootW()

LPWSTR WINAPI PathBuildRootW ( LPWSTR  lpszPath,
int  drive 
)

Definition at line 348 of file path.c.

349{
350 TRACE("(%p,%d)\n", lpszPath, drive);
351
352 if (lpszPath && drive >= 0 && drive < 26)
353 {
354 lpszPath[0] = 'A' + drive;
355 lpszPath[1] = ':';
356 lpszPath[2] = '\\';
357 lpszPath[3] = '\0';
358 }
359 return lpszPath;
360}

Referenced by IsLFNDriveW(), CDesktopBrowser::OnDeviceChange(), CDrivesFolder::ParseDisplayName(), ATL::CPathT< StringType >::PathBuildRootX(), and PathQualifyExW().

◆ PathCanonicalizeA()

BOOL WINAPI PathCanonicalizeA ( LPSTR  lpszBuf,
LPCSTR  lpszPath 
)

Definition at line 2419 of file path.c.

2420{
2421 BOOL bRet = FALSE;
2422
2423 TRACE("(%p,%s)\n", lpszBuf, debugstr_a(lpszPath));
2424
2425 if (lpszBuf)
2426 *lpszBuf = '\0';
2427
2428 if (!lpszBuf || !lpszPath)
2430 else
2431 {
2433 WCHAR szBuff[MAX_PATH];
2434 int ret = MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
2435
2436 if (!ret) {
2437 WARN("Failed to convert string to widechar (too long?), LE %d.\n", GetLastError());
2438 return FALSE;
2439 }
2440 bRet = PathCanonicalizeW(szBuff, szPath);
2441 WideCharToMultiByte(CP_ACP,0,szBuff,-1,lpszBuf,MAX_PATH,0,0);
2442 }
2443 return bRet;
2444}
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define WideCharToMultiByte
Definition: compat.h:111
unsigned int BOOL
Definition: ntddk_ex.h:94
LPCWSTR szPath
Definition: env.c:37
#define PathCanonicalizeW
Definition: pathcch.h:313
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ PathCanonicalizeW()

BOOL WINAPI PathCanonicalizeW ( LPWSTR  lpszBuf,
LPCWSTR  lpszPath 
)

Definition at line 2452 of file path.c.

2453{
2454 LPWSTR lpszDst = lpszBuf;
2455 LPCWSTR lpszSrc = lpszPath;
2456
2457 TRACE("(%p,%s)\n", lpszBuf, debugstr_w(lpszPath));
2458
2459 if (lpszBuf)
2460 *lpszDst = '\0';
2461
2462 if (!lpszBuf || !lpszPath)
2463 {
2465 return FALSE;
2466 }
2467
2468 if (!*lpszPath)
2469 {
2470 *lpszBuf++ = '\\';
2471 *lpszBuf = '\0';
2472 return TRUE;
2473 }
2474
2475 /* Copy path root */
2476 if (*lpszSrc == '\\')
2477 {
2478 *lpszDst++ = *lpszSrc++;
2479 }
2480 else if (*lpszSrc && lpszSrc[1] == ':')
2481 {
2482 /* X:\ */
2483 *lpszDst++ = *lpszSrc++;
2484 *lpszDst++ = *lpszSrc++;
2485 if (*lpszSrc == '\\')
2486 *lpszDst++ = *lpszSrc++;
2487 }
2488
2489 /* Canonicalize the rest of the path */
2490 while (*lpszSrc)
2491 {
2492 if (*lpszSrc == '.')
2493 {
2494 if (lpszSrc[1] == '\\' && (lpszSrc == lpszPath || lpszSrc[-1] == '\\' || lpszSrc[-1] == ':'))
2495 {
2496 lpszSrc += 2; /* Skip .\ */
2497 }
2498 else if (lpszSrc[1] == '.' && (lpszDst == lpszBuf || lpszDst[-1] == '\\'))
2499 {
2500 /* \.. backs up a directory, over the root if it has no \ following X:.
2501 * .. is ignored if it would remove a UNC server name or initial \\
2502 */
2503 if (lpszDst != lpszBuf)
2504 {
2505 *lpszDst = '\0'; /* Allow PathIsUNCServerShareA test on lpszBuf */
2506 if (lpszDst > lpszBuf+1 && lpszDst[-1] == '\\' &&
2507 (lpszDst[-2] != '\\' || lpszDst > lpszBuf+2))
2508 {
2509 if (lpszDst[-2] == ':' && (lpszDst > lpszBuf+3 || lpszDst[-3] == ':'))
2510 {
2511 lpszDst -= 2;
2512 while (lpszDst > lpszBuf && *lpszDst != '\\')
2513 lpszDst--;
2514 if (*lpszDst == '\\')
2515 lpszDst++; /* Reset to last '\' */
2516 else
2517 lpszDst = lpszBuf; /* Start path again from new root */
2518 }
2519 else if (lpszDst[-2] != ':' && !PathIsUNCServerShareW(lpszBuf))
2520 lpszDst -= 2;
2521 }
2522 while (lpszDst > lpszBuf && *lpszDst != '\\')
2523 lpszDst--;
2524 if (lpszDst == lpszBuf)
2525 {
2526 *lpszDst++ = '\\';
2527 lpszSrc++;
2528 }
2529 }
2530 lpszSrc += 2; /* Skip .. in src path */
2531 }
2532 else
2533 *lpszDst++ = *lpszSrc++;
2534 }
2535 else
2536 *lpszDst++ = *lpszSrc++;
2537 }
2538 /* Append \ to naked drive specs */
2539 if (lpszDst - lpszBuf == 2 && lpszDst[-1] == ':')
2540 *lpszDst++ = '\\';
2541 *lpszDst++ = '\0';
2542 return TRUE;
2543}
BOOL WINAPI PathIsUNCServerShareW(LPCWSTR lpszPath)
Definition: path.c:2384
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ PathCombineA()

LPSTR WINAPI PathCombineA ( LPSTR  lpszDest,
LPCSTR  lpszDir,
LPCSTR  lpszFile 
)

Definition at line 159 of file path.c.

160{
161 WCHAR szDest[MAX_PATH];
162 WCHAR szDir[MAX_PATH];
163 WCHAR szFile[MAX_PATH];
164 TRACE("(%p,%s,%s)\n", lpszDest, debugstr_a(lpszDir), debugstr_a(lpszFile));
165
166 /* Invalid parameters */
167 if (!lpszDest)
168 return NULL;
169 if (!lpszDir && !lpszFile)
170 goto fail;
171
172 if (lpszDir)
173 if (!MultiByteToWideChar(CP_ACP,0,lpszDir,-1,szDir,MAX_PATH))
174 goto fail;
175
176 if (lpszFile)
177 if (!MultiByteToWideChar(CP_ACP,0,lpszFile,-1,szFile,MAX_PATH))
178 goto fail;
179
180 if (PathCombineW(szDest, lpszDir ? szDir : NULL, lpszFile ? szFile : NULL))
181 if (WideCharToMultiByte(CP_ACP,0,szDest,-1,lpszDest,MAX_PATH,0,0))
182 return lpszDest;
183
184fail:
185 lpszDest[0] = 0;
186 return NULL;
187}
WCHAR lpszDest[260]

◆ PathCombineW()

LPWSTR WINAPI PathCombineW ( LPWSTR  lpszDest,
LPCWSTR  lpszDir,
LPCWSTR  lpszFile 
)

Definition at line 194 of file path.c.

195{
196 WCHAR szTemp[MAX_PATH];
197 BOOL bUseBoth = FALSE, bStrip = FALSE;
198
199 TRACE("(%p,%s,%s)\n", lpszDest, debugstr_w(lpszDir), debugstr_w(lpszFile));
200
201 /* Invalid parameters */
202 if (!lpszDest)
203 return NULL;
204 if (!lpszDir && !lpszFile)
205 {
206 lpszDest[0] = 0;
207 return NULL;
208 }
209
210 if ((!lpszFile || !*lpszFile) && lpszDir)
211 {
212 /* Use dir only */
213 lstrcpynW(szTemp, lpszDir, MAX_PATH);
214 }
215 else if (!lpszDir || !*lpszDir || !PathIsRelativeW(lpszFile))
216 {
217 if (!lpszDir || !*lpszDir || *lpszFile != '\\' || PathIsUNCW(lpszFile))
218 {
219 /* Use file only */
220 lstrcpynW(szTemp, lpszFile, MAX_PATH);
221 }
222 else
223 {
224 bUseBoth = TRUE;
225 bStrip = TRUE;
226 }
227 }
228 else
229 bUseBoth = TRUE;
230
231 if (bUseBoth)
232 {
233 lstrcpynW(szTemp, lpszDir, MAX_PATH);
234 if (bStrip)
235 {
236 PathStripToRootW(szTemp);
237 lpszFile++; /* Skip '\' */
238 }
239 if (!PathAddBackslashW(szTemp) || strlenW(szTemp) + strlenW(lpszFile) >= MAX_PATH)
240 {
241 lpszDest[0] = 0;
242 return NULL;
243 }
244 strcatW(szTemp, lpszFile);
245 }
246
248 return lpszDest;
249}
#define lstrcpynW
Definition: compat.h:738
BOOL WINAPI PathStripToRootW(LPWSTR lpszPath)
Definition: path.c:733
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1585
#define PathAddBackslashW
Definition: pathcch.h:301
#define strcatW(d, s)
Definition: unicode.h:36

◆ PathCommonPrefixA()

int WINAPI PathCommonPrefixA ( LPCSTR  lpszFile1,
LPCSTR  lpszFile2,
LPSTR  achPath 
)

Definition at line 2757 of file path.c.

2758{
2759 size_t iLen = 0;
2760 LPCSTR lpszIter1 = lpszFile1;
2761 LPCSTR lpszIter2 = lpszFile2;
2762
2763 TRACE("(%s,%s,%p)\n", debugstr_a(lpszFile1), debugstr_a(lpszFile2), achPath);
2764
2765 if (achPath)
2766 *achPath = '\0';
2767
2768 if (!lpszFile1 || !lpszFile2)
2769 return 0;
2770
2771 /* Handle roots first */
2772 if (PathIsUNCA(lpszFile1))
2773 {
2774 if (!PathIsUNCA(lpszFile2))
2775 return 0;
2776 lpszIter1 += 2;
2777 lpszIter2 += 2;
2778 }
2779 else if (PathIsUNCA(lpszFile2))
2780 return 0; /* Know already lpszFile1 is not UNC */
2781
2782 do
2783 {
2784 /* Update len */
2785 if ((!*lpszIter1 || *lpszIter1 == '\\') &&
2786 (!*lpszIter2 || *lpszIter2 == '\\'))
2787 iLen = lpszIter1 - lpszFile1; /* Common to this point */
2788
2789 if (!*lpszIter1 || (tolower(*lpszIter1) != tolower(*lpszIter2)))
2790 break; /* Strings differ at this point */
2791
2792 lpszIter1++;
2793 lpszIter2++;
2794 } while (1);
2795
2796 if (iLen == 2)
2797 iLen++; /* Feature/Bug compatible with Win32 */
2798
2799 if (iLen && achPath)
2800 {
2801 memcpy(achPath,lpszFile1,iLen);
2802 achPath[iLen] = '\0';
2803 }
2804 return iLen;
2805}
int tolower(int c)
Definition: utclib.c:902
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by ATL::CPathT< StringType >::PathCommonPrefixX(), PathIsPrefixA(), PathIsSameRootA(), and test_PathCommonPrefixA().

◆ PathCommonPrefixW()

int WINAPI PathCommonPrefixW ( LPCWSTR  lpszFile1,
LPCWSTR  lpszFile2,
LPWSTR  achPath 
)

Definition at line 2812 of file path.c.

2813{
2814 size_t iLen = 0;
2815 LPCWSTR lpszIter1 = lpszFile1;
2816 LPCWSTR lpszIter2 = lpszFile2;
2817
2818 TRACE("(%s,%s,%p)\n", debugstr_w(lpszFile1), debugstr_w(lpszFile2), achPath);
2819
2820 if (achPath)
2821 *achPath = '\0';
2822
2823 if (!lpszFile1 || !lpszFile2)
2824 return 0;
2825
2826 /* Handle roots first */
2827 if (PathIsUNCW(lpszFile1))
2828 {
2829 if (!PathIsUNCW(lpszFile2))
2830 return 0;
2831 lpszIter1 += 2;
2832 lpszIter2 += 2;
2833 }
2834 else if (PathIsUNCW(lpszFile2))
2835 return 0; /* Know already lpszFile1 is not UNC */
2836
2837 do
2838 {
2839 /* Update len */
2840 if ((!*lpszIter1 || *lpszIter1 == '\\') &&
2841 (!*lpszIter2 || *lpszIter2 == '\\'))
2842 iLen = lpszIter1 - lpszFile1; /* Common to this point */
2843
2844 if (!*lpszIter1 || (tolowerW(*lpszIter1) != tolowerW(*lpszIter2)))
2845 break; /* Strings differ at this point */
2846
2847 lpszIter1++;
2848 lpszIter2++;
2849 } while (1);
2850
2851 if (iLen == 2)
2852 iLen++; /* Feature/Bug compatible with Win32 */
2853
2854 if (iLen && achPath)
2855 {
2856 memcpy(achPath,lpszFile1,iLen * sizeof(WCHAR));
2857 achPath[iLen] = '\0';
2858 }
2859 return iLen;
2860}
#define tolowerW(n)
Definition: unicode.h:50

Referenced by DynamicPathCommonPrefixW(), ATL::CPathT< StringType >::PathCommonPrefixX(), PathIsPrefixW(), PathIsSameRootW(), and PathRelativePathToW().

◆ PathCompactPathA()

BOOL WINAPI PathCompactPathA ( HDC  hDC,
LPSTR  lpszPath,
UINT  dx 
)

Definition at line 2876 of file path.c.

2877{
2878 BOOL bRet = FALSE;
2879
2880 TRACE("(%p,%s,%d)\n", hDC, debugstr_a(lpszPath), dx);
2881
2882 if (lpszPath)
2883 {
2886 bRet = PathCompactPathW(hDC, szPath, dx);
2887 WideCharToMultiByte(CP_ACP,0,szPath,-1,lpszPath,MAX_PATH,0,0);
2888 }
2889 return bRet;
2890}
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR lpszPath, UINT dx)
Definition: path.c:2897
GLint dx
Definition: linetemp.h:97

Referenced by ATL::CPathT< StringType >::PathCompactPathX().

◆ PathCompactPathExA()

BOOL WINAPI PathCompactPathExA ( LPSTR  lpszDest,
LPCSTR  lpszPath,
UINT  cchMax,
DWORD  dwFlags 
)

Definition at line 1441 of file path.c.

1443{
1444 BOOL bRet = FALSE;
1445
1446 TRACE("(%p,%s,%d,0x%08x)\n", lpszDest, debugstr_a(lpszPath), cchMax, dwFlags);
1447
1448 if (lpszPath && lpszDest)
1449 {
1451 WCHAR szDest[MAX_PATH];
1452
1454 szDest[0] = '\0';
1455 bRet = PathCompactPathExW(szDest, szPath, cchMax, dwFlags);
1457 }
1458 return bRet;
1459}
UINT cchMax
BOOL WINAPI PathCompactPathExW(LPWSTR lpszDest, LPCWSTR lpszPath, UINT cchMax, DWORD dwFlags)
Definition: path.c:1466
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by ATL::CPathT< StringType >::PathCompactPathExX().

◆ PathCompactPathExW()

BOOL WINAPI PathCompactPathExW ( LPWSTR  lpszDest,
LPCWSTR  lpszPath,
UINT  cchMax,
DWORD  dwFlags 
)

Definition at line 1466 of file path.c.

1468{
1469 static const WCHAR szEllipses[] = { '.', '.', '.', '\0' };
1470 LPCWSTR lpszFile;
1471 DWORD dwLen, dwFileLen = 0;
1472
1473 TRACE("(%p,%s,%d,0x%08x)\n", lpszDest, debugstr_w(lpszPath), cchMax, dwFlags);
1474
1475 if (!lpszPath)
1476 return FALSE;
1477
1478 if (!lpszDest)
1479 {
1480 WARN("Invalid lpszDest would crash under Win32!\n");
1481 return FALSE;
1482 }
1483
1484 *lpszDest = '\0';
1485
1486 if (cchMax < 2)
1487 return TRUE;
1488
1489 dwLen = strlenW(lpszPath) + 1;
1490
1491 if (dwLen < cchMax)
1492 {
1493 /* Don't need to compact */
1494 memcpy(lpszDest, lpszPath, dwLen * sizeof(WCHAR));
1495 return TRUE;
1496 }
1497
1498 /* Path must be compacted to fit into lpszDest */
1499 lpszFile = PathFindFileNameW(lpszPath);
1500 dwFileLen = lpszPath + dwLen - lpszFile;
1501
1502 if (dwFileLen == dwLen)
1503 {
1504 /* No root in psth */
1505 if (cchMax <= 4)
1506 {
1507 while (--cchMax > 0) /* No room left for anything but ellipses */
1508 *lpszDest++ = '.';
1509 *lpszDest = '\0';
1510 return TRUE;
1511 }
1512 /* Compact the file name with ellipses at the end */
1513 cchMax -= 4;
1514 memcpy(lpszDest, lpszFile, cchMax * sizeof(WCHAR));
1515 strcpyW(lpszDest + cchMax, szEllipses);
1516 return TRUE;
1517 }
1518 /* We have a root in the path */
1519 lpszFile--; /* Start compacted filename with the path separator */
1520 dwFileLen++;
1521
1522 if (dwFileLen + 3 > cchMax)
1523 {
1524 /* Compact the file name */
1525 if (cchMax <= 4)
1526 {
1527 while (--cchMax > 0) /* No room left for anything but ellipses */
1528 *lpszDest++ = '.';
1529 *lpszDest = '\0';
1530 return TRUE;
1531 }
1532 strcpyW(lpszDest, szEllipses);
1533 lpszDest += 3;
1534 cchMax -= 4;
1535 *lpszDest++ = *lpszFile++;
1536 if (cchMax <= 4)
1537 {
1538 while (--cchMax > 0) /* No room left for anything but ellipses */
1539 *lpszDest++ = '.';
1540 *lpszDest = '\0';
1541 return TRUE;
1542 }
1543 cchMax -= 4;
1544 memcpy(lpszDest, lpszFile, cchMax * sizeof(WCHAR));
1545 strcpyW(lpszDest + cchMax, szEllipses);
1546 return TRUE;
1547 }
1548
1549 /* Only the root needs to be Compacted */
1550 dwLen = cchMax - dwFileLen - 3;
1551 memcpy(lpszDest, lpszPath, dwLen * sizeof(WCHAR));
1552 strcpyW(lpszDest + dwLen, szEllipses);
1553 strcpyW(lpszDest + dwLen + 3, lpszFile);
1554 return TRUE;
1555}
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394

Referenced by PathCompactPathExA(), and ATL::CPathT< StringType >::PathCompactPathExX().

◆ PathCompactPathW()

BOOL WINAPI PathCompactPathW ( HDC  hDC,
LPWSTR  lpszPath,
UINT  dx 
)

Definition at line 2897 of file path.c.

2898{
2899 static const WCHAR szEllipses[] = { '.', '.', '.', '\0' };
2900 BOOL bRet = TRUE;
2901 HDC hdc = 0;
2903 SIZE size;
2904 DWORD dwLen;
2905
2906 TRACE("(%p,%s,%d)\n", hDC, debugstr_w(lpszPath), dx);
2907
2908 if (!lpszPath)
2909 return FALSE;
2910
2911 if (!hDC)
2912 hdc = hDC = GetDC(0);
2913
2914 /* Get the length of the whole path */
2915 dwLen = strlenW(lpszPath);
2916 GetTextExtentPointW(hDC, lpszPath, dwLen, &size);
2917
2918 if ((UINT)size.cx > dx)
2919 {
2920 /* Path too big, must reduce it */
2921 LPWSTR sFile;
2922 DWORD dwEllipsesLen = 0, dwPathLen = 0;
2923
2924 sFile = PathFindFileNameW(lpszPath);
2925 if (sFile != lpszPath) sFile--;
2926
2927 /* Get the size of ellipses */
2928 GetTextExtentPointW(hDC, szEllipses, 3, &size);
2929 dwEllipsesLen = size.cx;
2930 /* Get the size of the file name */
2931 GetTextExtentPointW(hDC, sFile, strlenW(sFile), &size);
2932 dwPathLen = size.cx;
2933
2934 if (sFile != lpszPath)
2935 {
2936 LPWSTR sPath = sFile;
2937 BOOL bEllipses = FALSE;
2938
2939 /* The path includes a file name. Include as much of the path prior to
2940 * the file name as possible, allowing for the ellipses, e.g:
2941 * c:\some very long path\filename ==> c:\some v...\filename
2942 */
2943 lstrcpynW(buff, sFile, MAX_PATH);
2944
2945 do
2946 {
2947 DWORD dwTotalLen = bEllipses? dwPathLen + dwEllipsesLen : dwPathLen;
2948
2949 GetTextExtentPointW(hDC, lpszPath, sPath - lpszPath, &size);
2950 dwTotalLen += size.cx;
2951 if (dwTotalLen <= dx)
2952 break;
2953 sPath--;
2954 if (!bEllipses)
2955 {
2956 bEllipses = TRUE;
2957 sPath -= 2;
2958 }
2959 } while (sPath > lpszPath);
2960
2961 if (sPath > lpszPath)
2962 {
2963 if (bEllipses)
2964 {
2965 strcpyW(sPath, szEllipses);
2966 strcpyW(sPath+3, buff);
2967 }
2968 bRet = TRUE;
2969 goto end;
2970 }
2971 strcpyW(lpszPath, szEllipses);
2972 strcpyW(lpszPath+3, buff);
2973 bRet = FALSE;
2974 goto end;
2975 }
2976
2977 /* Trim the path by adding ellipses to the end, e.g:
2978 * A very long file name.txt ==> A very...
2979 */
2980 dwLen = strlenW(lpszPath);
2981
2982 if (dwLen > MAX_PATH - 3)
2983 dwLen = MAX_PATH - 3;
2984 lstrcpynW(buff, sFile, dwLen);
2985
2986 do {
2987 dwLen--;
2988 GetTextExtentPointW(hDC, buff, dwLen, &size);
2989 } while (dwLen && size.cx + dwEllipsesLen > dx);
2990
2991 if (!dwLen)
2992 {
2993 DWORD dwWritten = 0;
2994
2995 dwEllipsesLen /= 3; /* Size of a single '.' */
2996
2997 /* Write as much of the Ellipses string as possible */
2998 while (dwWritten + dwEllipsesLen < dx && dwLen < 3)
2999 {
3000 *lpszPath++ = '.';
3001 dwWritten += dwEllipsesLen;
3002 dwLen++;
3003 }
3004 *lpszPath = '\0';
3005 bRet = FALSE;
3006 }
3007 else
3008 {
3009 strcpyW(buff + dwLen, szEllipses);
3010 strcpyW(lpszPath, buff);
3011 }
3012 }
3013
3014end:
3015 if (hdc)
3016 ReleaseDC(0, hdc);
3017
3018 return bRet;
3019}
static unsigned char buff[32768]
Definition: fatten.c:17
GLuint GLuint end
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by CZipExtract::CCompleteSettingsPage::OnSetActive(), PathCompactPathA(), ATL::CPathT< StringType >::PathCompactPathX(), and PathSetDlgItemPathW().

◆ PathCreateFromUrlA()

HRESULT WINAPI PathCreateFromUrlA ( LPCSTR  pszUrl,
LPSTR  pszPath,
LPDWORD  pcchPath,
DWORD  dwReserved 
)

Definition at line 3312 of file path.c.

3314{
3315 WCHAR bufW[MAX_PATH];
3316 WCHAR *pathW = bufW;
3317 UNICODE_STRING urlW;
3318 HRESULT ret;
3319 DWORD lenW = sizeof(bufW)/sizeof(WCHAR), lenA;
3320
3321 if (!pszUrl || !pszPath || !pcchPath || !*pcchPath)
3322 return E_INVALIDARG;
3323
3324 if(!RtlCreateUnicodeStringFromAsciiz(&urlW, pszUrl))
3325 return E_INVALIDARG;
3326 if((ret = PathCreateFromUrlW(urlW.Buffer, pathW, &lenW, dwReserved)) == E_POINTER) {
3327 pathW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
3328 ret = PathCreateFromUrlW(urlW.Buffer, pathW, &lenW, dwReserved);
3329 }
3330 if(ret == S_OK) {
3331 RtlUnicodeToMultiByteSize(&lenA, pathW, lenW * sizeof(WCHAR));
3332 if(*pcchPath > lenA) {
3333 RtlUnicodeToMultiByteN(pszPath, *pcchPath - 1, &lenA, pathW, lenW * sizeof(WCHAR));
3334 pszPath[lenA] = 0;
3335 *pcchPath = lenA;
3336 } else {
3337 *pcchPath = lenA + 1;
3338 ret = E_POINTER;
3339 }
3340 }
3341 if(pathW != bufW) HeapFree(GetProcessHeap(), 0, pathW);
3342 RtlFreeUnicodeString(&urlW);
3343 return ret;
3344}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define HeapFree(x, y, z)
Definition: compat.h:735
HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwReserved)
Definition: path.c:3361
#define S_OK
Definition: intsafe.h:52
static LPWSTR PDWORD pcchPath
Definition: asmcache.c:747
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteN(_Out_ PCHAR MbString, _In_ ULONG MbSize, _Out_opt_ PULONG ResultSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
Definition: nlsboot.c:107
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteSize(_Out_ PULONG MbSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
Definition: nlsboot.c:145
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define E_POINTER
Definition: winerror.h:2365

Referenced by FileProtocolHandlerA().

◆ PathCreateFromUrlAlloc()

HRESULT WINAPI PathCreateFromUrlAlloc ( LPCWSTR  pszUrl,
LPWSTR pszPath,
DWORD  dwReserved 
)

Definition at line 3503 of file path.c.

3505{
3506 WCHAR pathW[MAX_PATH];
3507 DWORD size;
3508 HRESULT hr;
3509
3510 size = MAX_PATH;
3511 hr = PathCreateFromUrlW(pszUrl, pathW, &size, dwReserved);
3512 if (SUCCEEDED(hr))
3513 {
3514 /* Yes, this is supposed to crash if pszPath is NULL */
3515 *pszPath = StrDupW(pathW);
3516 }
3517 return hr;
3518}
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1093
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hr
Definition: shlfolder.c:183

◆ PathCreateFromUrlW()

HRESULT WINAPI PathCreateFromUrlW ( LPCWSTR  pszUrl,
LPWSTR  pszPath,
LPDWORD  pcchPath,
DWORD  dwReserved 
)

Definition at line 3361 of file path.c.

3363{
3364 static const WCHAR file_colon[] = { 'f','i','l','e',':',0 };
3365 static const WCHAR localhost[] = { 'l','o','c','a','l','h','o','s','t',0 };
3366 DWORD nslashes, unescape, len;
3367 const WCHAR *src;
3368 WCHAR *tpath, *dst;
3369 HRESULT ret;
3370
3371 TRACE("(%s,%p,%p,0x%08x)\n", debugstr_w(pszUrl), pszPath, pcchPath, dwReserved);
3372
3373 if (!pszUrl || !pszPath || !pcchPath || !*pcchPath)
3374 return E_INVALIDARG;
3375
3376 if (lstrlenW(pszUrl) < 5)
3377 return E_INVALIDARG;
3378
3380 file_colon, 5) != CSTR_EQUAL)
3381 return E_INVALIDARG;
3382 pszUrl += 5;
3383 ret = S_OK;
3384
3385 src = pszUrl;
3386 nslashes = 0;
3387 while (*src == '/' || *src == '\\') {
3388 nslashes++;
3389 src++;
3390 }
3391
3392 /* We need a temporary buffer so we can compute what size to ask for.
3393 * We know that the final string won't be longer than the current pszUrl
3394 * plus at most two backslashes. All the other transformations make it
3395 * shorter.
3396 */
3397 len = 2 + lstrlenW(pszUrl) + 1;
3398 if (*pcchPath < len)
3399 tpath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
3400 else
3401 tpath = pszPath;
3402
3403 len = 0;
3404 dst = tpath;
3405 unescape = 1;
3406 switch (nslashes)
3407 {
3408 case 0:
3409 /* 'file:' + escaped DOS path */
3410 break;
3411 case 1:
3412 /* 'file:/' + escaped DOS path */
3413 /* fall through */
3414 case 3:
3415 /* 'file:///' (implied localhost) + escaped DOS path */
3416 if (!isalphaW(*src) || (src[1] != ':' && src[1] != '|'))
3417 src -= 1;
3418 break;
3419 case 2:
3421 src, 9, localhost, 9) == CSTR_EQUAL && (src[9] == '/' || src[9] == '\\'))
3422 {
3423 /* 'file://localhost/' + escaped DOS path */
3424 src += 10;
3425 }
3426 else if (isalphaW(*src) && (src[1] == ':' || src[1] == '|'))
3427 {
3428 /* 'file://' + unescaped DOS path */
3429 unescape = 0;
3430 }
3431 else
3432 {
3433 /* 'file://hostname:port/path' (where path is escaped)
3434 * or 'file:' + escaped UNC path (\\server\share\path)
3435 * The second form is clearly specific to Windows and it might
3436 * even be doing a network lookup to try to figure it out.
3437 */
3438 while (*src && *src != '/' && *src != '\\')
3439 src++;
3440 len = src - pszUrl;
3441 StrCpyNW(dst, pszUrl, len + 1);
3442 dst += len;
3443 if (*src && isalphaW(src[1]) && (src[2] == ':' || src[2] == '|'))
3444 {
3445 /* 'Forget' to add a trailing '/', just like Windows */
3446 src++;
3447 }
3448 }
3449 break;
3450 case 4:
3451 /* 'file://' + unescaped UNC path (\\server\share\path) */
3452 unescape = 0;
3453 if (isalphaW(*src) && (src[1] == ':' || src[1] == '|'))
3454 break;
3455 /* fall through */
3456 default:
3457 /* 'file:/...' + escaped UNC path (\\server\share\path) */
3458 src -= 2;
3459 }
3460
3461 /* Copy the remainder of the path */
3462 len += lstrlenW(src);
3463 StrCpyW(dst, src);
3464
3465 /* First do the Windows-specific path conversions */
3466 for (dst = tpath; *dst; dst++)
3467 if (*dst == '/') *dst = '\\';
3468 if (isalphaW(*tpath) && tpath[1] == '|')
3469 tpath[1] = ':'; /* c| -> c: */
3470
3471 /* And only then unescape the path (i.e. escaped slashes are left as is) */
3472 if (unescape)
3473 {
3475 if (ret == S_OK)
3476 {
3477 /* When working in-place UrlUnescapeW() does not set len */
3478 len = lstrlenW(tpath);
3479 }
3480 }
3481
3482 if (*pcchPath < len + 1)
3483 {
3484 ret = E_POINTER;
3485 *pcchPath = len + 1;
3486 }
3487 else
3488 {
3489 *pcchPath = len;
3490 if (tpath != pszPath)
3491 StrCpyW(pszPath, tpath);
3492 }
3493 if (tpath != pszPath)
3494 HeapFree(GetProcessHeap(), 0, tpath);
3495
3496 TRACE("Returning (%u) %s\n", *pcchPath, debugstr_w(pszPath));
3497 return ret;
3498}
#define lstrlenW
Definition: compat.h:750
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
Definition: locale.c:4014
LPWSTR WINAPI StrCpyNW(LPWSTR dst, LPCWSTR src, int count)
Definition: string.c:536
LPWSTR WINAPI StrCpyW(LPWSTR lpszStr, LPCWSTR lpszSrc)
Definition: string.c:514
HRESULT WINAPI UrlUnescapeW(LPWSTR pszUrl, LPWSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags)
Definition: url.c:1367
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
BOOL unescape(WCHAR *str, size_t *len)
Definition: lex.c:227
static const BYTE localhost[]
Definition: encode.c:1442
#define LOCALE_INVARIANT
#define isalphaW(n)
Definition: unicode.h:54
#define URL_UNESCAPE_INPLACE
Definition: shlwapi.h:1259
#define NORM_IGNORECASE
Definition: winnls.h:178
#define CSTR_EQUAL
Definition: winnls.h:458

Referenced by CDesktopFolder::_ParseDisplayNameByParent(), DocObjectService_FireBeforeNavigate2(), InternetCrackUrlW(), on_before_navigate2(), parse_path_from_url(), PathCreateFromUrlA(), PathCreateFromUrlAlloc(), CDownloadManager::PerformDownloadAndInstall(), and SHELL_execute().

◆ PathFileExistsA()

BOOL WINAPI PathFileExistsA ( LPCSTR  lpszPath)

Definition at line 1761 of file path.c.

1762{
1763 UINT iPrevErrMode;
1764 DWORD dwAttr;
1765
1766 TRACE("(%s)\n",debugstr_a(lpszPath));
1767
1768 if (!lpszPath)
1769 return FALSE;
1770
1771 /* Prevent a dialog box if path is on a disk that has been ejected. */
1772 iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS);
1773 dwAttr = GetFileAttributesA(lpszPath);
1774 SetErrorMode(iPrevErrMode);
1775 return dwAttr != INVALID_FILE_ATTRIBUTES;
1776}
UINT WINAPI SetErrorMode(IN UINT uMode)
Definition: except.c:751
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
#define SEM_FAILCRITICALERRORS
Definition: rtltypes.h:69
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

Referenced by DoTestEntry(), PathFileExistsAW(), ATL::CPathT< StringType >::PathFileExistsX(), and START_TEST().

◆ PathFileExistsAndAttributesA()

BOOL WINAPI PathFileExistsAndAttributesA ( LPCSTR  lpszPath,
DWORD dwAttr 
)

Definition at line 1812 of file path.c.

1813{
1814 UINT iPrevErrMode;
1815 DWORD dwVal = 0;
1816
1817 TRACE("(%s %p)\n", debugstr_a(lpszPath), dwAttr);
1818
1819 if (dwAttr)
1820 *dwAttr = INVALID_FILE_ATTRIBUTES;
1821
1822 if (!lpszPath)
1823 return FALSE;
1824
1825 iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS);
1826 dwVal = GetFileAttributesA(lpszPath);
1827 SetErrorMode(iPrevErrMode);
1828 if (dwAttr)
1829 *dwAttr = dwVal;
1830 return (dwVal != INVALID_FILE_ATTRIBUTES);
1831}

◆ PathFileExistsAndAttributesW()

BOOL WINAPI PathFileExistsAndAttributesW ( LPCWSTR  lpszPath,
DWORD dwAttr 
)

Definition at line 1838 of file path.c.

1839{
1840 UINT iPrevErrMode;
1841 DWORD dwVal;
1842
1843 TRACE("(%s %p)\n", debugstr_w(lpszPath), dwAttr);
1844
1845 if (!lpszPath)
1846 return FALSE;
1847
1848 iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS);
1849 dwVal = GetFileAttributesW(lpszPath);
1850 SetErrorMode(iPrevErrMode);
1851 if (dwAttr)
1852 *dwAttr = dwVal;
1853 return (dwVal != INVALID_FILE_ATTRIBUTES);
1854}
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652

Referenced by GetTypeDescriptionByPath(), PathFileExistsDefExtAndAttributesW(), and PathResolveW().

◆ PathFileExistsDefExtA()

BOOL WINAPI PathFileExistsDefExtA ( LPSTR  lpszPath,
DWORD  dwWhich 
)

Definition at line 1201 of file path.c.

1202{
1203 BOOL bRet = FALSE;
1204
1205 TRACE("(%s,%d)\n", debugstr_a(lpszPath), dwWhich);
1206
1207 if (lpszPath)
1208 {
1211 bRet = PathFileExistsDefExtW(szPath, dwWhich);
1212 if (bRet)
1213 WideCharToMultiByte(CP_ACP,0,szPath,-1,lpszPath,MAX_PATH,0,0);
1214 }
1215 return bRet;
1216}
BOOL WINAPI PathFileExistsDefExtW(LPWSTR lpszPath, DWORD dwWhich)
Definition: path.c:1123

◆ PathFileExistsDefExtW()

BOOL WINAPI PathFileExistsDefExtW ( LPWSTR  lpszPath,
DWORD  dwWhich 
)

Definition at line 1123 of file path.c.

1124{
1125 static const WCHAR pszExts[][5] = { { '.', 'p', 'i', 'f', 0},
1126 { '.', 'c', 'o', 'm', 0},
1127 { '.', 'e', 'x', 'e', 0},
1128 { '.', 'b', 'a', 't', 0},
1129 { '.', 'l', 'n', 'k', 0},
1130 { '.', 'c', 'm', 'd', 0},
1131 { 0, 0, 0, 0, 0} };
1132
1133 TRACE("(%s,%d)\n", debugstr_w(lpszPath), dwWhich);
1134
1135 if (!lpszPath || PathIsUNCServerW(lpszPath) || PathIsUNCServerShareW(lpszPath))
1136 return FALSE;
1137
1138 if (dwWhich)
1139 {
1140 LPCWSTR szExt = PathFindExtensionW(lpszPath);
1141#ifndef __REACTOS__
1142 if (!*szExt || dwWhich & 0x40)
1143#else
1144 if (!*szExt || dwWhich & WHICH_OPTIONAL)
1145#endif
1146 {
1147 size_t iChoose = 0;
1148 int iLen = lstrlenW(lpszPath);
1149 if (iLen > (MAX_PATH - 5))
1150 return FALSE;
1151#ifndef __REACTOS__
1152 while ( (dwWhich & 0x1) && pszExts[iChoose][0] )
1153#else
1154 while (pszExts[iChoose][0])
1155#endif
1156 {
1157#ifdef __REACTOS__
1158 if (dwWhich & 0x1)
1159 {
1161#endif
1162 lstrcpyW(lpszPath + iLen, pszExts[iChoose]);
1163 if (PathFileExistsW(lpszPath))
1164 return TRUE;
1165#ifdef __REACTOS__
1166 }
1167#endif
1168 iChoose++;
1169 dwWhich >>= 1;
1170 }
1171 *(lpszPath + iLen) = (WCHAR)'\0';
1172 return FALSE;
1173 }
1174 }
1175 return PathFileExistsW(lpszPath);
1176}
#define lstrcpyW
Definition: compat.h:749
BOOL WINAPI PathIsUNCServerW(LPCWSTR lpszPath)
Definition: path.c:2329
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1783
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define WHICH_OPTIONAL
#define GetFileAttributes
Definition: winbase.h:3840

Referenced by PathFileExistsDefExtA(), PathFileExistsDefExtAndAttributesW(), PathFindOnPathExA(), PathFindOnPathExW(), PathSearchOnExtensionsW(), and SHLWAPI_PathFindInOtherDirs().

◆ PathFileExistsW()

BOOL WINAPI PathFileExistsW ( LPCWSTR  lpszPath)

◆ PathFindExtensionA()

LPSTR WINAPI PathFindExtensionA ( LPCSTR  lpszPath)

Definition at line 422 of file path.c.

423{
424 LPCSTR lastpoint = NULL;
425
426 TRACE("(%s)\n", debugstr_a(lpszPath));
427
428 if (lpszPath)
429 {
430 while (*lpszPath)
431 {
432 if (*lpszPath == '\\' || *lpszPath==' ')
433 lastpoint = NULL;
434 else if (*lpszPath == '.')
435 lastpoint = lpszPath;
436 lpszPath = CharNextA(lpszPath);
437 }
438 }
439 return (LPSTR)(lastpoint ? lastpoint : lpszPath);
440}

Referenced by FD31_UpdateResult(), FILEDLG95_OnOpen(), PathAddExtensionA(), ATL::CPathT< StringType >::PathFindExtensionX(), PathGetExtensionA(), PathIsContentTypeA(), PathRemoveExtensionA(), PathRenameExtensionA(), PathUndecorateA(), and test_PathFindExtensionA().

◆ PathFindExtensionW()

LPWSTR WINAPI PathFindExtensionW ( LPCWSTR  lpszPath)

Definition at line 447 of file path.c.

448{
449 LPCWSTR lastpoint = NULL;
450
451 TRACE("(%s)\n", debugstr_w(lpszPath));
452
453 if (lpszPath)
454 {
455 while (*lpszPath)
456 {
457 if (*lpszPath == '\\' || *lpszPath==' ')
458 lastpoint = NULL;
459 else if (*lpszPath == '.')
460 lastpoint = lpszPath;
461 lpszPath++;
462 }
463 }
464 return (LPWSTR)(lastpoint ? lastpoint : lpszPath);
465}

Referenced by CFileSysEnum::_AddFindResult(), CFSDropTarget::_DoDrop(), _ILGetExtension(), add_favs_to_menu(), COpenWithList::AddAppToMRUList(), CFSFolder::CompareIDs(), CreateShortcut(), RecycleBin5::DeleteFile(), DoShellContextMenu(), CFontExt::Drop(), CDeskLinkDropHandler::Drop(), ExtensionFromPidl(), FD31_UpdateResult(), FileCompareWildTitle(), FILEDLG95_OnOpen(), FM_InitMenuPopup(), get_first_ext_from_spec(), GetAssocClass(), CMainWindow::GetSaveFileName(), GetTypeDescriptionByPath(), RecycleBin5File::Init(), CQueryAssociations::Init(), CLayerUIPropPage::InitFile(), CFileDefExt::InitFileType(), COpenWithMenu::Initialize(), CFileDefExt::InitOpensWithField(), COpenWithMenu::InvokeCommand(), COpenWithList::LoadRecommended(), OFNHookProc(), on_default_action(), CShellLink::OnNotify(), CDefView::OnNotify(), OpensWithExplorer(), PathAddExtensionW(), PathFileExistsDefExtAndAttributesW(), PathFileExistsDefExtW(), ATL::CPathT< StringType >::PathFindExtensionX(), PathGetExtensionW(), PathIsContentTypeW(), PathRemoveExtensionW(), PathRenameExtensionW(), PathSearchOnExtensionsW(), PathUndecorateW(), PathYetAnotherMakeUniqueName(), process_extensions(), BtrfsContextMenu::reflink_copy(), CImageDx::SaveDx(), CMainWindow::saveImage(), COpenWithList::SetDefaultHandler(), CFSFolder::SetNameOf(), SHAddToRecentDocs(), SHELL32_AssocGetFileDescription(), SHELL32_GetFSItemAttributes(), SHELL_FS_HideExtension(), ShellExecute_GetClassKey(), SHGetFileInfoW(), ShowCreateShortcutWizard(), test_properties(), try_find_new_name(), and URLDownloadToCacheFileW().

◆ PathFindFileNameA()

LPSTR WINAPI PathFindFileNameA ( LPCSTR  lpszPath)

Definition at line 373 of file path.c.

374{
375 LPCSTR lastSlash = lpszPath;
376
377 TRACE("(%s)\n",debugstr_a(lpszPath));
378
379 while (lpszPath && *lpszPath)
380 {
381 if ((*lpszPath == '\\' || *lpszPath == '/' || *lpszPath == ':') &&
382 lpszPath[1] && lpszPath[1] != '\\' && lpszPath[1] != '/')
383 lastSlash = lpszPath + 1;
384 lpszPath = CharNextA(lpszPath);
385 }
386 return (LPSTR)lastSlash;
387}

Referenced by FD31_UpdateResult(), FILEDLG95_OnOpen(), GetFileDialog95(), ATL::CPathT< StringType >::PathFindFileNameX(), and PathStripPathA().

◆ PathFindFileNameW()

LPWSTR WINAPI PathFindFileNameW ( LPCWSTR  lpszPath)

Definition at line 394 of file path.c.

395{
396 LPCWSTR lastSlash = lpszPath;
397
398 TRACE("(%s)\n",debugstr_w(lpszPath));
399
400 while (lpszPath && *lpszPath)
401 {
402 if ((*lpszPath == '\\' || *lpszPath == '/' || *lpszPath == ':') &&
403 lpszPath[1] && lpszPath[1] != '\\' && lpszPath[1] != '/')
404 lastSlash = lpszPath + 1;
405 lpszPath++;
406 }
407 return (LPWSTR)lastSlash;
408}

Referenced by _CZipAskPassword(), _CZipAskReplace(), CFSDropTarget::_DoDrop(), _ILCreate(), COpenWithList::Add(), CheckForError(), CFontExt::CompareIDs(), copy_file(), copy_file_to_file(), create_target_directory(), CreateItem(), CreateSendToMyDocuments(), dialog_directorylist_up(), CDeskLinkDropHandler::Drop(), FD31_UpdateResult(), FILEDLG95_OnOpen(), FinishDlgProc(), CFileDefExt::GeneralPageProc(), get_volume_path_parent(), CFontExt::GetDetailsOf(), CRecycleBin::GetDisplayNameOf(), GetFileDialog95(), GetItemOriginalFileName(), CShellLink::GetPath(), COpenWithDialog::Init(), CFileDefExt::InitFilePath(), CFileDefExt::InitGeneralPage(), CFileDefExt::InitOpensWithField(), IsExplorerSystemShell(), IsTitleWild(), COpenWithList::LoadFromProgIdKey(), move_file_to_file(), OFNHookProc(), CShellLink::OnInitDialog(), OpenMailer(), OpensWithExplorer(), PathCompactPathExW(), PathCompactPathW(), ATL::CPathT< StringType >::PathFindFileNameX(), PathStripPathW(), Preview_UpdateTitle(), BtrfsContextMenu::reflink_copy(), SetFileInfo(), CFSFolder::SetNameOf(), SHAddToRecentDocs(), SHCreatePropertyBagOnProfileSection(), SHELL32_GetDllFromRundll32CommandLine(), SHELL_InRunDllProcess(), ShowCreateShortcutWizard(), START_TEST(), test_MultipleFiles(), and TEST_Start().

◆ PathFindNextComponentA()

LPSTR WINAPI PathFindNextComponentA ( LPCSTR  lpszPath)

Definition at line 2562 of file path.c.

2563{
2564 LPSTR lpszSlash;
2565
2566 TRACE("(%s)\n", debugstr_a(lpszPath));
2567
2568 if(!lpszPath || !*lpszPath)
2569 return NULL;
2570
2571 if ((lpszSlash = StrChrA(lpszPath, '\\')))
2572 {
2573 if (lpszSlash[1] == '\\')
2574 lpszSlash++;
2575 return lpszSlash + 1;
2576 }
2577 return (LPSTR)lpszPath + strlen(lpszPath);
2578}
LPSTR WINAPI StrChrA(LPCSTR lpszStr, WORD ch)
Definition: string.c:266

◆ PathFindNextComponentW()

LPWSTR WINAPI PathFindNextComponentW ( LPCWSTR  lpszPath)

Definition at line 2585 of file path.c.

2586{
2587 LPWSTR lpszSlash;
2588
2589 TRACE("(%s)\n", debugstr_w(lpszPath));
2590
2591 if(!lpszPath || !*lpszPath)
2592 return NULL;
2593
2594 if ((lpszSlash = StrChrW(lpszPath, '\\')))
2595 {
2596 if (lpszSlash[1] == '\\')
2597 lpszSlash++;
2598 return lpszSlash + 1;
2599 }
2600 return (LPWSTR)lpszPath + strlenW(lpszPath);
2601}
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:464

Referenced by ChildWndProc(), FILEDLG95_ValidatePathAction(), PathRelativePathToW(), and Test_GetDisplayNameOf().

◆ PathFindOnPathA()

BOOL WINAPI PathFindOnPathA ( LPSTR  lpszFile,
LPCSTR lppszOtherDirs 
)

Definition at line 1398 of file path.c.

1399{
1400 TRACE("(%s,%p)\n", debugstr_a(lpszFile), lppszOtherDirs);
1401 return PathFindOnPathExA(lpszFile, lppszOtherDirs, 0);
1402 }
BOOL WINAPI PathFindOnPathExA(LPSTR lpszFile, LPCSTR *lppszOtherDirs, DWORD dwWhich)
Definition: path.c:1313

◆ PathFindOnPathExA()

BOOL WINAPI PathFindOnPathExA ( LPSTR  lpszFile,
LPCSTR lppszOtherDirs,
DWORD  dwWhich 
)

Definition at line 1313 of file path.c.

1314{
1315 WCHAR szFile[MAX_PATH];
1317
1318 TRACE("(%s,%p,%08x)\n", debugstr_a(lpszFile), lppszOtherDirs, dwWhich);
1319
1320 if (!lpszFile || !PathIsFileSpecA(lpszFile))
1321 return FALSE;
1322
1323 MultiByteToWideChar(CP_ACP,0,lpszFile,-1,szFile,MAX_PATH);
1324
1325 /* Search provided directories first */
1326 if (lppszOtherDirs && *lppszOtherDirs)
1327 {
1328 WCHAR szOther[MAX_PATH];
1329 LPCSTR *lpszOtherPath = lppszOtherDirs;
1330
1331 while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
1332 {
1333 MultiByteToWideChar(CP_ACP,0,*lpszOtherPath,-1,szOther,MAX_PATH);
1334 PathCombineW(buff, szOther, szFile);
1335 if (PathFileExistsDefExtW(buff, dwWhich))
1336 {
1337 WideCharToMultiByte(CP_ACP,0,buff,-1,lpszFile,MAX_PATH,0,0);
1338 return TRUE;
1339 }
1340 lpszOtherPath++;
1341 }
1342 }
1343 /* Not found, try system and path dirs */
1344 if (SHLWAPI_PathFindInOtherDirs(szFile, dwWhich))
1345 {
1346 WideCharToMultiByte(CP_ACP,0,szFile,-1,lpszFile,MAX_PATH,0,0);
1347 return TRUE;
1348 }
1349 return FALSE;
1350}
static BOOL SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich)
Definition: path.c:1223
BOOL WINAPI PathIsFileSpecA(LPCSTR lpszPath)
Definition: path.c:2118

Referenced by PathFindOnPathA().

◆ PathFindOnPathExW()

BOOL WINAPI PathFindOnPathExW ( LPWSTR  lpszFile,
LPCWSTR lppszOtherDirs,
DWORD  dwWhich 
)

Definition at line 1357 of file path.c.

1358{
1360
1361 TRACE("(%s,%p,%08x)\n", debugstr_w(lpszFile), lppszOtherDirs, dwWhich);
1362
1363 if (!lpszFile || !PathIsFileSpecW(lpszFile))
1364 return FALSE;
1365
1366 /* Search provided directories first */
1367 if (lppszOtherDirs && *lppszOtherDirs)
1368 {
1369 LPCWSTR *lpszOtherPath = lppszOtherDirs;
1370 while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
1371 {
1372 PathCombineW(buff, *lpszOtherPath, lpszFile);
1373 if (PathFileExistsDefExtW(buff, dwWhich))
1374 {
1375 strcpyW(lpszFile, buff);
1376 return TRUE;
1377 }
1378 lpszOtherPath++;
1379 }
1380 }
1381 /* Not found, try system and path dirs */
1382 return SHLWAPI_PathFindInOtherDirs(lpszFile, dwWhich);
1383}
BOOL WINAPI PathIsFileSpecW(LPCWSTR lpszPath)
Definition: path.c:2139

Referenced by PathFindOnPathW(), PathSearchOnExtensionsW(), ShellExecCmdLine(), and WelcomeDlgProc().

◆ PathFindOnPathW()

BOOL WINAPI PathFindOnPathW ( LPWSTR  lpszFile,
LPCWSTR lppszOtherDirs 
)

Definition at line 1409 of file path.c.

1410{
1411 TRACE("(%s,%p)\n", debugstr_w(lpszFile), lppszOtherDirs);
1412 return PathFindOnPathExW(lpszFile,lppszOtherDirs, 0);
1413}
BOOL WINAPI PathFindOnPathExW(LPWSTR lpszFile, LPCWSTR *lppszOtherDirs, DWORD dwWhich)
Definition: path.c:1357

Referenced by DoEntry(), PathResolveW(), and SHELL_FindExecutable().

◆ PathFindSuffixArrayA()

LPCSTR WINAPI PathFindSuffixArrayA ( LPCSTR  lpszSuffix,
LPCSTR lppszArray,
int  dwCount 
)

Definition at line 3999 of file path.c.

4000{
4001 size_t dwLen;
4002 int dwRet = 0;
4003
4004 TRACE("(%s,%p,%d)\n",debugstr_a(lpszSuffix), lppszArray, dwCount);
4005
4006 if (lpszSuffix && lppszArray && dwCount > 0)
4007 {
4008 dwLen = strlen(lpszSuffix);
4009
4010 while (dwRet < dwCount)
4011 {
4012 size_t dwCompareLen = strlen(*lppszArray);
4013 if (dwCompareLen < dwLen)
4014 {
4015 if (!strcmp(lpszSuffix + dwLen - dwCompareLen, *lppszArray))
4016 return *lppszArray; /* Found */
4017 }
4018 dwRet++;
4019 lppszArray++;
4020 }
4021 }
4022 return NULL;
4023}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

◆ PathFindSuffixArrayW()

LPCWSTR WINAPI PathFindSuffixArrayW ( LPCWSTR  lpszSuffix,
LPCWSTR lppszArray,
int  dwCount 
)

Definition at line 4030 of file path.c.

4031{
4032 size_t dwLen;
4033 int dwRet = 0;
4034
4035 TRACE("(%s,%p,%d)\n",debugstr_w(lpszSuffix), lppszArray, dwCount);
4036
4037 if (lpszSuffix && lppszArray && dwCount > 0)
4038 {
4039 dwLen = strlenW(lpszSuffix);
4040
4041 while (dwRet < dwCount)
4042 {
4043 size_t dwCompareLen = strlenW(*lppszArray);
4044 if (dwCompareLen < dwLen)
4045 {
4046 if (!strcmpW(lpszSuffix + dwLen - dwCompareLen, *lppszArray))
4047 return *lppszArray; /* Found */
4048 }
4049 dwRet++;
4050 lppszArray++;
4051 }
4052 }
4053 return NULL;
4054}
#define strcmpW(s1, s2)
Definition: unicode.h:44

◆ PathGetArgsA()

LPSTR WINAPI PathGetArgsA ( LPCSTR  lpszPath)

Definition at line 481 of file path.c.

482{
483 BOOL bSeenQuote = FALSE;
484
485 TRACE("(%s)\n",debugstr_a(lpszPath));
486
487 if (lpszPath)
488 {
489 while (*lpszPath)
490 {
491 if ((*lpszPath==' ') && !bSeenQuote)
492 return (LPSTR)lpszPath + 1;
493 if (*lpszPath == '"')
494 bSeenQuote = !bSeenQuote;
495 lpszPath = CharNextA(lpszPath);
496 }
497 }
498 return (LPSTR)lpszPath;
499}

Referenced by PathRemoveArgsA().

◆ PathGetArgsW()

LPWSTR WINAPI PathGetArgsW ( LPCWSTR  lpszPath)

Definition at line 506 of file path.c.

507{
508 BOOL bSeenQuote = FALSE;
509
510 TRACE("(%s)\n",debugstr_w(lpszPath));
511
512 if (lpszPath)
513 {
514 while (*lpszPath)
515 {
516 if ((*lpszPath==' ') && !bSeenQuote)
517 return (LPWSTR)lpszPath + 1;
518 if (*lpszPath == '"')
519 bSeenQuote = !bSeenQuote;
520 lpszPath++;
521 }
522 }
523 return (LPWSTR)lpszPath;
524}

Referenced by RunOnceExEntry::Exec(), CAddressEditBox::ExecuteCommandLine(), LanguagesPageProc(), CShellLink::OnNotify(), PathRemoveArgsW(), SHELL_execute(), SHELL_translate_idlist(), ShellExec_RunDLL_Helper(), SHExplorerParseCmdLine(), and WelcomeDlgProc().

◆ PathGetCharTypeA()

UINT WINAPI PathGetCharTypeA ( UCHAR  ch)

Definition at line 3032 of file path.c.

3033{
3034 return PathGetCharTypeW(ch);
3035}
UINT WINAPI PathGetCharTypeW(WCHAR ch)
Definition: path.c:3042

Referenced by PathCleanupSpec().

◆ PathGetCharTypeW()

UINT WINAPI PathGetCharTypeW ( WCHAR  ch)

Definition at line 3042 of file path.c.

3043{
3044 UINT flags = 0;
3045
3046 TRACE("(%d)\n", ch);
3047
3048 if (!ch || ch < ' ' || ch == '<' || ch == '>' ||
3049 ch == '"' || ch == '|' || ch == '/')
3050 flags = GCT_INVALID; /* Invalid */
3051 else if (ch == '*' || ch=='?')
3052 flags = GCT_WILD; /* Wildchars */
3053 else if ((ch == '\\') || (ch == ':'))
3054 return GCT_SEPARATOR; /* Path separators */
3055 else
3056 {
3057 if (ch < 126)
3058 {
3059 if (((ch & 0x1) && ch != ';') || !ch || isalnum(ch) || ch == '$' || ch == '&' || ch == '(' ||
3060 ch == '.' || ch == '@' || ch == '^' ||
3061 ch == '\'' || ch == 130 || ch == '`')
3062 flags |= GCT_SHORTCHAR; /* All these are valid for DOS */
3063 }
3064 else
3065 flags |= GCT_SHORTCHAR; /* Bug compatible with win32 */
3066 flags |= GCT_LFNCHAR; /* Valid for long file names */
3067 }
3068 return flags;
3069}
GLbitfield flags
Definition: glext.h:7161
_Check_return_ _CRTIMP int __cdecl isalnum(_In_ int _C)
#define GCT_SHORTCHAR
Definition: shlwapi.h:812
#define GCT_LFNCHAR
Definition: shlwapi.h:811
#define GCT_SEPARATOR
Definition: shlwapi.h:814
#define GCT_INVALID
Definition: shlwapi.h:810
#define GCT_WILD
Definition: shlwapi.h:813

Referenced by PathCleanupSpec(), and PathGetCharTypeA().

◆ PathGetDriveNumberA()

int WINAPI PathGetDriveNumberA ( LPCSTR  lpszPath)

Definition at line 538 of file path.c.

539{
540 TRACE ("(%s)\n",debugstr_a(lpszPath));
541
542 if (lpszPath && !IsDBCSLeadByte(*lpszPath) && lpszPath[1] == ':' &&
543 tolower(*lpszPath) >= 'a' && tolower(*lpszPath) <= 'z')
544 return tolower(*lpszPath) - 'a';
545 return -1;
546}
BOOL WINAPI IsDBCSLeadByte(BYTE testchar)
Definition: locale.c:2124

Referenced by ATL::CPathT< StringType >::PathGetDriveNumberX(), PathIsNetworkPathA(), and test_PathGetDriveNumber().

◆ PathGetDriveNumberW()

int WINAPI PathGetDriveNumberW ( const WCHAR path)

Definition at line 553 of file path.c.

554{
555 WCHAR drive;
556
557 static const WCHAR nt_prefixW[] = {'\\','\\','?','\\'};
558
559 TRACE("(%s)\n", debugstr_w(path));
560
561 if (!path)
562 return -1;
563
564 if (!strncmpW(path, nt_prefixW, 4))
565 path += 4;
566
567 drive = tolowerW(path[0]);
568 if (drive < 'a' || drive > 'z' || path[1] != ':')
569 return -1;
570
571 return drive - 'a';
572}
#define strncmpW(s1, s2, n)
Definition: unicode.h:42

Referenced by COMDLG32_GetCanonicalPath(), GetDefaultRecycleDriveNumber(), GetItemDriveNumber(), ATL::CPathT< StringType >::PathGetDriveNumberX(), PathIsAbsoluteW(), PathIsDriveRoot(), PathIsNetworkPathW(), PathIsOnDrive(), PathIsSameDrive(), PathQualifyExW(), SHChangeNotify(), SHELL_execute(), SHIsRemovableDrive(), and test_PathGetDriveNumber().

◆ PathIsContentTypeA()

BOOL WINAPI PathIsContentTypeA ( LPCSTR  lpszPath,
LPCSTR  lpszContentType 
)

Definition at line 2064 of file path.c.

2065{
2066 LPCSTR szExt;
2067 DWORD dwDummy;
2068 char szBuff[MAX_PATH];
2069
2070 TRACE("(%s,%s)\n", debugstr_a(lpszPath), debugstr_a(lpszContentType));
2071
2072 if (lpszPath && (szExt = PathFindExtensionA(lpszPath)) && *szExt &&
2073 !SHGetValueA(HKEY_CLASSES_ROOT, szExt, "Content Type",
2074 REG_NONE, szBuff, &dwDummy) &&
2075 !strcasecmp(lpszContentType, szBuff))
2076 {
2077 return TRUE;
2078 }
2079 return FALSE;
2080}
DWORD WINAPI SHGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1207
#define strcasecmp
Definition: fake.h:9
#define REG_NONE
Definition: nt_native.h:1492
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

◆ PathIsContentTypeW()

BOOL WINAPI PathIsContentTypeW ( LPCWSTR  lpszPath,
LPCWSTR  lpszContentType 
)

Definition at line 2087 of file path.c.

2088{
2089 static const WCHAR szContentType[] = { 'C','o','n','t','e','n','t',' ','T','y','p','e','\0' };
2090 LPCWSTR szExt;
2091 DWORD dwDummy;
2092 WCHAR szBuff[MAX_PATH];
2093
2094 TRACE("(%s,%s)\n", debugstr_w(lpszPath), debugstr_w(lpszContentType));
2095
2096 if (lpszPath && (szExt = PathFindExtensionW(lpszPath)) && *szExt &&
2097 !SHGetValueW(HKEY_CLASSES_ROOT, szExt, szContentType,
2098 REG_NONE, szBuff, &dwDummy) &&
2099 !strcmpiW(lpszContentType, szBuff))
2100 {
2101 return TRUE;
2102 }
2103 return FALSE;
2104}
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
#define strcmpiW(s1, s2)
Definition: unicode.h:45

◆ PathIsDirectoryA()

BOOL WINAPI PathIsDirectoryA ( LPCSTR  lpszPath)

Definition at line 1704 of file path.c.

1705{
1706 DWORD dwAttr;
1707
1708 TRACE("(%s)\n", debugstr_a(lpszPath));
1709
1710 if (!lpszPath || PathIsUNCServerA(lpszPath))
1711 return FALSE;
1712
1713 if (PathIsUNCServerShareA(lpszPath))
1714 {
1715 FIXME("UNC Server Share not yet supported - FAILING\n");
1716 return FALSE;
1717 }
1718
1719 if ((dwAttr = GetFileAttributesA(lpszPath)) == INVALID_FILE_ATTRIBUTES)
1720 return FALSE;
1721 return dwAttr & FILE_ATTRIBUTE_DIRECTORY;
1722}
#define FIXME(fmt,...)
Definition: precomp.h:53
BOOL WINAPI PathIsUNCServerA(LPCSTR lpszPath)
Definition: path.c:2307
BOOL WINAPI PathIsUNCServerShareA(LPCSTR lpszPath)
Definition: path.c:2357

Referenced by ATL::CPathT< StringType >::PathIsDirectoryX().

◆ PathIsDirectoryEmptyA()

BOOL WINAPI PathIsDirectoryEmptyA ( LPCSTR  lpszPath)

Definition at line 3917 of file path.c.

3918{
3919 BOOL bRet = FALSE;
3920
3921 TRACE("(%s)\n",debugstr_a(lpszPath));
3922
3923 if (lpszPath)
3924 {
3928 }
3929 return bRet;
3930}
BOOL WINAPI PathIsDirectoryEmptyW(LPCWSTR lpszPath)
Definition: path.c:3937

◆ PathIsDirectoryEmptyW()

BOOL WINAPI PathIsDirectoryEmptyW ( LPCWSTR  lpszPath)

Definition at line 3937 of file path.c.

3938{
3939 static const WCHAR szAllFiles[] = { '*', '.', '*', '\0' };
3940 WCHAR szSearch[MAX_PATH];
3941 DWORD dwLen;
3942 HANDLE hfind;
3943 BOOL retVal = TRUE;
3945
3946 TRACE("(%s)\n",debugstr_w(lpszPath));
3947
3948 if (!lpszPath || !PathIsDirectoryW(lpszPath))
3949 return FALSE;
3950
3951 lstrcpynW(szSearch, lpszPath, MAX_PATH);
3952 PathAddBackslashW(szSearch);
3953 dwLen = strlenW(szSearch);
3954 if (dwLen > MAX_PATH - 4)
3955 return FALSE;
3956
3957 strcpyW(szSearch + dwLen, szAllFiles);
3958 hfind = FindFirstFileW(szSearch, &find_data);
3959 if (hfind == INVALID_HANDLE_VALUE)
3960 return FALSE;
3961
3962 do
3963 {
3964 if (find_data.cFileName[0] == '.')
3965 {
3966 if (find_data.cFileName[1] == '\0') continue;
3967 if (find_data.cFileName[1] == '.' && find_data.cFileName[2] == '\0') continue;
3968 }
3969
3970 retVal = FALSE;
3971 break;
3972 }
3973 while (FindNextFileW(hfind, &find_data));
3974
3975 FindClose(hfind);
3976 return retVal;
3977}
static int find_data(const struct Vector *v, const BYTE *pData, int size)
Definition: filtermapper.c:162
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1729

Referenced by move_dir_to_dir(), and PathIsDirectoryEmptyA().

◆ PathIsDirectoryW()

◆ PathIsFileSpecA()

BOOL WINAPI PathIsFileSpecA ( LPCSTR  lpszPath)

Definition at line 2118 of file path.c.

2119{
2120 TRACE("(%s)\n", debugstr_a(lpszPath));
2121
2122 if (!lpszPath)
2123 return FALSE;
2124
2125 while (*lpszPath)
2126 {
2127 if (*lpszPath == '\\' || *lpszPath == ':')
2128 return FALSE;
2129 lpszPath = CharNextA(lpszPath);
2130 }
2131 return TRUE;
2132}

Referenced by PathFindOnPathExA(), and ATL::CPathT< StringType >::PathIsFileSpecX().

◆ PathIsFileSpecW()

BOOL WINAPI PathIsFileSpecW ( LPCWSTR  lpszPath)

Definition at line 2139 of file path.c.

2140{
2141 TRACE("(%s)\n", debugstr_w(lpszPath));
2142
2143 if (!lpszPath)
2144 return FALSE;
2145
2146 while (*lpszPath)
2147 {
2148 if (*lpszPath == '\\' || *lpszPath == ':')
2149 return FALSE;
2150 lpszPath++;
2151 }
2152 return TRUE;
2153}

Referenced by Control_LoadApplet(), PathFindOnPathExW(), ATL::CPathT< StringType >::PathIsFileSpecX(), PathResolveW(), and CShellLink::SetTargetFromPIDLOrPath().

◆ PathIsLFNFileSpecA()

BOOL WINAPI PathIsLFNFileSpecA ( LPCSTR  lpszPath)

Definition at line 3828 of file path.c.

3829{
3830 DWORD dwNameLen = 0, dwExtLen = 0;
3831
3832 TRACE("(%s)\n",debugstr_a(lpszPath));
3833
3834 if (!lpszPath)
3835 return FALSE;
3836
3837 while (*lpszPath)
3838 {
3839 if (*lpszPath == ' ')
3840 return TRUE; /* DOS names cannot have spaces */
3841 if (*lpszPath == '.')
3842 {
3843 if (dwExtLen)
3844 return TRUE; /* DOS names have only one dot */
3845 dwExtLen = 1;
3846 }
3847 else if (dwExtLen)
3848 {
3849 dwExtLen++;
3850 if (dwExtLen > 4)
3851 return TRUE; /* DOS extensions are <= 3 chars*/
3852 }
3853 else
3854 {
3855 dwNameLen++;
3856 if (dwNameLen > 8)
3857 return TRUE; /* DOS names are <= 8 chars */
3858 }
3859 lpszPath += IsDBCSLeadByte(*lpszPath) ? 2 : 1;
3860 }
3861 return FALSE; /* Valid DOS path */
3862}

◆ PathIsLFNFileSpecW()

BOOL WINAPI PathIsLFNFileSpecW ( LPCWSTR  lpszPath)

Definition at line 3869 of file path.c.

3870{
3871 DWORD dwNameLen = 0, dwExtLen = 0;
3872
3873 TRACE("(%s)\n",debugstr_w(lpszPath));
3874
3875 if (!lpszPath)
3876 return FALSE;
3877
3878 while (*lpszPath)
3879 {
3880 if (*lpszPath == ' ')
3881 return TRUE; /* DOS names cannot have spaces */
3882 if (*lpszPath == '.')
3883 {
3884 if (dwExtLen)
3885 return TRUE; /* DOS names have only one dot */
3886 dwExtLen = 1;
3887 }
3888 else if (dwExtLen)
3889 {
3890 dwExtLen++;
3891 if (dwExtLen > 4)
3892 return TRUE; /* DOS extensions are <= 3 chars*/
3893 }
3894 else
3895 {
3896 dwNameLen++;
3897 if (dwNameLen > 8)
3898 return TRUE; /* DOS names are <= 8 chars */
3899 }
3900 lpszPath++;
3901 }
3902 return FALSE; /* Valid DOS path */
3903}

◆ PathIsNetworkPathA()

BOOL WINAPI PathIsNetworkPathA ( LPCSTR  lpszPath)

Definition at line 3769 of file path.c.

3770{
3771 int dwDriveNum;
3772
3773 TRACE("(%s)\n",debugstr_a(lpszPath));
3774
3775 if (!lpszPath)
3776 return FALSE;
3777 if (*lpszPath == '\\' && lpszPath[1] == '\\')
3778 return TRUE;
3779 dwDriveNum = PathGetDriveNumberA(lpszPath);
3780 if (dwDriveNum == -1)
3781 return FALSE;
3782#ifdef __REACTOS__
3783 return IsNetDrive(dwDriveNum);
3784#else
3785 GET_FUNC(pIsNetDrive, shell32, (LPCSTR)66, FALSE); /* ord 66 = shell32.IsNetDrive */
3786 return pIsNetDrive(dwDriveNum);
3787#endif
3788}
@ shell32
Definition: LocaleTests.cpp:20
#define GET_FUNC(func, module, name, fail)
Definition: path.c:52
int WINAPI PathGetDriveNumberA(LPCSTR lpszPath)
Definition: path.c:538
static fnpIsNetDrive pIsNetDrive
Definition: path.c:66
EXTERN_C int WINAPI IsNetDrive(int drive)
Definition: shlfileop.cpp:2261

◆ PathIsNetworkPathW()

BOOL WINAPI PathIsNetworkPathW ( LPCWSTR  lpszPath)

Definition at line 3795 of file path.c.

3796{
3797 int dwDriveNum;
3798
3799 TRACE("(%s)\n", debugstr_w(lpszPath));
3800
3801 if (!lpszPath)
3802 return FALSE;
3803 if (*lpszPath == '\\' && lpszPath[1] == '\\')
3804 return TRUE;
3805 dwDriveNum = PathGetDriveNumberW(lpszPath);
3806 if (dwDriveNum == -1)
3807 return FALSE;
3808#ifdef __REACTOS__
3809 return IsNetDrive(dwDriveNum);
3810#else
3811 GET_FUNC(pIsNetDrive, shell32, (LPCSTR)66, FALSE); /* ord 66 = shell32.IsNetDrive */
3812 return pIsNetDrive(dwDriveNum);
3813#endif
3814}
int WINAPI PathGetDriveNumberW(const WCHAR *path)
Definition: path.c:553

◆ PathIsPrefixA()

BOOL WINAPI PathIsPrefixA ( LPCSTR  lpszPrefix,
LPCSTR  lpszPath 
)

Definition at line 2168 of file path.c.

2169{
2170 TRACE("(%s,%s)\n", debugstr_a(lpszPrefix), debugstr_a(lpszPath));
2171
2172 if (lpszPrefix && lpszPath &&
2173 PathCommonPrefixA(lpszPath, lpszPrefix, NULL) == (int)strlen(lpszPrefix))
2174 return TRUE;
2175 return FALSE;
2176}
int WINAPI PathCommonPrefixA(LPCSTR lpszFile1, LPCSTR lpszFile2, LPSTR achPath)
Definition: path.c:2757

Referenced by ATL::CPathT< StringType >::PathIsPrefixX().

◆ PathIsPrefixW()

BOOL WINAPI PathIsPrefixW ( LPCWSTR  lpszPrefix,
LPCWSTR  lpszPath 
)

Definition at line 2183 of file path.c.

2184{
2185 TRACE("(%s,%s)\n", debugstr_w(lpszPrefix), debugstr_w(lpszPath));
2186
2187 if (lpszPrefix && lpszPath &&
2188 PathCommonPrefixW(lpszPath, lpszPrefix, NULL) == (int)strlenW(lpszPrefix))
2189 return TRUE;
2190 return FALSE;
2191}
int WINAPI PathCommonPrefixW(LPCWSTR lpszFile1, LPCWSTR lpszFile2, LPWSTR achPath)
Definition: path.c:2812

Referenced by ATL::CPathT< StringType >::PathIsPrefixX().

◆ PathIsRelativeA()

BOOL WINAPI PathIsRelativeA ( LPCSTR  lpszPath)

Definition at line 1569 of file path.c.

1570{
1571 TRACE("(%s)\n",debugstr_a(lpszPath));
1572
1573 if (!lpszPath || !*lpszPath || IsDBCSLeadByte(*lpszPath))
1574 return TRUE;
1575 if (*lpszPath == '\\' || (*lpszPath && lpszPath[1] == ':'))
1576 return FALSE;
1577 return TRUE;
1578}

Referenced by ATL::CPathT< StringType >::PathIsRelativeX(), and TestGetModuleFileNameA().

◆ PathIsRelativeW()

◆ PathIsRootA()

BOOL WINAPI PathIsRootA ( LPCSTR  lpszPath)

Definition at line 1608 of file path.c.

1609{
1610 TRACE("(%s)\n", debugstr_a(lpszPath));
1611
1612 if (lpszPath && *lpszPath)
1613 {
1614 if (*lpszPath == '\\')
1615 {
1616 if (!lpszPath[1])
1617 return TRUE; /* \ */
1618 else if (lpszPath[1]=='\\')
1619 {
1620 BOOL bSeenSlash = FALSE;
1621 lpszPath += 2;
1622
1623 /* Check for UNC root path */
1624 while (*lpszPath)
1625 {
1626 if (*lpszPath == '\\')
1627 {
1628 if (bSeenSlash)
1629 return FALSE;
1630 bSeenSlash = TRUE;
1631 }
1632 lpszPath = CharNextA(lpszPath);
1633 }
1634 return TRUE;
1635 }
1636 }
1637 else if (lpszPath[1] == ':' && lpszPath[2] == '\\' && lpszPath[3] == '\0')
1638 return TRUE; /* X:\ */
1639 }
1640 return FALSE;
1641}

Referenced by PathIsRootAW(), ATL::CPathT< StringType >::PathIsRootX(), PathRemoveBackslashA(), PathStripToRootA(), and START_TEST().

◆ PathIsRootW()

BOOL WINAPI PathIsRootW ( LPCWSTR  lpszPath)

Definition at line 1648 of file path.c.

1649{
1650 TRACE("(%s)\n", debugstr_w(lpszPath));
1651
1652 if (lpszPath && *lpszPath)
1653 {
1654 if (*lpszPath == '\\')
1655 {
1656 if (!lpszPath[1])
1657 return TRUE; /* \ */
1658 else if (lpszPath[1]=='\\')
1659 {
1660 BOOL bSeenSlash = FALSE;
1661 lpszPath += 2;
1662
1663 /* Check for UNC root path */
1664 while (*lpszPath)
1665 {
1666 if (*lpszPath == '\\')
1667 {
1668 if (bSeenSlash)
1669 return FALSE;
1670 bSeenSlash = TRUE;
1671 }
1672 lpszPath++;
1673 }
1674 return TRUE;
1675 }
1676 }
1677 else if (lpszPath[1] == ':' && lpszPath[2] == '\\' && lpszPath[3] == '\0')
1678 return TRUE; /* X:\ */
1679 }
1680 return FALSE;
1681}

Referenced by _ILCreate(), IsDriveFloppyW(), PathIsDriveRoot(), PathIsRootAW(), ATL::CPathT< StringType >::PathIsRootX(), PathRemoveBackslashW(), PathResolveW(), PathStripToRootW(), and SHGetFileInfoW().

◆ PathIsSameRootA()

BOOL WINAPI PathIsSameRootA ( LPCSTR  lpszPath1,
LPCSTR  lpszPath2 
)

Definition at line 2009 of file path.c.

2010{
2011 LPCSTR lpszStart;
2012 int dwLen;
2013
2014 TRACE("(%s,%s)\n", debugstr_a(lpszPath1), debugstr_a(lpszPath2));
2015
2016 if (!lpszPath1 || !lpszPath2 || !(lpszStart = PathSkipRootA(lpszPath1)))
2017 return FALSE;
2018
2019 dwLen = PathCommonPrefixA(lpszPath1, lpszPath2, NULL) + 1;
2020 if (lpszStart - lpszPath1 > dwLen)
2021 return FALSE; /* Paths not common up to length of the root */
2022 return TRUE;
2023}
LPSTR WINAPI PathSkipRootA(LPCSTR lpszPath)
Definition: path.c:3253

Referenced by ATL::CPathT< StringType >::PathIsSameRootX().

◆ PathIsSameRootW()

BOOL WINAPI PathIsSameRootW ( LPCWSTR  lpszPath1,
LPCWSTR  lpszPath2 
)

Definition at line 2030 of file path.c.

2031{
2032 LPCWSTR lpszStart;
2033 int dwLen;
2034
2035 TRACE("(%s,%s)\n", debugstr_w(lpszPath1), debugstr_w(lpszPath2));
2036
2037 if (!lpszPath1 || !lpszPath2 || !(lpszStart = PathSkipRootW(lpszPath1)))
2038 return FALSE;
2039
2040 dwLen = PathCommonPrefixW(lpszPath1, lpszPath2, NULL) + 1;
2041 if (lpszStart - lpszPath1 > dwLen)
2042 return FALSE; /* Paths not common up to length of the root */
2043 return TRUE;
2044}
LPWSTR WINAPI PathSkipRootW(LPCWSTR lpszPath)
Definition: path.c:3284

Referenced by ATL::CPathT< StringType >::PathIsSameRootX().

◆ PathIsSystemFolderA()

BOOL WINAPI PathIsSystemFolderA ( LPCSTR  lpszPath,
DWORD  dwAttrib 
)

Definition at line 2206 of file path.c.

2207{
2208 TRACE("(%s,0x%08x)\n", debugstr_a(lpszPath), dwAttrib);
2209
2210 if (lpszPath && *lpszPath)
2211 dwAttrib = GetFileAttributesA(lpszPath);
2212
2213 if (dwAttrib == INVALID_FILE_ATTRIBUTES || !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY) ||
2215 return FALSE;
2216 return TRUE;
2217}
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704

◆ PathIsSystemFolderW()

BOOL WINAPI PathIsSystemFolderW ( LPCWSTR  lpszPath,
DWORD  dwAttrib 
)

Definition at line 2224 of file path.c.

2225{
2226 TRACE("(%s,0x%08x)\n", debugstr_w(lpszPath), dwAttrib);
2227
2228 if (lpszPath && *lpszPath)
2229 dwAttrib = GetFileAttributesW(lpszPath);
2230
2231 if (dwAttrib == INVALID_FILE_ATTRIBUTES || !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY) ||
2233 return FALSE;
2234 return TRUE;
2235}

Referenced by CViewStatePropertyBag::_IsSystemFolder().

◆ PathIsUNCA()

BOOL WINAPI PathIsUNCA ( LPCSTR  lpszPath)

Definition at line 2249 of file path.c.

2250{
2251 TRACE("(%s)\n",debugstr_a(lpszPath));
2252
2253/*
2254 * On Windows 2003, tests show that strings starting with "\\?" are
2255 * considered UNC, while on Windows Vista+ this is not the case anymore.
2256 */
2257// #ifdef __REACTOS__
2258#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
2259 if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\') && (lpszPath[2]!='?'))
2260#else
2261 if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\'))
2262#endif
2263 return TRUE;
2264 return FALSE;
2265}

Referenced by PathAppendA(), PathCommonPrefixA(), and ATL::CPathT< StringType >::PathIsUNCX().

◆ PathIsUNCServerA()

BOOL WINAPI PathIsUNCServerA ( LPCSTR  lpszPath)

Definition at line 2307 of file path.c.

2308{
2309 TRACE("(%s)\n", debugstr_a(lpszPath));
2310
2311 if (lpszPath && *lpszPath++ == '\\' && *lpszPath++ == '\\')
2312 {
2313 while (*lpszPath)
2314 {
2315 if (*lpszPath == '\\')
2316 return FALSE;
2317 lpszPath = CharNextA(lpszPath);
2318 }
2319 return TRUE;
2320 }
2321 return FALSE;
2322}

Referenced by PathIsDirectoryA(), and ATL::CPathT< StringType >::PathIsUNCServerX().

◆ PathIsUNCServerShareA()

BOOL WINAPI PathIsUNCServerShareA ( LPCSTR  lpszPath)

Definition at line 2357 of file path.c.

2358{
2359 TRACE("(%s)\n", debugstr_a(lpszPath));
2360
2361 if (lpszPath && *lpszPath++ == '\\' && *lpszPath++ == '\\')
2362 {
2363 BOOL bSeenSlash = FALSE;
2364 while (*lpszPath)
2365 {
2366 if (*lpszPath == '\\')
2367 {
2368 if (bSeenSlash)
2369 return FALSE;
2370 bSeenSlash = TRUE;
2371 }
2372 lpszPath = CharNextA(lpszPath);
2373 }
2374 return bSeenSlash;
2375 }
2376 return FALSE;
2377}

Referenced by PathIsDirectoryA(), and ATL::CPathT< StringType >::PathIsUNCServerShareX().

◆ PathIsUNCServerShareW()

BOOL WINAPI PathIsUNCServerShareW ( LPCWSTR  lpszPath)

Definition at line 2384 of file path.c.

2385{
2386 TRACE("(%s)\n", debugstr_w(lpszPath));
2387
2388 if (lpszPath && *lpszPath++ == '\\' && *lpszPath++ == '\\')
2389 {
2390 BOOL bSeenSlash = FALSE;
2391 while (*lpszPath)
2392 {
2393 if (*lpszPath == '\\')
2394 {
2395 if (bSeenSlash)
2396 return FALSE;
2397 bSeenSlash = TRUE;
2398 }
2399 lpszPath++;
2400 }
2401 return bSeenSlash;
2402 }
2403 return FALSE;
2404}

Referenced by PathCanonicalizeW(), PathFileExistsDefExtW(), PathIsDirectoryW(), and ATL::CPathT< StringType >::PathIsUNCServerShareX().

◆ PathIsUNCServerW()

BOOL WINAPI PathIsUNCServerW ( LPCWSTR  lpszPath)

Definition at line 2329 of file path.c.

2330{
2331 TRACE("(%s)\n", debugstr_w(lpszPath));
2332
2333 if (lpszPath && lpszPath[0] == '\\' && lpszPath[1] == '\\')
2334 {
2335 return !strchrW( lpszPath + 2, '\\' );
2336 }
2337 return FALSE;
2338}
#define strchrW(s, c)
Definition: unicode.h:40

Referenced by PathFileExistsDefExtW(), PathIsDirectoryW(), and ATL::CPathT< StringType >::PathIsUNCServerX().

◆ PathIsUNCW()

BOOL WINAPI PathIsUNCW ( LPCWSTR  lpszPath)

Definition at line 2272 of file path.c.

2273{
2274 TRACE("(%s)\n",debugstr_w(lpszPath));
2275
2276/*
2277 * On Windows 2003, tests show that strings starting with "\\?" are
2278 * considered UNC, while on Windows Vista+ this is not the case anymore.
2279 */
2280// #ifdef __REACTOS__
2281#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
2282 if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\') && (lpszPath[2]!='?'))
2283#else
2284 if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\'))
2285#endif
2286 return TRUE;
2287 return FALSE;
2288}

Referenced by _ILIsNetworkPlace(), CDesktopFolder::_ParseDisplayNameByParent(), IsLFNDriveW(), PathAppendW(), PathCombineW(), PathCommonPrefixW(), PathIsAbsoluteW(), PathIsOnUnc(), ATL::CPathT< StringType >::PathIsUNCX(), and PathQualifyExW().

◆ PathIsValidCharA()

BOOL WINAPI PathIsValidCharA ( char  c,
DWORD  class 
)

Definition at line 4396 of file path.c.

4397{
4398 if ((unsigned)c > 0x7e)
4399 return class & PATH_CHAR_CLASS_OTHER_VALID;
4400
4401 return class & SHELL_charclass[(unsigned)c];
4402}
#define PATH_CHAR_CLASS_OTHER_VALID
Definition: path.c:4316
static const DWORD SHELL_charclass[]
Definition: path.c:4323
const GLubyte * c
Definition: glext.h:8905
static unsigned(__cdecl *hash_bstr)(bstr_t s)

◆ PathIsValidCharW()

BOOL WINAPI PathIsValidCharW ( WCHAR  c,
DWORD  class 
)

Definition at line 4409 of file path.c.

4410{
4411 if (c > 0x7e)
4412 return class & PATH_CHAR_CLASS_OTHER_VALID;
4413
4414 return class & SHELL_charclass[c];
4415}
#define c
Definition: ke_i.h:80

Referenced by PathIsValidElement(), PathQualifyExW(), and UrlUnescapeAndMakeFileNameValid().

◆ PathMakePrettyA()

BOOL WINAPI PathMakePrettyA ( LPSTR  lpszPath)

Definition at line 2674 of file path.c.

2675{
2676 LPSTR pszIter = lpszPath;
2677
2678 TRACE("(%s)\n", debugstr_a(lpszPath));
2679
2680 if (!pszIter)
2681 return FALSE;
2682
2683 if (*pszIter)
2684 {
2685 do
2686 {
2687 if (islower(*pszIter) || IsDBCSLeadByte(*pszIter))
2688 return FALSE; /* Not DOS path */
2689 pszIter++;
2690 } while (*pszIter);
2691 pszIter = lpszPath + 1;
2692 while (*pszIter)
2693 {
2694 *pszIter = tolower(*pszIter);
2695 pszIter++;
2696 }
2697 }
2698 return TRUE;
2699}
#define islower(c)
Definition: acclib.h:72

Referenced by ATL::CPathT< StringType >::PathMakePrettyX(), and test_PathMakePretty().

◆ PathMakePrettyW()

BOOL WINAPI PathMakePrettyW ( LPWSTR  lpszPath)

Definition at line 2706 of file path.c.

2707{
2708 LPWSTR pszIter = lpszPath;
2709
2710 TRACE("(%s)\n", debugstr_w(lpszPath));
2711
2712 if (!pszIter)
2713 return FALSE;
2714
2715 if (*pszIter)
2716 {
2717 do
2718 {
2719 if (islowerW(*pszIter))
2720 return FALSE; /* Not DOS path */
2721 pszIter++;
2722 } while (*pszIter);
2723 pszIter = lpszPath + 1;
2724 while (*pszIter)
2725 {
2726 *pszIter = tolowerW(*pszIter);
2727 pszIter++;
2728 }
2729 }
2730 return TRUE;
2731}
#define islowerW(n)
Definition: unicode.h:52

Referenced by ATL::CPathT< StringType >::PathMakePrettyX().

◆ PathMakeSystemFolderA()

BOOL WINAPI PathMakeSystemFolderA ( LPCSTR  lpszPath)

Definition at line 3106 of file path.c.

3107{
3108 BOOL bRet = FALSE;
3109
3110 TRACE("(%s)\n", debugstr_a(lpszPath));
3111
3112 if (lpszPath && *lpszPath)
3113 {
3117 }
3118 return bRet;
3119}
BOOL WINAPI PathMakeSystemFolderW(LPCWSTR lpszPath)
Definition: path.c:3126

◆ PathMakeSystemFolderW()

BOOL WINAPI PathMakeSystemFolderW ( LPCWSTR  lpszPath)

Definition at line 3126 of file path.c.

3127{
3128 DWORD dwDefaultAttr = FILE_ATTRIBUTE_READONLY, dwAttr;
3130
3131 TRACE("(%s)\n", debugstr_w(lpszPath));
3132
3133 if (!lpszPath || !*lpszPath)
3134 return FALSE;
3135
3136 /* If the directory is already a system directory, don't do anything */
3138 if (!strcmpW(buff, lpszPath))
3139 return TRUE;
3140
3142 if (!strcmpW(buff, lpszPath))
3143 return TRUE;
3144
3145 /* "UseSystemForSystemFolders" Tells Win what attributes to use */
3147 dwDefaultAttr = FILE_ATTRIBUTE_SYSTEM;
3148
3149 if ((dwAttr = GetFileAttributesW(lpszPath)) == INVALID_FILE_ATTRIBUTES)
3150 return FALSE;
3151
3152 /* Change file attributes to system attributes */
3154 return SetFileAttributesW(lpszPath, dwAttr | dwDefaultAttr);
3155}
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
static BOOL SHLWAPI_UseSystemForSystemFolders(void)
Definition: path.c:3076
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703

Referenced by PathMakeSystemFolderA(), and SHCreatePropertyBagOnProfileSection().

◆ PathMatchSingleMaskA()

static BOOL PathMatchSingleMaskA ( LPCSTR  name,
LPCSTR  mask 
)
static

Definition at line 1859 of file path.c.

1860{
1861 while (*name && *mask && *mask!=';')
1862 {
1863 if (*mask == '*')
1864 {
1865 do
1866 {
1868 return TRUE; /* try substrings */
1869 } while (*name++);
1870 return FALSE;
1871 }
1872
1873 if (toupper(*mask) != toupper(*name) && *mask != '?')
1874 return FALSE;
1875
1876 name = CharNextA(name);
1877 mask = CharNextA(mask);
1878 }
1879
1880 if (!*name)
1881 {
1882 while (*mask == '*')
1883 mask++;
1884 if (!*mask || *mask == ';')
1885 return TRUE;
1886 }
1887 return FALSE;
1888}
int toupper(int c)
Definition: utclib.c:881
static BOOL PathMatchSingleMaskA(LPCSTR name, LPCSTR mask)
Definition: path.c:1859
GLenum GLint GLuint mask
Definition: glext.h:6028

Referenced by PathMatchSingleMaskA(), and PathMatchSpecA().

◆ PathMatchSingleMaskW()

static BOOL PathMatchSingleMaskW ( LPCWSTR  name,
LPCWSTR  mask 
)
static

Definition at line 1893 of file path.c.

1894{
1895 while (*name && *mask && *mask != ';')
1896 {
1897 if (*mask == '*')
1898 {
1899 do
1900 {
1902 return TRUE; /* try substrings */
1903 } while (*name++);
1904 return FALSE;
1905 }
1906
1907 if (toupperW(*mask) != toupperW(*name) && *mask != '?')
1908 return FALSE;
1909
1910 name++;
1911 mask++;
1912 }
1913 if (!*name)
1914 {
1915 while (*mask == '*')
1916 mask++;
1917 if (!*mask || *mask == ';')
1918 return TRUE;
1919 }
1920 return FALSE;
1921}
static BOOL PathMatchSingleMaskW(LPCWSTR name, LPCWSTR mask)
Definition: path.c:1893
#define toupperW(n)
Definition: unicode.h:51

Referenced by PathMatchSingleMaskW(), and PathMatchSpecW().

◆ PathMatchSpecA()

BOOL WINAPI PathMatchSpecA ( LPCSTR  lpszPath,
LPCSTR  lpszMask 
)

Definition at line 1941 of file path.c.

1942{
1943 TRACE("(%s,%s)\n", lpszPath, lpszMask);
1944
1945 if (!lstrcmpA(lpszMask, "*.*"))
1946 return TRUE; /* Matches every path */
1947
1948 while (*lpszMask)
1949 {
1950 while (*lpszMask == ' ')
1951 lpszMask++; /* Eat leading spaces */
1952
1953 if (PathMatchSingleMaskA(lpszPath, lpszMask))
1954 return TRUE; /* Matches the current mask */
1955
1956 while (*lpszMask && *lpszMask != ';')
1957 lpszMask = CharNextA(lpszMask); /* masks separated by ';' */
1958
1959 if (*lpszMask == ';')
1960 lpszMask++;
1961 }
1962 return FALSE;
1963}
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4195

Referenced by ATL::CPathT< StringType >::PathMatchSpecX(), and test_PathMatchSpec().

◆ PathMatchSpecW()

BOOL WINAPI PathMatchSpecW ( LPCWSTR  lpszPath,
LPCWSTR  lpszMask 
)

Definition at line 1970 of file path.c.

1971{
1972 static const WCHAR szStarDotStar[] = { '*', '.', '*', '\0' };
1973
1974 TRACE("(%s,%s)\n", debugstr_w(lpszPath), debugstr_w(lpszMask));
1975
1976 if (!lstrcmpW(lpszMask, szStarDotStar))
1977 return TRUE; /* Matches every path */
1978
1979 while (*lpszMask)
1980 {
1981 while (*lpszMask == ' ')
1982 lpszMask++; /* Eat leading spaces */
1983
1984 if (PathMatchSingleMaskW(lpszPath, lpszMask))
1985 return TRUE; /* Matches the current path */
1986
1987 while (*lpszMask && *lpszMask != ';')
1988 lpszMask++; /* masks separated by ';' */
1989
1990 if (*lpszMask == ';')
1991 lpszMask++;
1992 }
1993 return FALSE;
1994}
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243

Referenced by FileNameMatch(), FTP_ParseNextFile(), ICommDlgBrowser3_fnIncludeObject(), IShellBrowserImpl_ICommDlgBrowser_IncludeObject(), on_command_filetype(), and ATL::CPathT< StringType >::PathMatchSpecX().

◆ PathParseIconLocationA()

int WINAPI PathParseIconLocationA ( LPSTR  lpszPath)

Definition at line 1073 of file path.c.

1074{
1075 int iRet = 0;
1076 LPSTR lpszComma;
1077
1078 TRACE("(%s)\n", debugstr_a(lpszPath));
1079
1080 if (lpszPath)
1081 {
1082 if ((lpszComma = strchr(lpszPath, ',')))
1083 {
1084 *lpszComma++ = '\0';
1085 iRet = StrToIntA(lpszComma);
1086 }
1087 PathUnquoteSpacesA(lpszPath);
1088 PathRemoveBlanksA(lpszPath);
1089 }
1090 return iRet;
1091}
char * strchr(const char *String, int ch)
Definition: utclib.c:501
INT WINAPI StrToIntA(LPCSTR lpszStr)
Definition: string.c:370
VOID WINAPI PathUnquoteSpacesA(LPSTR lpszPath)
Definition: path.c:1018
void WINAPI PathRemoveBlanksA(LPSTR pszPath)
Definition: path.c:894

◆ PathParseIconLocationW()

int WINAPI PathParseIconLocationW ( LPWSTR  lpszPath)

Definition at line 1098 of file path.c.

1099{
1100 int iRet = 0;
1101 LPWSTR lpszComma;
1102
1103 TRACE("(%s)\n", debugstr_w(lpszPath));
1104
1105 if (lpszPath)
1106 {
1107 if ((lpszComma = StrChrW(lpszPath, ',')))
1108 {
1109 *lpszComma++ = '\0';
1110 iRet = StrToIntW(lpszComma);
1111 }
1112 PathUnquoteSpacesW(lpszPath);
1113 PathRemoveBlanksW(lpszPath);
1114 }
1115 return iRet;
1116}
INT WINAPI StrToIntW(LPCWSTR lpString)
Definition: string.c:407
void WINAPI PathRemoveBlanksW(LPWSTR pszPath)
Definition: path.c:923
VOID WINAPI PathUnquoteSpacesW(LPWSTR lpszPath)
Definition: path.c:1040

Referenced by AsyncLoadIconProc(), GetFileTypeIconsEx(), getIconLocationForDrive(), getIconLocationForFolder(), and CFileDefExt::InitFolderCustomizePage().

◆ PathQuoteSpacesA()

VOID WINAPI PathQuoteSpacesA ( LPSTR  lpszPath)

Definition at line 961 of file path.c.

962{
963 TRACE("(%s)\n", debugstr_a(lpszPath));
964
965 if(lpszPath && StrChrA(lpszPath,' '))
966 {
967 size_t iLen = strlen(lpszPath) + 1;
968
969 if (iLen + 2 < MAX_PATH)
970 {
971 memmove(lpszPath + 1, lpszPath, iLen);
972 lpszPath[0] = '"';
973 lpszPath[iLen] = '"';
974 lpszPath[iLen + 1] = '\0';
975 }
976 }
977}
#define memmove(s1, s2, n)
Definition: mkisofs.h:881

Referenced by ATL::CPathT< StringType >::PathQuoteSpacesX().

◆ PathQuoteSpacesW()

VOID WINAPI PathQuoteSpacesW ( LPWSTR  lpszPath)

Definition at line 984 of file path.c.

985{
986 TRACE("(%s)\n", debugstr_w(lpszPath));
987
988 if(lpszPath && StrChrW(lpszPath,' '))
989 {
990 int iLen = strlenW(lpszPath) + 1;
991
992 if (iLen + 2 < MAX_PATH)
993 {
994 memmove(lpszPath + 1, lpszPath, iLen * sizeof(WCHAR));
995 lpszPath[0] = '"';
996 lpszPath[iLen] = '"';
997 lpszPath[iLen + 1] = '\0';
998 }
999 }
1000}

Referenced by ATL::CPathT< StringType >::PathQuoteSpacesX(), and RunFontViewer().

◆ PathRelativePathToA()

BOOL WINAPI PathRelativePathToA ( LPSTR  lpszPath,
LPCSTR  lpszFrom,
DWORD  dwAttrFrom,
LPCSTR  lpszTo,
DWORD  dwAttrTo 
)

Definition at line 3552 of file path.c.

3554{
3555 BOOL bRet = FALSE;
3556
3557 TRACE("(%p,%s,0x%08x,%s,0x%08x)\n", lpszPath, debugstr_a(lpszFrom),
3558 dwAttrFrom, debugstr_a(lpszTo), dwAttrTo);
3559
3560 if(lpszPath && lpszFrom && lpszTo)
3561 {
3563 WCHAR szFrom[MAX_PATH];
3564 WCHAR szTo[MAX_PATH];
3565 MultiByteToWideChar(CP_ACP,0,lpszFrom,-1,szFrom,MAX_PATH);
3566 MultiByteToWideChar(CP_ACP,0,lpszTo,-1,szTo,MAX_PATH);
3567 bRet = PathRelativePathToW(szPath,szFrom,dwAttrFrom,szTo,dwAttrTo);
3568 WideCharToMultiByte(CP_ACP,0,szPath,-1,lpszPath,MAX_PATH,0,0);
3569 }
3570 return bRet;
3571}
BOOL WINAPI PathRelativePathToW(LPWSTR lpszPath, LPCWSTR lpszFrom, DWORD dwAttrFrom, LPCWSTR lpszTo, DWORD dwAttrTo)
Definition: path.c:3578

Referenced by ATL::CPathT< StringType >::PathRelativePathToX().

◆ PathRelativePathToW()

BOOL WINAPI PathRelativePathToW ( LPWSTR  lpszPath,
LPCWSTR  lpszFrom,
DWORD  dwAttrFrom,
LPCWSTR  lpszTo,
DWORD  dwAttrTo 
)

Definition at line 3578 of file path.c.

3580{
3581 static const WCHAR szPrevDirSlash[] = { '.', '.', '\\', '\0' };
3582 static const WCHAR szPrevDir[] = { '.', '.', '\0' };
3583 WCHAR szFrom[MAX_PATH];
3584 WCHAR szTo[MAX_PATH];
3585 DWORD dwLen;
3586
3587 TRACE("(%p,%s,0x%08x,%s,0x%08x)\n", lpszPath, debugstr_w(lpszFrom),
3588 dwAttrFrom, debugstr_w(lpszTo), dwAttrTo);
3589
3590 if(!lpszPath || !lpszFrom || !lpszTo)
3591 return FALSE;
3592
3593 *lpszPath = '\0';
3594 lstrcpynW(szFrom, lpszFrom, MAX_PATH);
3595 lstrcpynW(szTo, lpszTo, MAX_PATH);
3596
3597 if(!(dwAttrFrom & FILE_ATTRIBUTE_DIRECTORY))
3598 PathRemoveFileSpecW(szFrom);
3599 if(!(dwAttrTo & FILE_ATTRIBUTE_DIRECTORY))
3600 PathRemoveFileSpecW(szTo);
3601
3602 /* Paths can only be relative if they have a common root */
3603 if(!(dwLen = PathCommonPrefixW(szFrom, szTo, 0)))
3604 return FALSE;
3605
3606 /* Strip off lpszFrom components to the root, by adding "..\" */
3607 lpszFrom = szFrom + dwLen;
3608 if (!*lpszFrom)
3609 {
3610 lpszPath[0] = '.';
3611 lpszPath[1] = '\0';
3612 }
3613 if (*lpszFrom == '\\')
3614 lpszFrom++;
3615
3616 while (*lpszFrom)
3617 {
3618 lpszFrom = PathFindNextComponentW(lpszFrom);
3619 strcatW(lpszPath, *lpszFrom ? szPrevDirSlash : szPrevDir);
3620 }
3621
3622 /* From the root add the components of lpszTo */
3623 lpszTo += dwLen;
3624 /* We check lpszTo[-1] to avoid skipping end of string. See the notes for
3625 * this function.
3626 */
3627 if (*lpszTo && lpszTo[-1])
3628 {
3629 if (*lpszTo != '\\')
3630 lpszTo--;
3631 dwLen = strlenW(lpszPath);
3632 if (dwLen + strlenW(lpszTo) >= MAX_PATH)
3633 {
3634 *lpszPath = '\0';
3635 return FALSE;
3636 }
3637 strcpyW(lpszPath + dwLen, lpszTo);
3638 }
3639 return TRUE;
3640}
BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
Definition: path.c:629
LPWSTR WINAPI PathFindNextComponentW(LPCWSTR lpszPath)
Definition: path.c:2585

Referenced by PathRelativePathToA(), and ATL::CPathT< StringType >::PathRelativePathToX().

◆ PathRemoveArgsA()

void WINAPI PathRemoveArgsA ( LPSTR  lpszPath)

Definition at line 756 of file path.c.

757{
758 TRACE("(%s)\n",debugstr_a(lpszPath));
759
760 if(lpszPath)
761 {
762 LPSTR lpszArgs = PathGetArgsA(lpszPath);
763 if (*lpszArgs)
764 lpszArgs[-1] = '\0';
765 else
766 {
767 LPSTR lpszLastChar = CharPrevA(lpszPath, lpszArgs);
768 if(*lpszLastChar == ' ')
769 *lpszLastChar = '\0';
770 }
771 }
772}
LPSTR WINAPI PathGetArgsA(LPCSTR lpszPath)
Definition: path.c:481
LPSTR WINAPI CharPrevA(_In_ LPCSTR, _In_ LPCSTR)

Referenced by ATL::CPathT< StringType >::PathRemoveArgsX().

◆ PathRemoveArgsW()

void WINAPI PathRemoveArgsW ( LPWSTR  lpszPath)

Definition at line 779 of file path.c.

780{
781 TRACE("(%s)\n",debugstr_w(lpszPath));
782
783 if(lpszPath)
784 {
785 LPWSTR lpszArgs = PathGetArgsW(lpszPath);
786 if (*lpszArgs || (lpszArgs > lpszPath && lpszArgs[-1] == ' '))
787 lpszArgs[-1] = '\0';
788 }
789}
LPWSTR WINAPI PathGetArgsW(LPCWSTR lpszPath)
Definition: path.c:506

Referenced by RunOnceExEntry::Exec(), CAddressEditBox::ExecuteCommandLine(), CShellLink::OnNotify(), OpensWithExplorer(), ATL::CPathT< StringType >::PathRemoveArgsX(), SHELL_execute(), SHELL_translate_idlist(), and WelcomeDlgProc().

◆ PathRemoveBackslashA()

LPSTR WINAPI PathRemoveBackslashA ( LPSTR  lpszPath)

Definition at line 847 of file path.c.

848{
849 LPSTR szTemp = NULL;
850
851 TRACE("(%s)\n", debugstr_a(lpszPath));
852
853 if(lpszPath)
854 {
855 szTemp = CharPrevA(lpszPath, lpszPath + strlen(lpszPath));
856 if (!PathIsRootA(lpszPath) && *szTemp == '\\')
857 *szTemp = '\0';
858 }
859 return szTemp;
860}
BOOL WINAPI PathIsRootA(LPCSTR lpszPath)
Definition: path.c:1608

Referenced by ATL::CPathT< StringType >::PathRemoveBackslashX().

◆ PathRemoveBackslashW()

LPWSTR WINAPI PathRemoveBackslashW ( LPWSTR  lpszPath)

Definition at line 867 of file path.c.

868{
869 LPWSTR szTemp = NULL;
870
871 TRACE("(%s)\n", debugstr_w(lpszPath));
872
873 if(lpszPath)
874 {
875 szTemp = lpszPath + strlenW(lpszPath);
876 if (szTemp > lpszPath) szTemp--;
877 if (!PathIsRootW(lpszPath) && *szTemp == '\\')
878 *szTemp = '\0';
879 }
880 return szTemp;
881}
BOOL WINAPI PathIsRootW(LPCWSTR lpszPath)
Definition: path.c:1648

Referenced by dialog_update_directory_combo(), CFileDefExt::InitFilePath(), PathQualifyExW(), ATL::CPathT< StringType >::PathRemoveBackslashX(), and SHGetFolderPathAndSubDirW().

◆ PathRemoveBlanksA()

void WINAPI PathRemoveBlanksA ( LPSTR  pszPath)

Definition at line 894 of file path.c.

895{
897
898 TRACE("(%s)\n", debugstr_a(pszPath));
899
900 if (!pszPath || !*pszPath)
901 return;
902
903 start = first = pszPath;
904
905 while (*pszPath == ' ')
906 pszPath = CharNextA(pszPath);
907
908 while (*pszPath)
909 *start++ = *pszPath++;
910
911 if (start != first)
912 while (start[-1] == ' ')
913 start--;
914
915 *start = '\0';
916}
GLuint start
Definition: gl.h:1545
const GLint * first
Definition: glext.h:5794

Referenced by PathParseIconLocationA(), ATL::CPathT< StringType >::PathRemoveBlanksX(), and test_PathRemoveBlanks().

◆ PathRemoveBlanksW()

void WINAPI PathRemoveBlanksW ( LPWSTR  pszPath)

Definition at line 923 of file path.c.

924{
926
927 TRACE("(%s)\n", debugstr_w(pszPath));
928
929 if (!pszPath || !*pszPath)
930 return;
931
932 start = first = pszPath;
933
934 while (*pszPath == ' ')
935 pszPath++;
936
937 while (*pszPath)
938 *start++ = *pszPath++;
939
940 if (start != first)
941 while (start[-1] == ' ')
942 start--;
943
944 *start = '\0';
945}

Referenced by PathParseIconLocationW(), ATL::CPathT< StringType >::PathRemoveBlanksX(), RouteTheCallW(), SHELL_FindExecutable(), and test_PathRemoveBlanks().

◆ PathRemoveExtensionA()

void WINAPI PathRemoveExtensionA ( LPSTR  lpszPath)

Definition at line 806 of file path.c.

807{
808 TRACE("(%s)\n", debugstr_a(lpszPath));
809
810 if (lpszPath)
811 {
812 lpszPath = PathFindExtensionA(lpszPath);
813 if (lpszPath && *lpszPath != '\0')
814 *lpszPath = '\0';
815 }
816}

Referenced by ATL::CPathT< StringType >::PathRemoveExtensionX().

◆ PathRemoveExtensionW()

◆ PathRemoveFileSpecA()

BOOL WINAPI PathRemoveFileSpecA ( LPSTR  lpszPath)

Definition at line 586 of file path.c.

587{
588 LPSTR lpszFileSpec = lpszPath;
589 BOOL bModified = FALSE;
590
591 TRACE("(%s)\n",debugstr_a(lpszPath));
592
593 if(lpszPath)
594 {
595 /* Skip directory or UNC path */
596 if (*lpszPath == '\\')
597 lpszFileSpec = ++lpszPath;
598 if (*lpszPath == '\\')
599 lpszFileSpec = ++lpszPath;
600
601 while (*lpszPath)
602 {
603 if(*lpszPath == '\\')
604 lpszFileSpec = lpszPath; /* Skip dir */
605 else if(*lpszPath == ':')
606 {
607 lpszFileSpec = ++lpszPath; /* Skip drive */
608 if (*lpszPath == '\\')
609 lpszFileSpec++;
610 }
611 if (!(lpszPath = CharNextA(lpszPath)))
612 break;
613 }
614
615 if (*lpszFileSpec)
616 {
617 *lpszFileSpec = '\0';
618 bModified = TRUE;
619 }
620 }
621 return bModified;
622}

Referenced by PathRemoveFileSpecAW(), ATL::CPathT< StringType >::PathRemoveFileSpecX(), and PathStripToRootA().

◆ PathRemoveFileSpecW()

BOOL WINAPI PathRemoveFileSpecW ( LPWSTR  lpszPath)

Definition at line 629 of file path.c.

630{
631 LPWSTR lpszFileSpec = lpszPath;
632 BOOL bModified = FALSE;
633
634 TRACE("(%s)\n",debugstr_w(lpszPath));
635
636 if(lpszPath)
637 {
638 /* Skip directory or UNC path */
639 if (*lpszPath == '\\')
640 lpszFileSpec = ++lpszPath;
641 if (*lpszPath == '\\')
642 lpszFileSpec = ++lpszPath;
643
644 while (*lpszPath)
645 {
646 if(*lpszPath == '\\')
647 lpszFileSpec = lpszPath; /* Skip dir */
648 else if(*lpszPath == ':')
649 {
650 lpszFileSpec = ++lpszPath; /* Skip drive */
651 if (*lpszPath == '\\')
652 lpszFileSpec++;
653 }
654 lpszPath++;
655 }
656
657 if (*lpszFileSpec)
658 {
659 *lpszFileSpec = '\0';
660 bModified = TRUE;
661 }
662 }
663 return bModified;
664}

Referenced by CFSDropTarget::_CopyItems(), CDirectoryList::AddPathsFromDirectory(), DoBuildFilesAndDirs(), DoDeleteSpecW(), DoGetBaseName(), DoTestEntry(), CDeskLinkDropHandler::Drop(), CZipExtract::Extract(), FileCompareBothWild(), FileCompareOneSideWild(), FileCompareWildTitle(), FindSubProgram(), FinishDlgProc(), GetItemOriginalFolder(), CShellLink::OnInitDialog(), PathQualifyExW(), PathRelativePathToW(), PathRemoveFileSpecAW(), ATL::CPathT< StringType >::PathRemoveFileSpecX(), PathStripToRootW(), pBuildFileList(), search_dr(), search_file(), SHCreatePropertyBagOnProfileSection(), and SHGetShellStyleHInstance().

◆ PathRenameExtensionA()

BOOL WINAPI PathRenameExtensionA ( LPSTR  lpszPath,
LPCSTR  lpszExt 
)

Definition at line 3170 of file path.c.

3171{
3172 LPSTR lpszExtension;
3173
3174 TRACE("(%s,%s)\n", debugstr_a(lpszPath), debugstr_a(lpszExt));
3175
3176 lpszExtension = PathFindExtensionA(lpszPath);
3177
3178 if (!lpszExtension || (lpszExtension - lpszPath + strlen(lpszExt) >= MAX_PATH))
3179 return FALSE;
3180
3181 strcpy(lpszExtension, lpszExt);
3182 return TRUE;
3183}

◆ PathRenameExtensionW()

BOOL WINAPI PathRenameExtensionW ( LPWSTR  lpszPath,
LPCWSTR  lpszExt 
)

Definition at line 3190 of file path.c.

3191{
3192 LPWSTR lpszExtension;
3193
3194 TRACE("(%s,%s)\n", debugstr_w(lpszPath), debugstr_w(lpszExt));
3195
3196 lpszExtension = PathFindExtensionW(lpszPath);
3197
3198 if (!lpszExtension || (lpszExtension - lpszPath + strlenW(lpszExt) >= MAX_PATH))
3199 return FALSE;
3200
3201 strcpyW(lpszExtension, lpszExt);
3202 return TRUE;
3203}

◆ PathSearchAndQualifyA()

BOOL WINAPI PathSearchAndQualifyA ( LPCSTR  lpszPath,
LPSTR  lpszBuf,
UINT  cchBuf 
)

Definition at line 3218 of file path.c.

3219{
3220 TRACE("(%s,%p,0x%08x)\n", debugstr_a(lpszPath), lpszBuf, cchBuf);
3221
3222 if(SearchPathA(NULL, lpszPath, NULL, cchBuf, lpszBuf, NULL))
3223 return TRUE;
3224 return !!GetFullPathNameA(lpszPath, cchBuf, lpszBuf, NULL);
3225}
DWORD WINAPI SearchPathA(IN LPCSTR lpPath OPTIONAL, IN LPCSTR lpFileName, IN LPCSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart OPTIONAL)
Definition: path.c:1123
DWORD WINAPI GetFullPathNameA(IN LPCSTR lpFileName, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart)
Definition: path.c:993

◆ PathSearchAndQualifyW()

BOOL WINAPI PathSearchAndQualifyW ( LPCWSTR  lpszPath,
LPWSTR  lpszBuf,
UINT  cchBuf 
)

Definition at line 3232 of file path.c.

3233{
3234 TRACE("(%s,%p,0x%08x)\n", debugstr_w(lpszPath), lpszBuf, cchBuf);
3235
3236 if(SearchPathW(NULL, lpszPath, NULL, cchBuf, lpszBuf, NULL))
3237 return TRUE;
3238 return !!GetFullPathNameW(lpszPath, cchBuf, lpszBuf, NULL);
3239}
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1298
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106

Referenced by create_uri(), and test_PathSearchAndQualify().

◆ PathSetDlgItemPathA()

VOID WINAPI PathSetDlgItemPathA ( HWND  hDlg,
int  id,
LPCSTR  lpszPath 
)

Definition at line 3707 of file path.c.

3708{
3710
3711 TRACE("(%p,%8x,%s)\n",hDlg, id, debugstr_a(lpszPath));
3712
3713 if (lpszPath)
3715 else
3716 szPath[0] = '\0';
3717 PathSetDlgItemPathW(hDlg, id, szPath);
3718}
VOID WINAPI PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR lpszPath)
Definition: path.c:3725

◆ PathSetDlgItemPathW()

VOID WINAPI PathSetDlgItemPathW ( HWND  hDlg,
int  id,
LPCWSTR  lpszPath 
)

Definition at line 3725 of file path.c.

3726{
3727 WCHAR path[MAX_PATH + 1];
3728 HWND hwItem;
3729 RECT rect;
3730 HDC hdc;
3731 HGDIOBJ hPrevObj;
3732
3733 TRACE("(%p,%8x,%s)\n",hDlg, id, debugstr_w(lpszPath));
3734
3735 if (!(hwItem = GetDlgItem(hDlg, id)))
3736 return;
3737
3738 if (lpszPath)
3739 lstrcpynW(path, lpszPath, sizeof(path) / sizeof(WCHAR));
3740 else
3741 path[0] = '\0';
3742
3743 GetClientRect(hwItem, &rect);
3744 hdc = GetDC(hDlg);
3745 hPrevObj = SelectObject(hdc, (HGDIOBJ)SendMessageW(hwItem,WM_GETFONT,0,0));
3746
3747 if (hPrevObj)
3748 {
3749 PathCompactPathW(hdc, path, rect.right);
3750 SelectObject(hdc, hPrevObj);
3751 }
3752
3753 ReleaseDC(hDlg, hdc);
3754 SetWindowTextW(hwItem, path);
3755}
& rect
Definition: startmenu.cpp:1413
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define WM_GETFONT
Definition: winuser.h:1654
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by PathSetDlgItemPathA().

◆ PathSkipRootA()

LPSTR WINAPI PathSkipRootA ( LPCSTR  lpszPath)

Definition at line 3253 of file path.c.

3254{
3255 TRACE("(%s)\n", debugstr_a(lpszPath));
3256
3257 if (!lpszPath || !*lpszPath)
3258 return NULL;
3259
3260 if (*lpszPath == '\\' && lpszPath[1] == '\\')
3261 {
3262 /* Network share: skip share server and mount point */
3263 lpszPath += 2;
3264 if ((lpszPath = StrChrA(lpszPath, '\\')) &&
3265 (lpszPath = StrChrA(lpszPath + 1, '\\')))
3266 lpszPath++;
3267 return (LPSTR)lpszPath;
3268 }
3269
3270 if (IsDBCSLeadByte(*lpszPath))
3271 return NULL;
3272
3273 /* Check x:\ */
3274 if (lpszPath[0] && lpszPath[1] == ':' && lpszPath[2] == '\\')
3275 return (LPSTR)lpszPath + 3;
3276 return NULL;
3277}

Referenced by PathIsSameRootA(), and ATL::CPathT< StringType >::PathSkipRootX().

◆ PathSkipRootW()

LPWSTR WINAPI PathSkipRootW ( LPCWSTR  lpszPath)

Definition at line 3284 of file path.c.

3285{
3286 TRACE("(%s)\n", debugstr_w(lpszPath));
3287
3288 if (!lpszPath || !*lpszPath)
3289 return NULL;
3290
3291 if (*lpszPath == '\\' && lpszPath[1] == '\\')
3292 {
3293 /* Network share: skip share server and mount point */
3294 lpszPath += 2;
3295 if ((lpszPath = StrChrW(lpszPath, '\\')) &&
3296 (lpszPath = StrChrW(lpszPath + 1, '\\')))
3297 lpszPath++;
3298 return (LPWSTR)lpszPath;
3299 }
3300
3301 /* Check x:\ */
3302 if (lpszPath[0] && lpszPath[1] == ':' && lpszPath[2] == '\\')
3303 return (LPWSTR)lpszPath + 3;
3304 return NULL;
3305}

Referenced by PathIsSameRootW(), and ATL::CPathT< StringType >::PathSkipRootX().

◆ PathStripPathA()

void WINAPI PathStripPathA ( LPSTR  lpszPath)

Definition at line 677 of file path.c.

678{
679 TRACE("(%s)\n", debugstr_a(lpszPath));
680
681 if (lpszPath)
682 {
683 LPSTR lpszFileName = PathFindFileNameA(lpszPath);
684 if(lpszFileName != lpszPath)
685 RtlMoveMemory(lpszPath, lpszFileName, strlen(lpszFileName)+1);
686 }
687}
LPSTR WINAPI PathFindFileNameA(LPCSTR lpszPath)
Definition: path.c:373
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264

Referenced by ATL::CPathT< StringType >::PathStripPathX(), SHAddToRecentDocs(), and test_PathStripPathA().

◆ PathStripPathW()

void WINAPI PathStripPathW ( LPWSTR  lpszPath)

Definition at line 694 of file path.c.

695{
696 LPWSTR lpszFileName;
697
698 TRACE("(%s)\n", debugstr_w(lpszPath));
699 lpszFileName = PathFindFileNameW(lpszPath);
700 if(lpszFileName != lpszPath)
701 RtlMoveMemory(lpszPath, lpszFileName, (strlenW(lpszFileName)+1)*sizeof(WCHAR));
702}

Referenced by dialog_update_directory_combo(), CZipExtract::Extract(), CQueryAssociations::GetString(), ATL::CPathT< StringType >::PathStripPathX(), and TestModuleRegistry().

◆ PathStripToRootA()

BOOL WINAPI PathStripToRootA ( LPSTR  lpszPath)

Definition at line 716 of file path.c.

717{
718 TRACE("(%s)\n", debugstr_a(lpszPath));
719
720 if (!lpszPath)
721 return FALSE;
722 while(!PathIsRootA(lpszPath))
723 if (!PathRemoveFileSpecA(lpszPath))
724 return FALSE;
725 return TRUE;
726}
BOOL WINAPI PathRemoveFileSpecA(LPSTR lpszPath)
Definition: path.c:586

Referenced by ATL::CPathT< StringType >::PathStripToRootX().

◆ PathStripToRootW()

BOOL WINAPI PathStripToRootW ( LPWSTR  lpszPath)

Definition at line 733 of file path.c.

734{
735 TRACE("(%s)\n", debugstr_w(lpszPath));
736
737 if (!lpszPath)
738 return FALSE;
739 while(!PathIsRootW(lpszPath))
740 if (!PathRemoveFileSpecW(lpszPath))
741 return FALSE;
742 return TRUE;
743}

Referenced by get_drive_type(), IsLFNDriveW(), PathCombineW(), PathQualifyExW(), ATL::CPathT< StringType >::PathStripToRootX(), SHELL_execute(), SHExplorerParseCmdLine(), source_matches_volume(), START_TEST(), test_sei_lpIDList(), and TRASH_CanTrashFile().

◆ PathUndecorateA()

void WINAPI PathUndecorateA ( LPSTR  pszPath)

Definition at line 4070 of file path.c.

4071{
4072 char *ext, *skip;
4073
4074 TRACE("(%s)\n", debugstr_a(pszPath));
4075
4076 if (!pszPath) return;
4077
4078 ext = PathFindExtensionA(pszPath);
4079 if (ext == pszPath || ext[-1] != ']') return;
4080
4081 skip = ext - 2;
4082 while (skip > pszPath && '0' <= *skip && *skip <= '9')
4083 skip--;
4084
4085 if (skip > pszPath && *skip == '[' && skip[-1] != '\\')
4086 memmove(skip, ext, strlen(ext) + 1);
4087}
#define skip(...)
Definition: atltest.h:64
static const WCHAR *const ext[]
Definition: module.c:53

Referenced by test_PathUndecorate().

◆ PathUndecorateW()

void WINAPI PathUndecorateW ( LPWSTR  pszPath)

Definition at line 4094 of file path.c.

4095{
4096 WCHAR *ext, *skip;
4097
4098 TRACE("(%s)\n", debugstr_w(pszPath));
4099
4100 if (!pszPath) return;
4101
4102 ext = PathFindExtensionW(pszPath);
4103 if (ext == pszPath || ext[-1] != ']') return;
4104
4105 skip = ext - 2;
4106 while (skip > pszPath && '0' <= *skip && *skip <= '9')
4107 skip--;
4108
4109 if (skip > pszPath && *skip == '[' && skip[-1] != '\\')
4110 memmove(skip, ext, (wcslen(ext) + 1) * sizeof(WCHAR));
4111}
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by test_PathUndecorate().

◆ PathUnExpandEnvStringsA()

BOOL WINAPI PathUnExpandEnvStringsA ( LPCSTR  path,
LPSTR  buffer,
UINT  buf_len 
)

Definition at line 4128 of file path.c.

4129{
4130 WCHAR bufferW[MAX_PATH], *pathW;
4131 DWORD len;
4132 BOOL ret;
4133
4134 TRACE("(%s, %p, %d)\n", debugstr_a(path), buffer, buf_len);
4135
4136 pathW = heap_strdupAtoW(path);
4137 if (!pathW) return FALSE;
4138
4139 ret = PathUnExpandEnvStringsW(pathW, bufferW, MAX_PATH);
4140 HeapFree(GetProcessHeap(), 0, pathW);
4141 if (!ret) return FALSE;
4142
4143 len = WideCharToMultiByte(CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL);
4144 if (buf_len < len + 1) return FALSE;
4145
4146 WideCharToMultiByte(CP_ACP, 0, bufferW, -1, buffer, buf_len, NULL, NULL);
4147 return TRUE;
4148}
BOOL WINAPI PathUnExpandEnvStringsW(LPCWSTR path, LPWSTR buffer, UINT buf_len)
Definition: path.c:4181
static WCHAR * heap_strdupAtoW(LPCSTR str)
Definition: path.c:73
GLuint buffer
Definition: glext.h:5915

◆ PathUnExpandEnvStringsW()

BOOL WINAPI PathUnExpandEnvStringsW ( LPCWSTR  path,
LPWSTR  buffer,
UINT  buf_len 
)

Definition at line 4181 of file path.c.

4182{
4183 static struct envvars_map null_var = {NULL, 0, {0}, 0};
4184 struct envvars_map *match = &null_var, *cur;
4185 struct envvars_map envvars[] = {
4186 { allusersprofileW, sizeof(allusersprofileW)/sizeof(WCHAR) },
4187 { appdataW, sizeof(appdataW)/sizeof(WCHAR) },
4188 { programfilesW, sizeof(programfilesW)/sizeof(WCHAR) },
4189 { systemrootW, sizeof(systemrootW)/sizeof(WCHAR) },
4190 { systemdriveW, sizeof(systemdriveW)/sizeof(WCHAR) },
4191 { userprofileW, sizeof(userprofileW)/sizeof(WCHAR) },
4192 { NULL }
4193 };
4194 DWORD pathlen;
4195 UINT needed;
4196
4197 TRACE("(%s, %p, %d)\n", debugstr_w(path), buffer, buf_len);
4198
4199 pathlen = strlenW(path);
4200 init_envvars_map(envvars);
4201 cur = envvars;
4202 while (cur->var)
4203 {
4204 /* path can't contain expanded value or value wasn't retrieved */
4205 if (cur->len == 0 || cur->len > pathlen || strncmpiW(cur->path, path, cur->len))
4206 {
4207 cur++;
4208 continue;
4209 }
4210
4211 if (cur->len > match->len)
4212 match = cur;
4213 cur++;
4214 }
4215
4216 /* 'varlen' includes NULL termination char */
4217 needed = match->varlen + pathlen - match->len;
4218 if (match->len == 0 || needed > buf_len) return FALSE;
4219
4220 strcpyW(buffer, match->var);
4221 strcatW(buffer, &path[match->len]);
4222 TRACE("ret %s\n", debugstr_w(buffer));
4223
4224 return TRUE;
4225}
static const WCHAR userprofileW[]
Definition: path.c:4155
static const WCHAR systemdriveW[]
Definition: path.c:4154
static const WCHAR programfilesW[]
Definition: path.c:4152
static const WCHAR allusersprofileW[]
Definition: path.c:4150
static const WCHAR appdataW[]
Definition: path.c:4151
static void init_envvars_map(struct envvars_map *map)
Definition: path.c:4165
static const WCHAR systemrootW[]
Definition: path.c:4153
FxCollectionEntry * cur
#define strncmpiW(s1, s2, n)
Definition: unicode.h:46
Definition: match.c:28

Referenced by PathUnExpandEnvStringsA(), CShellLink::SetIconLocation(), and SHSetUnreadMailCountW().

◆ PathUnmakeSystemFolderA()

BOOL WINAPI PathUnmakeSystemFolderA ( LPCSTR  lpszPath)

Definition at line 3655 of file path.c.

3656{
3657 DWORD dwAttr;
3658
3659 TRACE("(%s)\n", debugstr_a(lpszPath));
3660
3661 if (!lpszPath || !*lpszPath || (dwAttr = GetFileAttributesA(lpszPath)) == INVALID_FILE_ATTRIBUTES ||
3662 !(dwAttr & FILE_ATTRIBUTE_DIRECTORY))
3663 return FALSE;
3664
3666 return SetFileAttributesA(lpszPath, dwAttr);
3667}
BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:776

◆ PathUnmakeSystemFolderW()

BOOL WINAPI PathUnmakeSystemFolderW ( LPCWSTR  lpszPath)

Definition at line 3674 of file path.c.

3675{
3676 DWORD dwAttr;
3677
3678 TRACE("(%s)\n", debugstr_w(lpszPath));
3679
3680 if (!lpszPath || !*lpszPath || (dwAttr = GetFileAttributesW(lpszPath)) == INVALID_FILE_ATTRIBUTES ||
3681 !(dwAttr & FILE_ATTRIBUTE_DIRECTORY))
3682 return FALSE;
3683
3685 return SetFileAttributesW(lpszPath, dwAttr);
3686}

◆ PathUnquoteSpacesA()

VOID WINAPI PathUnquoteSpacesA ( LPSTR  lpszPath)

Definition at line 1018 of file path.c.

1019{
1020 TRACE("(%s)\n", debugstr_a(lpszPath));
1021
1022 if (lpszPath && *lpszPath == '"')
1023 {
1024 DWORD dwLen = strlen(lpszPath) - 1;
1025
1026 if (lpszPath[dwLen] == '"')
1027 {
1028 lpszPath[dwLen] = '\0';
1029 for (; *lpszPath; lpszPath++)
1030 *lpszPath = lpszPath[1];
1031 }
1032 }
1033}

Referenced by HCR_RegGetIconA(), PathParseIconLocationA(), ATL::CPathT< StringType >::PathUnquoteSpacesX(), and test_PathUnquoteSpaces().

◆ PathUnquoteSpacesW()

VOID WINAPI PathUnquoteSpacesW ( LPWSTR  lpszPath)

Definition at line 1040 of file path.c.

1041{
1042 TRACE("(%s)\n", debugstr_w(lpszPath));
1043
1044 if (lpszPath && *lpszPath == '"')
1045 {
1046 DWORD dwLen = strlenW(lpszPath) - 1;
1047
1048 if (lpszPath[dwLen] == '"')
1049 {
1050 lpszPath[dwLen] = '\0';
1051 for (; *lpszPath; lpszPath++)
1052 *lpszPath = lpszPath[1];
1053 }
1054 }
1055}

Referenced by CFSExtractIcon_CreateInstance(), CAddressEditBox::ExecuteCommandLine(), HCR_RegGetIconW(), CFileDefExt::InitOpensWithField(), LanguagesPageProc(), CShellLink::OnNotify(), PathParseIconLocationW(), PathResolveW(), ATL::CPathT< StringType >::PathUnquoteSpacesX(), Preview_OnCreate(), CShellLink::SetPath(), SHELL_execute(), SHELL_translate_idlist(), ShellExec_RunDLL_Helper(), and test_PathUnquoteSpaces().

◆ SHGetWebFolderFilePathA()

HRESULT WINAPI SHGetWebFolderFilePathA ( LPCSTR  lpszFile,
LPSTR  lpszPath,
DWORD  dwPathLen 
)

Definition at line 4241 of file path.c.

4242{
4243 WCHAR szFile[MAX_PATH], szPath[MAX_PATH];
4244 HRESULT hRet;
4245
4246 TRACE("(%s,%p,%d)\n", lpszFile, lpszPath, dwPathLen);
4247
4248 MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, szFile, MAX_PATH);
4249 szPath[0] = '\0';
4250 hRet = SHGetWebFolderFilePathW(szFile, szPath, dwPathLen);
4251 WideCharToMultiByte(CP_ACP, 0, szPath, -1, lpszPath, dwPathLen, 0, 0);
4252 return hRet;
4253}
HRESULT WINAPI SHGetWebFolderFilePathW(LPCWSTR, LPWSTR, DWORD)
Definition: path.c:4260

◆ SHGetWebFolderFilePathW()

HRESULT WINAPI SHGetWebFolderFilePathW ( LPCWSTR  lpszFile,
LPWSTR  lpszPath,
DWORD  dwPathLen 
)

Definition at line 4260 of file path.c.

4261{
4262 static const WCHAR szWeb[] = {'\\','W','e','b','\\','\0'};
4263 static const WCHAR szWebMui[] = {'m','u','i','\\','%','0','4','x','\\','\0'};
4264#define szWebLen (sizeof(szWeb)/sizeof(WCHAR))
4265#define szWebMuiLen ((sizeof(szWebMui)+1)/sizeof(WCHAR))
4266 DWORD dwLen, dwFileLen;
4267 LANGID lidSystem, lidUser;
4268
4269 TRACE("(%s,%p,%d)\n", debugstr_w(lpszFile), lpszPath, dwPathLen);
4270
4271 /* Get base directory for web content */
4272 dwLen = GetSystemWindowsDirectoryW(lpszPath, dwPathLen);
4273 if (dwLen > 0 && lpszPath[dwLen-1] == '\\')
4274 dwLen--;
4275
4276 dwFileLen = strlenW(lpszFile);
4277
4278 if (dwLen + dwFileLen + szWebLen >= dwPathLen)
4279 return E_FAIL; /* lpszPath too short */
4280
4281 strcpyW(lpszPath+dwLen, szWeb);
4282 dwLen += szWebLen;
4283 dwPathLen = dwPathLen - dwLen; /* Remaining space */
4284
4285 lidSystem = GetSystemDefaultUILanguage();
4286 lidUser = GetUserDefaultUILanguage();
4287
4288 if (lidSystem != lidUser)
4289 {
4290 if (dwFileLen + szWebMuiLen < dwPathLen)
4291 {
4292 /* Use localised content in the users UI language if present */
4293 wsprintfW(lpszPath + dwLen, szWebMui, lidUser);
4294 strcpyW(lpszPath + dwLen + szWebMuiLen, lpszFile);
4295 if (PathFileExistsW(lpszPath))
4296 return S_OK;
4297 }
4298 }
4299
4300 /* Fall back to OS default installed content */
4301 strcpyW(lpszPath + dwLen, lpszFile);
4302 if (PathFileExistsW(lpszPath))
4303 return S_OK;
4304 return E_FAIL;
4305}
#define E_FAIL
Definition: ddrawi.h:102
UINT WINAPI GetSystemWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2397
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: locale.c:1375
LANGID WINAPI GetSystemDefaultUILanguage(void)
Definition: locale.c:1395
#define szWebMuiLen
#define szWebLen
USHORT LANGID
Definition: mui.h:9
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by SHGetWebFolderFilePathA().

◆ SHLWAPI_PathFindInOtherDirs()

static BOOL SHLWAPI_PathFindInOtherDirs ( LPWSTR  lpszFile,
DWORD  dwWhich 
)
static

Definition at line 1223 of file path.c.

1224{
1225 static const WCHAR szSystem[] = { 'S','y','s','t','e','m','\0'};
1226 static const WCHAR szPath[] = { 'P','A','T','H','\0'};
1227 DWORD dwLenPATH;
1228 LPCWSTR lpszCurr;
1229 WCHAR *lpszPATH;
1231
1232 TRACE("(%s,%08x)\n", debugstr_w(lpszFile), dwWhich);
1233
1234 /* Try system directories */
1236 if (!PathAppendW(buff, lpszFile))
1237 return FALSE;
1238 if (PathFileExistsDefExtW(buff, dwWhich))
1239 {
1240 strcpyW(lpszFile, buff);
1241 return TRUE;
1242 }
1244 if (!PathAppendW(buff, szSystem ) || !PathAppendW(buff, lpszFile))
1245 return FALSE;
1246 if (PathFileExistsDefExtW(buff, dwWhich))
1247 {
1248 strcpyW(lpszFile, buff);
1249 return TRUE;
1250 }
1252 if (!PathAppendW(buff, lpszFile))
1253 return FALSE;
1254 if (PathFileExistsDefExtW(buff, dwWhich))
1255 {
1256 strcpyW(lpszFile, buff);
1257 return TRUE;
1258 }
1259 /* Try dirs listed in %PATH% */
1261
1262 if (!dwLenPATH || !(lpszPATH = HeapAlloc(GetProcessHeap(), 0, (dwLenPATH + 1) * sizeof (WCHAR))))
1263 return FALSE;
1264
1265 GetEnvironmentVariableW(szPath, lpszPATH, dwLenPATH + 1);
1266 lpszCurr = lpszPATH;
1267 while (lpszCurr)
1268 {
1269 LPCWSTR lpszEnd = lpszCurr;
1270 LPWSTR pBuff = buff;
1271
1272 while (*lpszEnd == ' ')
1273 lpszEnd++;
1274 while (*lpszEnd && *lpszEnd != ';')
1275 *pBuff++ = *lpszEnd++;
1276 *pBuff = '\0';
1277
1278 if (*lpszEnd)
1279 lpszCurr = lpszEnd + 1;
1280 else
1281 lpszCurr = NULL; /* Last Path, terminate after this */
1282
1283 if (!PathAppendW(buff, lpszFile))
1284 {
1285 HeapFree(GetProcessHeap(), 0, lpszPATH);
1286 return FALSE;
1287 }
1288 if (PathFileExistsDefExtW(buff, dwWhich))
1289 {
1290 strcpyW(lpszFile, buff);
1291 HeapFree(GetProcessHeap(), 0, lpszPATH);
1292 return TRUE;
1293 }
1294 }
1295 HeapFree(GetProcessHeap(), 0, lpszPATH);
1296 return FALSE;
1297}
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:755
#define PathAppendW
Definition: pathcch.h:309

Referenced by PathFindOnPathExA(), and PathFindOnPathExW().

◆ SHLWAPI_UseSystemForSystemFolders()

static BOOL SHLWAPI_UseSystemForSystemFolders ( void  )
static

Definition at line 3076 of file path.c.

3077{
3078 static BOOL bCheckedReg = FALSE;
3079 static BOOL bUseSystemForSystemFolders = FALSE;
3080
3081 if (!bCheckedReg)
3082 {
3083 bCheckedReg = TRUE;
3084
3085 /* Key tells Win what file attributes to use on system folders */
3087 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
3088 "UseSystemForSystemFolders", 0, 0, 0))
3089 bUseSystemForSystemFolders = TRUE;
3090 }
3091 return bUseSystemForSystemFolders;
3092}
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by PathMakeSystemFolderW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ allusersprofileW

const WCHAR allusersprofileW[] = {'%','A','L','L','U','S','E','R','S','P','R','O','F','I','L','E','%',0}
static

Definition at line 4150 of file path.c.

Referenced by PathUnExpandEnvStringsW().

◆ appdataW

const WCHAR appdataW[] = {'%','A','P','P','D','A','T','A','%',0}
static

Definition at line 4151 of file path.c.

Referenced by PathUnExpandEnvStringsW().

◆ pIsNetDrive

fnpIsNetDrive pIsNetDrive
static

Definition at line 66 of file path.c.

Referenced by PathIsNetworkPathA(), and PathIsNetworkPathW().

◆ programfilesW

const WCHAR programfilesW[] = {'%','P','r','o','g','r','a','m','F','i','l','e','s','%',0}
static

Definition at line 4152 of file path.c.

Referenced by PathUnExpandEnvStringsW(), and test_StdRegProv().

◆ SHELL_charclass

const DWORD SHELL_charclass[]
static

◆ SHLWAPI_hshell32

HMODULE SHLWAPI_hshell32
static

Definition at line 62 of file path.c.

◆ systemdriveW

const WCHAR systemdriveW[] = {'%','S','y','s','t','e','m','D','r','i','v','e','%',0}
static

Definition at line 4154 of file path.c.

Referenced by PathUnExpandEnvStringsW(), and test_Win32_OperatingSystem().

◆ systemrootW

const WCHAR systemrootW[] = {'%','S','y','s','t','e','m','R','o','o','t','%',0}
static

Definition at line 4153 of file path.c.

Referenced by create_file_test(), and PathUnExpandEnvStringsW().

◆ userprofileW

const WCHAR userprofileW[] = {'%','U','S','E','R','P','R','O','F','I','L','E','%',0}
static

Definition at line 4155 of file path.c.

Referenced by PathUnExpandEnvStringsW().