diff options
author | Jun Komoda <45822440+junkmd@users.noreply.github.com> | 2024-12-03 15:35:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-03 15:35:08 (GMT) |
commit | 412e11fe6e37f15971ef855f88b8b01bb3297679 (patch) | |
tree | fd182649ca5f4be09370b8bb0568d0f26d381ebe /Doc/library | |
parent | 979bf2489d0c59ae451b97d7e3c148f47e259f0b (diff) | |
download | cpython-412e11fe6e37f15971ef855f88b8b01bb3297679.zip cpython-412e11fe6e37f15971ef855f88b8b01bb3297679.tar.gz cpython-412e11fe6e37f15971ef855f88b8b01bb3297679.tar.bz2 |
gh-127255: Make `CopyComPointer` public and add to `ctypes` doc. (GH-127275)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/ctypes.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index bd9529d..bd88fa3 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1949,6 +1949,24 @@ Utility functions It behaves similar to ``pointer(obj)``, but the construction is a lot faster. +.. function:: CopyComPointer(src, dst) + + Copies a COM pointer from *src* to *dst* and returns the Windows specific + :c:type:`!HRESULT` value. + + If *src* is not ``NULL``, its ``AddRef`` method is called, incrementing the + reference count. + + In contrast, the reference count of *dst* will not be decremented before + assigning the new value. Unless *dst* is ``NULL``, the caller is responsible + for decrementing the reference count by calling its ``Release`` method when + necessary. + + .. availability:: Windows + + .. versionadded:: next + + .. function:: cast(obj, type) This function is similar to the cast operator in C. It returns a new instance |