Skip to content

Commit 0178233

Browse files
committed
Add CopyComPointer to ctypes doc.
1 parent 07e9920 commit 0178233

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Doc/library/ctypes.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,6 +1949,22 @@ Utility functions
19491949
It behaves similar to ``pointer(obj)``, but the construction is a lot faster.
19501950

19511951

1952+
.. function:: CopyComPointer(src, dst)
1953+
1954+
Copies a COM pointer from *src* to *dst* and returns the Windows specific
1955+
:c:type:`!HRESULT` value.
1956+
1957+
If *src* is not ``NULL``, its ``AddRef`` method is called, incrementing the
1958+
reference count.
1959+
1960+
In contrast, even if *dst* is not ``NULL``, its reference count will not be
1961+
decremented. You need to call its ``Release`` to free it appropriately.
1962+
1963+
.. availability:: Windows
1964+
1965+
.. versionadded:: next
1966+
1967+
19521968
.. function:: cast(obj, type)
19531969

19541970
This function is similar to the cast operator in C. It returns a new instance

0 commit comments

Comments
 (0)