diff --git a/CHANGES.txt b/CHANGES.txt index 5c915caa07..ac03f6fa2f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -16,6 +16,7 @@ Coming in build 311, as yet unreleased * Fixed a regression that broke special __dunder__ methods with CoClass. (#1870, #2493, @Avasam, @geppi) * Fixed a memory leak when SafeArrays are used as out parameters (@the-snork) * Fixed dispatch handling for properties (@the-snork) +* Fixed struct handling in makepy generated code (@the-snork) Build 310, released 2025/03/16 ------------------------------ diff --git a/com/TestSources/PyCOMTest/PyCOMImpl.cpp b/com/TestSources/PyCOMTest/PyCOMImpl.cpp index 295104645a..1b5a87b3e0 100644 --- a/com/TestSources/PyCOMTest/PyCOMImpl.cpp +++ b/com/TestSources/PyCOMTest/PyCOMImpl.cpp @@ -626,6 +626,16 @@ HRESULT CPyCOMTest::GetStruct(TestStruct1 *ret) return S_OK; } +HRESULT CPyCOMTest::GetOutStruct(TestStruct1 *ret) +{ + if (ret == NULL) { + return E_POINTER; + } + ret->int_value = 99; + ret->str_value = SysAllocString(L"Hello from C++"); + return S_OK; +} + HRESULT CPyCOMTest::ModifyStruct(TestStruct1 *prec) { prec->int_value = 100; diff --git a/com/TestSources/PyCOMTest/PyCOMImpl.h b/com/TestSources/PyCOMTest/PyCOMImpl.h index 5ba528907d..f4c07540d3 100644 --- a/com/TestSources/PyCOMTest/PyCOMImpl.h +++ b/com/TestSources/PyCOMTest/PyCOMImpl.h @@ -99,6 +99,7 @@ class CPyCOMTest : public IDispatchImpl