8000 Add `CopyComPointer` to `ctypes` doc. · python/cpython@d6cabaa · GitHub
[go: up one dir, main page]

Skip to content

Commit d6cabaa

Browse files
committed
Add CopyComPointer to ctypes doc.
1 parent 3b1aac2 commit d6cabaa

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Doc/library/ctypes.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,6 +1949,23 @@ 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 before assigning the new value. You need to call its ``Release``
1962+
to free it appropriately.
1963+
1964+
.. availability:: Windows
1965+
1966+
.. versionadded:: next
1967+
1968+
19521969
.. function:: cast(obj, type)
19531970

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

0 commit comments

Comments
 (0)
0