@pymethod |pythoncom|CoSetCancelObject|Sets or removes a interface to be used on the current thread @comm Requires Win2k or later
| 1911 | // @pymethod |pythoncom|CoSetCancelObject|Sets or removes a <o PyICancelMethodCalls> interface to be used on the current thread |
| 1912 | // @comm Requires Win2k or later |
| 1913 | static PyObject *pythoncom_CoSetCancelObject(PyObject *self, PyObject *args) |
| 1914 | { |
| 1915 | CHECK_PFN(CoSetCancelObject); |
| 1916 | // @pyparm <o PyIUnknown>|Unk||An interface that support ICancelMethodCalls, can be None to unregister current cancel object |
| 1917 | IUnknown *pUnk; |
| 1918 | PyObject *obUnk; |
| 1919 | if (!PyArg_ParseTuple(args, "O:CoSetCancelObject", &obUnk)) |
| 1920 | return NULL; |
| 1921 | if (!PyCom_InterfaceFromPyInstanceOrObject(obUnk, IID_IUnknown, (void**)&pUnk, TRUE)) |
| 1922 | return NULL; |
| 1923 | |
| 1924 | HRESULT hr; |
| 1925 | Py_BEGIN_ALLOW_THREADS |
| 1926 | hr = (*pfnCoSetCancelObject)(pUnk); |
| 1927 | Py_END_ALLOW_THREADS |
| 1928 | if (FAILED(hr)) |
| 1929 | return PyCom_BuildPyException(hr); |
| 1930 | Py_INCREF(Py_None); |
| 1931 | return Py_None; |
| 1932 | } |
| 1933 | |
| 1934 | // @pymethod |pythoncom|CoEnableCallCancellation|Enables call cancellation for synchronous calls on the current thread |
| 1935 | static PyObject *pythoncom_CoEnableCallCancellation(PyObject *self, PyObject *args) |
nothing calls this directly
no test coverage detected