8000 gh-134041: Avoid usage of unavailable windows path apis by maxbachmann · Pull Request #134042 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-134041: Avoid usage of unavailable windows path apis #134042

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

Merged
merged 3 commits into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments 8000 .
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
apply code review
  • Loading branch information
maxbachmann committed May 15, 2025
commit a2159225cfa4a6afca99e5fccb859ad9992af500
9 changes: 6 additions & 3 deletions Modules/_winapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@
}
return result;
#else
return PyUnicode_FromWideChar(path, wcslen(path));
return PyUnicode_FromWideChar(path, -1);
#endif
}

Expand Down Expand Up @@ -1636,6 +1636,8 @@
return PyUnicode_FromWideChar(filename, wcslen(filename));
}

#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)

/*[clinic input]
_winapi.GetShortPathName

Expand All @@ -1653,7 +1655,6 @@
_winapi_GetShortPathName_impl(PyObject *module, LPCWSTR path)
/*[clinic end generated code: output=dab6ae494c621e81 input=43fa349aaf2ac718]*/
{
#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)
DWORD cchBuffer;
PyObject *result = NULL;

Expand All @@ -1680,9 +1681,11 @@
#else
PyErr_SetString(PyExc_OSError, "GetShortPathName unavailable on this platform");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your call here, but if you put the ifdef around the entire function definition and regenerate the clinic headers (should be python Tools\clinic\clinic.py Modules\_winapi.c unless someone finally moved the clinic.py script) then it should entirely omit the function when you build.

Or maybe it'd make sense just to return the original string again? I'm not sure where this function gets used, but in general, unconditional errors are harder to detect than a missing function, and are less convenient than sensible-but-technically-incorrect behaviours. This is an internal module, so we only really need to consider stdlib uses, though of course we want to avoid breaking existing third-party code as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell we don't use this anywhere

return NULL;
#endif

}

#endif /* MS_WINDOWS_DESKTOP || MS_WINDOWS_SYSTEM */

/*[clinic input]
_winapi.GetStdHandle -> HANDLE

Expand All @@ -1698,11 +1701,11 @@
static HANDLE
_winapi_GetStdHandle_impl(PyObject *module, DWORD std_handle)
/*[clinic end generated code: output=0e613001e73ab614 input=07016b06a2fc8826]*/
{

Check failure on line 1704 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1704 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1704 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

syntax error: missing ';' before '{' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1704 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

syntax error: missing ';' before '{' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
HANDLE handle;

Py_BEGIN_ALLOW_THREADS
handle = GetStdHandle(std_handle);

Check failure on line 1708 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'std_handle': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1708 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'std_handle': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1708 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'std_handle': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1708 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'std_handle': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
Py_END_ALLOW_THREADS

if (handle == INVALID_HANDLE_VALUE)
Expand All @@ -1726,8 +1729,8 @@
#pragma warning(push)
#pragma warning(disable:4996)

{

Check failure on line 1732 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1732 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1732 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

syntax error: missing ';' before '{' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1732 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

syntax error: missing ';' before '{' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
return GetVersion();

Check warning on line 1733 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'return': 'PyObject *' differs in levels of indirection from 'DWORD' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1733 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'return': 'PyObject *' differs in levels of indirection from 'DWORD' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1733 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'return': 'PyObject *' differs in levels of indirection from 'DWORD' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1733 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'return': 'PyObject *' differs in levels of indirection from 'DWORD' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
}

#pragma warning(pop)
Expand All @@ -1748,12 +1751,12 @@
DWORD desired_access, DWORD file_offset_high,
DWORD file_offset_low, size_t number_bytes)
/*[clinic end generated code: output=f23b1ee4823663e3 input=177471073be1a103]*/
{

Check failure on line 1754 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1754 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1754 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

syntax error: missing ';' before '{' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1754 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

syntax error: missing ';' before '{' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
LPVOID address;

Py_BEGIN_ALLOW_THREADS
address = MapViewOfFile(file_map, desired_access, file_offset_high,

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'file_map': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'MapViewOfFile': pointer mismatch for actual parameter 1 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'desired_access': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'file_offset_high': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'file_map': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'MapViewOfFile': pointer mismatch for actual parameter 1 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'desired_access': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'file_offset_high': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'file_map': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'MapViewOfFile': pointer mismatch for actual parameter 1 [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'desired_access': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'file_offset_high': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'file_map': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'MapViewOfFile': pointer mismatch for actual parameter 1 [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'desired_access': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1758 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'file_offset_high': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
file_offset_low, number_bytes);

Check failure on line 1759 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'file_offset_low': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1759 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'number_bytes': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1759 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'file_offset_low': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1759 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'number_bytes': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1759 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'file_offset_low': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1759 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'number_bytes': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1759 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'file_offset_low': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1759 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'number_bytes': undeclared identifier [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
Py_END_ALLOW_THREADS

if (address == NULL)
Expand All @@ -1772,11 +1775,11 @@
static PyObject *
_winapi_UnmapViewOfFile_impl(PyObject *module, LPCVOID address)
/*[clinic end generated code: output=4f7e18ac75d19744 input=8c4b6119ad9288a3]*/
{

Check failure on line 1778 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1778 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1778 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

syntax error: missing ';' before '{' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 1778 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

syntax error: missing ';' before '{' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
BOOL success;

Py_BEGIN_ALLOW_THREADS
success = UnmapViewOfFile(address);

Check warning on line 1782 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'UnmapViewOfFile': pointer mismatch for actual parameter 1 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1782 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'UnmapViewOfFile': pointer mismatch for actual parameter 1 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1782 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'UnmapViewOfFile': pointer mismatch for actual parameter 1 [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1782 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'UnmapViewOfFile': pointer mismatch for actual parameter 1 [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
Py_END_ALLOW_THREADS

if (!success) {
Expand Down Expand Up @@ -1806,7 +1809,7 @@
}

Py_BEGIN_ALLOW_THREADS
handle = OpenEventW(desired_access, inherit_handle, name);

Check warning on line 1812 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1812 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'OpenEventW': different types for formal and actual parameter 3 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1812 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1812 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'OpenEventW': different types for formal and actual parameter 3 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1812 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1812 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'OpenEventW': different types for formal and actual parameter 3 [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1812 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1812 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'OpenEventW': different types for formal and actual parameter 3 [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
Py_END_ALLOW_THREADS

if (handle == INVALID_HANDLE_VALUE) {
Expand Down Expand Up @@ -1837,7 +1840,7 @@
}

Py_BEGIN_ALLOW_THREADS
handle = OpenMutexW(desired_access, inherit_handle, name);

Check warning on line 1843 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1843 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'OpenMutexW': different types for formal and actual parameter 3 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1843 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1843 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'OpenMutexW': different types for formal and actual parameter 3 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1843 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1843 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'OpenMutexW': different types for formal and actual parameter 3 [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1843 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1843 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'OpenMutexW': different types for formal and actual parameter 3 [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
Py_END_ALLOW_THREADS

if (handle == INVALID_HANDLE_VALUE) {
Expand All @@ -1864,11 +1867,11 @@
HANDLE handle;

Py_BEGIN_ALLOW_THREADS
handle = OpenFileMappingW(desired_access, inherit_handle, name);

Check warning on line 1870 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1870 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'OpenFileMappingW': different types for formal and actual parameter 3 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1870 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1870 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'OpenFileMappingW': different types for formal and actual parameter 3 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1870 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1870 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'OpenFileMappingW': different types for formal and actual parameter 3 [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1870 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'function': 'LPCWSTR' differs in levels of indirection from 'int' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1870 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

B85E

'OpenFileMappingW': different types for formal and actual parameter 3 [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
Py_END_ALLOW_THREADS

if (handle == NULL) {
PyObject *temp = PyUnicode_FromWideChar(name, -1);

Check warning on line 1874 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

'function': 'const wchar_t *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1874 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

'function': 'const wchar_t *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1874 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

'function': 'const wchar_t *' differs in levels of indirection from 'int' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 1874 in Modules/_winapi.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

'function': 'const wchar_t *' differs in levels of indirection from 'int' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
PyErr_SetExcFromWindowsErrWithFilenameObject(PyExc_OSError, 0, temp);
Py_XDECREF(temp);
handle = INVALID_HANDLE_VALUE;
Expand Down
10 changes: 9 additions & 1 deletion Modules/clinic/_winapi.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
0