#include <stdarg.h>
#include <string.h>
#include <windef.h>
#include <winbase.h>
#include <pathcch.h>
#include <strsafe.h>
#include "wine/debug.h"
Go to the source code of this file.
|
| WINE_DEFAULT_DEBUG_CHANNEL (path) |
|
static BOOL | is_drive_spec (const WCHAR *str) |
|
static BOOL | is_prefixed_unc (const WCHAR *string) |
|
static BOOL | is_prefixed_disk (const WCHAR *string) |
|
static BOOL | is_prefixed_volume (const WCHAR *string) |
|
static BOOL | get_next_segment (const WCHAR *next, const WCHAR **next_segment) |
|
static const WCHAR * | get_root_end (const WCHAR *path) |
|
HRESULT WINAPI | PathAllocCanonicalize (const WCHAR *path_in, DWORD flags, WCHAR **path_out) |
|
HRESULT WINAPI | PathAllocCombine (const WCHAR *path1, const WCHAR *path2, DWORD flags, WCHAR **out) |
|
HRESULT WINAPI | PathCchAddBackslash (WCHAR *path, SIZE_T size) |
|
HRESULT WINAPI | PathCchAddBackslashEx (WCHAR *path, SIZE_T size, WCHAR **endptr, SIZE_T *remaining) |
|
HRESULT WINAPI | PathCchAddExtension (WCHAR *path, SIZE_T size, const WCHAR *extension) |
|
HRESULT WINAPI | PathCchAppend (WCHAR *path1, SIZE_T size, const WCHAR *path2) |
|
HRESULT WINAPI | PathCchAppendEx (WCHAR *path1, SIZE_T size, const WCHAR *path2, DWORD flags) |
|
HRESULT WINAPI | PathCchCanonicalize (WCHAR *out, SIZE_T size, const WCHAR *in) |
|
HRESULT WINAPI | PathCchCanonicalizeEx (WCHAR *out, SIZE_T size, const WCHAR *in, DWORD flags) |
|
HRESULT WINAPI | PathCchCombine (WCHAR *out, SIZE_T size, const WCHAR *path1, const WCHAR *path2) |
|
HRESULT WINAPI | PathCchCombineEx (WCHAR *out, SIZE_T size, const WCHAR *path1, const WCHAR *path2, DWORD flags) |
|
HRESULT WINAPI | PathCchFindExtension (const WCHAR *path, SIZE_T size, const WCHAR **extension) |
|
BOOL WINAPI | PathCchIsRoot (const WCHAR *path) |
|
HRESULT WINAPI | PathCchRemoveBackslash (WCHAR *path, SIZE_T path_size) |
|
HRESULT WINAPI | PathCchRemoveBackslashEx (WCHAR *path, SIZE_T path_size, WCHAR **path_end, SIZE_T *free_size) |
|
HRESULT WINAPI | PathCchRemoveExtension (WCHAR *path, SIZE_T size) |
|
HRESULT WINAPI | PathCchRemoveFileSpec (WCHAR *path, SIZE_T size) |
|
HRESULT WINAPI | PathCchRenameExtension (WCHAR *path, SIZE_T size, const WCHAR *extension) |
|
HRESULT WINAPI | PathCchSkipRoot (const WCHAR *path, const WCHAR **root_end) |
|
HRESULT WINAPI | PathCchStripPrefix (WCHAR *path, SIZE_T size) |
|
HRESULT WINAPI | PathCchStripToRoot (WCHAR *path, SIZE_T size) |
|
BOOL WINAPI | PathIsUNCEx (const WCHAR *path, const WCHAR **server) |
|
◆ STATIC_PATHCCH
◆ get_next_segment()
◆ get_root_end()
◆ is_drive_spec()
◆ is_prefixed_disk()
◆ is_prefixed_unc()
◆ is_prefixed_volume()
Definition at line 85 of file pathcch.c.
86{
89
91
93
95 {
97 {
98 case 0:
100 break;
101 case 9:
102 case 14:
103 case 19:
104 case 24:
106 break;
107 case 37:
109 break;
110 default:
112 break;
113 }
115 }
116
118}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by get_root_end(), and PathCchSkipRoot().
◆ PathAllocCanonicalize()
Definition at line 168 of file pathcch.c.
170{
173 const WCHAR *root_end;
175
177
178 if (!path_in || !path_out
183 {
184 if (path_out) *path_out =
NULL;
186 }
187
191 {
194 }
195
196
198
199
203 {
206 }
207
210
212 if (root_end) root_end =
buffer + (root_end - path_in);
213
214
215 if (root_end)
216 {
220 {
221
223 {
226 }
229 }
230 else
232 }
233
235 {
237 {
239 {
240
242 {
244 continue;
245 }
246
247
249 {
252 continue;
253 }
254
255
256 if (
dst >
buffer &&
dst[-1] ==
'\\' && (!root_end ||
dst - 1 > root_end))
257 {
259
261 {
263 {
265 break;
266 }
267 else
269 }
270 }
271
272 else if (
src[2] ==
'\\')
274
276 }
277 else
278 {
279
281 {
283 continue;
284 }
285
286
288
289 else if (
src[1] ==
'\\')
291
293 }
294
295
297 {
301
302 if (
src[0] ==
'\\')
src++;
303 }
304 }
305
306 else
308 }
309
311
312
314 {
316 {
317
319 break;
320
323 else
325 }
326 }
327
328
330 {
333 }
334
335
340 {
346 }
347
348
351
354}
GLuint GLsizei GLsizei * length
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
HRESULT WINAPI PathCchStripPrefix(WCHAR *path, SIZE_T size)
static const WCHAR * get_root_end(const WCHAR *path)
HRESULT WINAPI PathCchAddBackslash(WCHAR *path, SIZE_T size)
#define PATHCCH_ENSURE_TRAILING_SLASH
#define PATHCCH_FORCE_ENABLE_LONG_NAME_PROCESS
#define PATHCCH_ALLOW_LONG_PATHS
#define PATHCCH_ENSURE_IS_EXTENDED_LENGTH_PATH
#define PATHCCH_DO_NOT_NORMALIZE_SEGMENTS
#define PATHCCH_FORCE_DISABLE_LONG_NAME_PROCESS
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
#define ERROR_FILENAME_EXCED_RANGE
#define HRESULT_FROM_WIN32(x)
Referenced by PathAllocCombine(), and PathCchCanonicalizeEx().
◆ PathAllocCombine()
Definition at line 365 of file pathcch.c.
367{
368 SIZE_T combined_length, length2;
369 WCHAR *combined_path;
372
374
376 {
379 }
380
382
383
385 {
390 }
391
393
395
397 if (!combined_path)
398 {
401 }
402
406
408 {
410 {
413 }
414
417 }
418
422}
#define HeapFree(x, y, z)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
static const WCHAR path1[]
static const WCHAR path2[]
HRESULT WINAPI PathCchAddBackslashEx(WCHAR *path, SIZE_T size, WCHAR **endptr, SIZE_T *remaining)
HRESULT WINAPI PathCchStripToRoot(WCHAR *path, SIZE_T size)
HRESULT WINAPI PathAllocCanonicalize(const WCHAR *path_in, DWORD flags, WCHAR **path_out)
Referenced by PathCchCombineEx().
◆ PathCchAddBackslash()
◆ PathCchAddBackslashEx()
Definition at line 446 of file pathcch.c.
448{
449 BOOL needs_termination;
451
453
456
458 {
459 if (endptr) *endptr =
NULL;
460 if (remaining) *remaining = 0;
462 }
463
464 if (!needs_termination)
465 {
469 }
470
473
476
478}
#define STRSAFE_E_INSUFFICIENT_BUFFER
Referenced by PathAllocCombine(), and PathCchAddBackslash().
◆ PathCchAddExtension()
Definition at line 488 of file pathcch.c.
490{
495
497
499
502 {
505 }
506
507 has_dot = extension[0] == '.';
508
511 if (*existing_extension)
return S_FALSE;
512
514 dot_length = has_dot ? 0 : 1;
515 extension_length =
lstrlenW(extension);
516
518
519
520 if (!extension[0] || (extension[0] ==
'.' && !extension[1]))
return S_OK;
521
522 if (!has_dot)
523 {
526 }
527
530}
HRESULT WINAPI PathCchFindExtension(const WCHAR *path, SIZE_T size, const WCHAR **extension)
Referenced by PathCchRenameExtension().
◆ PathCchAppend()
Definition at line 540 of file pathcch.c.
542{
544
546}
HRESULT WINAPI PathCchAppendEx(WCHAR *path1, SIZE_T size, const WCHAR *path2, DWORD flags)
◆ PathCchAppendEx()
Definition at line 557 of file pathcch.c.
559{
562
564
566
567
568
569
572
573
575
578
581}
HRESULT WINAPI PathCchCombineEx(WCHAR *out, SIZE_T size, const WCHAR *path1, const WCHAR *path2, DWORD flags)
Referenced by PathCchAppend().
◆ PathCchCanonicalize()
Definition at line 591 of file pathcch.c.
593{
595
596
599
601}
HRESULT WINAPI PathCchCanonicalizeEx(WCHAR *out, SIZE_T size, const WCHAR *in, DWORD flags)
◆ PathCchCanonicalizeEx()
Definition at line 612 of file pathcch.c.
614{
618
620
622
625
628 {
629
632 else
634 }
635
637 {
639
640
642 {
645 }
646 }
647
650}
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Referenced by PathCchCanonicalize().
◆ PathCchCombine()
◆ PathCchCombineEx()
Definition at line 679 of file pathcch.c.
681{
685
687
689
692 {
695 }
696
699 {
703 }
704 else
705 {
709 }
710}
HRESULT WINAPI PathAllocCombine(const WCHAR *path1, const WCHAR *path2, DWORD flags, WCHAR **out)
Referenced by PathCchAppendEx(), and PathCchCombine().
◆ PathCchFindExtension()
◆ PathCchIsRoot()
Definition at line 760 of file pathcch.c.
762{
763 const WCHAR *root_end;
766
768
770
772 if (!root_end)
return FALSE;
773
775 {
777
778 if ((is_unc && !*
next) || (!is_unc && !*
next))
return TRUE;
779
780
782
785
786 else
787 {
789
791 }
792 }
793 else if (*root_end == '\\' && !root_end[1])
795 else
797}
static BOOL get_next_segment(const WCHAR *next, const WCHAR **next_segment)
Referenced by PathCchRemoveFileSpec().
◆ PathCchRemoveBackslash()
Definition at line 806 of file pathcch.c.
808{
811
813
815}
HRESULT WINAPI PathCchRemoveBackslashEx(WCHAR *path, SIZE_T path_size, WCHAR **path_end, SIZE_T *free_size)
◆ PathCchRemoveBackslashEx()
Definition at line 826 of file pathcch.c.
828{
829 const WCHAR *root_end;
831
833
834 if (!path_size || !path_end || !free_size)
835 {
836 if (path_end) *path_end =
NULL;
837 if (free_size) *free_size = 0;
839 }
840
843
846 {
849
851 {
854 }
855 else
857 }
858 else
859 {
863 }
864}
Referenced by PathCchRemoveBackslash().
◆ PathCchRemoveExtension()
◆ PathCchRemoveFileSpec()
Definition at line 900 of file pathcch.c.
902{
906
908
910
912
914
915
916 if (root_end && root_end >
path && root_end[-1] ==
'\\'
918 root_end--;
919
923 {
925
927 {
929 break;
930 }
931
933 }
934
936}
BOOL WINAPI PathCchIsRoot(const WCHAR *path)
HRESULT WINAPI PathCchSkipRoot(const WCHAR *path, const WCHAR **root_end)
◆ PathCchRenameExtension()
Definition at line 946 of file pathcch.c.
948{
950
952
955
958}
HRESULT WINAPI PathCchRemoveExtension(WCHAR *path, SIZE_T size)
HRESULT WINAPI PathCchAddExtension(WCHAR *path, SIZE_T size, const WCHAR *extension)
◆ PathCchSkipRoot()
◆ PathCchStripPrefix()
◆ PathCchStripToRoot()
Definition at line 1037 of file pathcch.c.
1039{
1040 const WCHAR *root_end;
1043
1045
1047
1048
1049
1050
1052 {
1053 root_end = is_unc ?
path + 8 :
path + 3;
1056
1058
1059 segment_end =
path + (root_end -
path) - 1;
1060 *segment_end = 0;
1062 }
1064 {
1066
1067 segment_end =
path + (root_end -
path);
1068 if (!*segment_end)
return S_FALSE;
1069
1070 *segment_end = 0;
1072 }
1073 else
1075}
Referenced by PathAllocCombine().
◆ PathIsUNCEx()
Definition at line 1084 of file pathcch.c.
1086{
1088
1090
1093 else if (
path[0] ==
'\\' &&
path[1] ==
'\\' &&
path[2] !=
'?')
1095
1098}
static rfbScreenInfoPtr server
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
path |
| ) |
|