Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow build :mod:`!_overlapped` module for Universal Windows Platform.
16 changes: 16 additions & 0 deletions Modules/overlapped.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@

#define T_HANDLE T_POINTER

#ifndef HasOverlappedIoCompleted
#define HasOverlappedIoCompleted(lpOverlapped) (lpOverlapped)->Internal != STATUS_PENDING
#endif

/*[python input]
class pointer_converter(CConverter):
format_unit = '"F_POINTER"'
Expand Down Expand Up @@ -359,6 +363,9 @@ _overlapped_RegisterWaitWithQueue_impl(PyObject *module, HANDLE Object,
DWORD Milliseconds)
/*[clinic end generated code: output=c2ace732e447fe45 input=2dd4efee44abe8ee]*/
{
#ifndef MS_WINDOWS_DESKTOP
return NULL;
#else
HANDLE NewWaitObject;
struct PostCallbackData data = {CompletionPort, Overlapped}, *pdata;

Expand All @@ -381,6 +388,7 @@ _overlapped_RegisterWaitWithQueue_impl(PyObject *module, HANDLE Object,
}

return Py_BuildValue(F_HANDLE, NewWaitObject);
#endif
}

/*[clinic input]
Expand All @@ -396,6 +404,9 @@ static PyObject *
_overlapped_UnregisterWait_impl(PyObject *module, HANDLE WaitHandle)
/*[clinic end generated code: output=ec90cd955a9a617d input=a56709544cb2df0f]*/
{
#ifndef MS_WINDOWS_DESKTOP
Py_RETURN_NONE;
#else
BOOL ret;

Py_BEGIN_ALLOW_THREADS
Expand All @@ -405,6 +416,7 @@ _overlapped_UnregisterWait_impl(PyObject *module, HANDLE WaitHandle)
if (!ret)
return SetFromWindowsErr(0);
Py_RETURN_NONE;
#endif
}

/*[clinic input]
Expand All @@ -422,6 +434,9 @@ _overlapped_UnregisterWaitEx_impl(PyObject *module, HANDLE WaitHandle,
HANDLE Event)
/*[clinic end generated code: output=2e3d84c1d5f65b92 input=953cddc1de50fab9]*/
{
#ifndef MS_WINDOWS_DESKTOP
Py_RETURN_NONE;
#else
BOOL ret;

Py_BEGIN_ALLOW_THREADS
Expand All @@ -431,6 +446,7 @@ _overlapped_UnregisterWaitEx_impl(PyObject *module, HANDLE WaitHandle,
if (!ret)
return SetFromWindowsErr(0);
Py_RETURN_NONE;
#endif
}

/*
Expand Down
Loading