MCPcopy Create free account
hub / github.com/mhammond/pywin32 / pythoncom_CoSetCancelObject

Function pythoncom_CoSetCancelObject

com/win32com/src/PythonCOM.cpp:1913–1932  ·  view source on GitHub ↗

@pymethod |pythoncom|CoSetCancelObject|Sets or removes a interface to be used on the current thread @comm Requires Win2k or later

Source from the content-addressed store, hash-verified

1911// @pymethod |pythoncom|CoSetCancelObject|Sets or removes a <o PyICancelMethodCalls> interface to be used on the current thread
1912// @comm Requires Win2k or later
1913static 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
1935static PyObject *pythoncom_CoEnableCallCancellation(PyObject *self, PyObject *args)

Callers

nothing calls this directly

Calls 3

FAILEDFunction · 0.85
PyCom_BuildPyExceptionFunction · 0.85

Tested by

no test coverage detected