summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorJun Komoda <45822440+junkmd@users.noreply.github.com>2024-12-03 15:35:08 (GMT)
committerGitHub <noreply@github.com>2024-12-03 15:35:08 (GMT)
commit412e11fe6e37f15971ef855f88b8b01bb3297679 (patch)
treefd182649ca5f4be09370b8bb0568d0f26d381ebe /Doc
parent979bf2489d0c59ae451b97d7e3c148f47e259f0b (diff)
downloadcpython-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')
-rw-r--r--Doc/library/ctypes.rst18
-rw-r--r--Doc/whatsnew/3.14.rst5
2 files changed, 22 insertions, 1 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
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst
index 7bb9657..52a6d6e 100644
--- a/Doc/whatsnew/3.14.rst
+++ b/Doc/whatsnew/3.14.rst
@@ -313,9 +313,12 @@ ctypes
to help match a non-default ABI.
(Contributed by Petr Viktorin in :gh:`97702`.)
-* The :exc:`~ctypes.COMError` exception is now public.
+* On Windows, the :exc:`~ctypes.COMError` exception is now public.
(Contributed by Jun Komoda in :gh:`126686`.)
+* On Windows, the :func:`~ctypes.CopyComPointer` function is now public.
+ (Contributed by Jun Komoda in :gh:`127275`.)
+
datetime
--------