-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-102255: Improve build support on xbox #102256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
58ab04a
66a68bd
26f5a44
68a1f67
492bac0
26b4b24
467bf40
e734492
fad23bc
b6b28ec
cdbb1f2
e7622cc
7812891
3b005f4
fa526b6
36887bc
6fe3018
8499940
69f0a2c
f43ce54
43cf0a5
8f717ea
29d5b65
8a73500
92ae5ef
f27fe95
f15d9e2
d816baa
2ba0a87
ed17e03
c360b4a
3b5b119
975191a
91a95f2
3be5fa7
6bd1207
ca98366
fac3431
c1bf0e2
ace99f6
e83d398
76ea310
2f1d19c
559199f
b119bf5
1dd69e8
a1e6dba
7a45988
846f8eb
a56f215
191cab2
144280e
ca9f7d9
30c0818
6ebb05b
fc5c642
5f286a7
3be5e3c
d9e1663
2a2a8fd
165286d
1413849
6465d73
3f0c6f0
8f3a262
6b8074e
99b6a1d
d0e548d
c569a18
3e86c9e
d5cb524
63267d8
79f2bfe
fc6b942
05e9859
9769662
8f12bf8
509d0f5
f20fea8
e33a42f
556a8e1
aa8964b
74258ca
686da59
b151f7f
39d2d13
2895563
8e3d3c5
659d1a3
e9ff60e
32c4886
2f1fe40
5854e91
d3d2e1c
b1ffce9
0b4d407
d9976dc
427de79
603cea7
6db80a3
4d78066
65cdd56
35217ab
331b1f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4419,6 +4419,40 @@ os__getvolumepathname_impl(PyObject *module, path_t *path) | |
return result; | ||
} | ||
|
||
#if MS_WINDOWS_GAMES | ||
// The Windows Games API partition does not provide PathCchSkipRoot | ||
// so we need our own implementation | ||
static wchar_t* | ||
win32_games_skip_root(wchar_t* path) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just call it It'll break if Windows introduces the API, but unless there's some reasonable way to detect it, that's probably best. We'll want to use it when it's there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might also be better in fileutils.c with a conditional declaration in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved them into |
||
{ | ||
if (path[0] == L'\\') { | ||
/* relative path with root e.g. \Windows */ | ||
if (path[1] != L'\\') { | ||
return path + 1; | ||
} | ||
|
||
/* UNC drives e.g. \\server\share or \\?\UNC\server\share */ | ||
wchar_t *end = path + 2; | ||
if (!wcsnicmp(end, L"?\\UNC\\", 6)) { | ||
end += 6; | ||
} | ||
|
||
end = wcschr(end, '\\'); | ||
if (!end) { | ||
return path + wcslen(path); | ||
} | ||
end = wcschr(end + 1, '\\'); | ||
return (!end) ? wcslen(path) : end + 1; | ||
} | ||
/* absolute / relative path with drive, e.g. C: or C:\ */ | ||
else if (isalpha(path[0]) && path[1] == L':') { | ||
return (path[2] == L'\\') ? path + 3 : path + 2; | ||
} | ||
|
||
/* relative path */ | ||
return NULL; | ||
} | ||
#endif | ||
|
||
/*[clinic input] | ||
os._path_splitroot | ||
|
@@ -4447,26 +4481,8 @@ os__path_splitroot_impl(PyObject *module, path_t *path) | |
} | ||
|
||
#if MS_WINDOWS_GAMES | ||
/* network share */ | ||
if (buffer[0] == L'\\' && buffer[1] == L'\\') { | ||
end = buffer + 2; | ||
for (int i = 0; i < 2; ++i) { | ||
end = wcschr(end, '\\'); | ||
if (end == NULL) { | ||
break; | ||
} | ||
end++; | ||
} | ||
ret = (end != NULL) ? S_OK : E_INVALIDARG; | ||
} | ||
/* Check for absolute drive path */ | ||
else if (buffer[0] && buffer[1] == L':' && buffer[2] == L'\\') { | ||
end = buffer + 3; | ||
ret = S_OK; | ||
} | ||
else { | ||
ret = E_INVALIDARG; | ||
} | ||
end = win32_games_skip_root(buffer); | ||
ret = (end != NULL) ? S_OK : E_INVALIDARG; | ||
#else | ||
Py_BEGIN_ALLOW_THREADS | ||
ret = PathCchSkipRoot(buffer, &end); | ||
|
Uh oh!
There was an error while loading. Please reload this page.