From e79b8a480452a50b0fc1166ec327b3367c58db0e Mon Sep 17 00:00:00 2001 From: Raed Rizqie Date: Sun, 6 Oct 2024 13:57:16 +0800 Subject: [PATCH] pywin32: update to 308 --- .../001-compile-and-setup-fixes.patch | 221 +++---- .../002-com-extensions-fix.patch | 582 +++++++++--------- .../003-win32-extensions-fix.patch | 544 +++++++++------- mingw-w64-python-pywin32/004-isapi-fix.patch | 20 +- mingw-w64-python-pywin32/005-swig-fix.patch | 41 +- .../006-mapi-headers-fix.patch | 73 ++- mingw-w64-python-pywin32/PKGBUILD | 57 +- 7 files changed, 812 insertions(+), 726 deletions(-) diff --git a/mingw-w64-python-pywin32/001-compile-and-setup-fixes.patch b/mingw-w64-python-pywin32/001-compile-and-setup-fixes.patch index 78fb5efd2bd5d..e2a6103f9d421 100644 --- a/mingw-w64-python-pywin32/001-compile-and-setup-fixes.patch +++ b/mingw-w64-python-pywin32/001-compile-and-setup-fixes.patch @@ -1,6 +1,8 @@ ---- pywin32-b306-orig/setup.py 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/setup.py 2023-04-08 00:04:34.053153700 +0800 -@@ -126,7 +126,8 @@ +diff --git a/setup.py b/setup.py +index 37d536a..3e9d270 100644 +--- a/setup.py ++++ b/setup.py +@@ -124,7 +124,8 @@ class WinExt(Extension): extra_link_args = extra_link_args or [] if export_symbol_file: @@ -10,7 +12,7 @@ # Some of our swigged files behave differently in distutils vs # MSVC based builds. Always define DISTUTILS_BUILD so they can tell. -@@ -164,7 +165,7 @@ +@@ -162,7 +163,7 @@ class WinExt(Extension): def finalize_options(self, build_ext): # distutils doesn't define this function for an Extension - it is # our own invention, and called just before the extension is built. @@ -19,10 +21,10 @@ if self.pch_header: self.extra_compile_args = self.extra_compile_args or [] -@@ -224,6 +225,65 @@ +@@ -218,6 +219,61 @@ class WinExt(Extension): + break if found_mfc: break - + else: + # Set our C++ standard + self.extra_compile_args.append("-std=c++17") @@ -33,22 +35,19 @@ + self.extra_compile_args.append("-D__WIN32__") + # Extra compile args + if "AMD64" in sys.version: -+ self.extra_compile_args.append("-D_M_X64") # pythoncom & win32ui ++ self.extra_compile_args.append("-D_M_X64") # pythoncom & win32ui + self.extra_compile_args.append("-D_AMD64_") # mapi + elif "ARM64" in sys.version: -+ self.extra_compile_args.append("-D_M_ARM64") # pythoncom & win32ui ++ self.extra_compile_args.append("-D_M_ARM64") # pythoncom & win32ui + self.extra_compile_args.append("-D_ARM64_") # mapi + else: + self.extra_compile_args.append("-D_M_IX86") # pythoncom & win32ui -+ self.extra_compile_args.append("-D_X86_") # mapi ++ self.extra_compile_args.append("-D_X86_") # mapi + + # If someone needs a specially named implib created, handle that + if self.implib_name: + implib = os.path.join(build_ext.build_temp, self.implib_name) -+ if build_ext.debug: -+ suffix = "_d" -+ else: -+ suffix = "" ++ suffix = "_d" if build_ext.debug else "" + self.extra_link_args.append( + "-Wl,--out-implib,%s%s.dll.a" % (implib, suffix) + ) @@ -81,11 +80,10 @@ + self.extra_compile_args.append("-Wno-nonnull-compare") + self.extra_compile_args.append("-Wno-pointer-arith") + self.extra_compile_args.append("-Wno-sequence-point") -+ + self.extra_compile_args.append("-DUNICODE") self.extra_compile_args.append("-D_UNICODE") - self.extra_compile_args.append("-DWINNT") -@@ -233,6 +293,19 @@ +@@ -228,6 +284,19 @@ class WinExt_pythonwin(WinExt): def __init__(self, name, **kw): kw.setdefault("extra_compile_args", []).extend(["-D_AFXDLL", "-D_AFXEXT"]) @@ -105,7 +103,7 @@ WinExt.__init__(self, name, **kw) def get_pywin32_dir(self): -@@ -243,7 +316,7 @@ +@@ -238,7 +307,7 @@ class WinExt_pythonwin_subsys_win(WinExt_pythonwin): def finalize_options(self, build_ext): WinExt_pythonwin.finalize_options(self, build_ext) @@ -114,7 +112,7 @@ self.extra_link_args.append("-mwindows") else: self.extra_link_args.append("/SUBSYSTEM:WINDOWS") -@@ -254,6 +327,9 @@ +@@ -249,6 +318,9 @@ class WinExt_pythonwin_subsys_win(WinExt_pythonwin): class WinExt_win32(WinExt): def __init__(self, name, **kw): @@ -124,7 +122,7 @@ WinExt.__init__(self, name, **kw) def get_pywin32_dir(self): -@@ -270,6 +346,8 @@ +@@ -265,6 +337,8 @@ class WinExt_ISAPI(WinExt): class WinExt_win32com(WinExt): def __init__(self, name, **kw): kw["libraries"] = kw.get("libraries", "") + " oleaut32 ole32" @@ -133,7 +131,7 @@ # COM extensions require later windows headers. if not kw.get("windows_h_version"): -@@ -338,11 +416,16 @@ +@@ -331,11 +405,16 @@ class WinExt_system32(WinExt): class WinExt_pythonservice(WinExt): @@ -151,17 +149,7 @@ self.extra_link_args.append("-mconsole") self.extra_link_args.append("-municode") else: -@@ -386,9 +469,6 @@ - # The pywintypes library is created in the build_temp - # directory, so we need to add this to library_dirs - self.library_dirs.append(self.build_temp) -- self.mingw32 = self.compiler == "mingw32" -- if self.mingw32: -- self.libraries.append("stdc++") - - self.excluded_extensions = [] # list of (ext, why) - self.swig_cpp = True # hrm - deprecated - should use swig_opts=-c++?? -@@ -910,6 +990,417 @@ +@@ -880,6 +959,395 @@ class my_build_ext(build_ext): return new_sources @@ -173,7 +161,7 @@ + # so we need to add this to library_dirs + self.library_dirs.append(self.build_temp) + -+ # Add extra SDK include dir & library dir ++ # Add extra VC++ SDK library dir + if "64 bit" in sys.version: + x64_dir = "/x64" + else: @@ -197,7 +185,13 @@ + + # Comment out below to enable Pythonwin extensions + if ext.name in ["win32ui", "win32uiole", "dde", "Pythonwin"]: -+ return "Unsupported (yet) due to MFC usage." ++ return "Unsupported due to ATL/MFC usage." ++ ++ # axdebug fails to build on 3.11 due to Python "frame" objects changing. ++ # This could be fixed, but is almost certainly not in use any more, so ++ # just skip it. ++ if ext.name == "axdebug" and sys.version_info > (3, 10): ++ return "AXDebug no longer builds on 3.11 and up" + + def _build_scintilla(self): + path = "Pythonwin/Scintilla/win32" @@ -266,7 +260,7 @@ + if why is not None: + self.excluded_extensions.append((ext, why)) + assert why, "please give a reason, or None" -+ print("Skipping %s: %s" % (ext.name, why)) ++ print(f"Skipping {ext.name}: {why}") + continue + + try: @@ -289,9 +283,7 @@ + target_dir = os.path.join(self.build_lib, clib_file[0], "libs") + if not os.path.exists(target_dir): + self.mkpath(target_dir) -+ suffix = "" -+ if self.debug: -+ suffix = "_d" ++ suffix = "_d" if self.debug else "" + fname = clib_file[1] % suffix + self.copy_file(os.path.join(self.build_temp, fname), target_dir) + @@ -319,19 +311,7 @@ + pass + + def build_exefile(self, ext): -+ sources = ext.sources -+ if sources is None or type(sources) not in (list, tuple): -+ raise DistutilsSetupError( -+ ( -+ "in 'ext_modules' option (extension '%s'), " -+ + "'sources' must be present and must be " -+ + "a list of source filenames" -+ ) -+ % ext.name -+ ) -+ sources = list(sources) -+ -+ log.info("building exe '%s'", ext.name) ++ sources = list(ext.sources) + + fullname = self.get_ext_fullname(ext.name) + if self.inplace: @@ -348,10 +328,10 @@ + ext_filename = os.path.join(self.build_lib, self.get_ext_filename(fullname)) + depends = sources + ext.depends + if not (self.force or newer_group(depends, ext_filename, "newer")): -+ log.debug("skipping '%s' executable (up-to-date)", ext.name) ++ logging.debug("skipping '%s' executable (up-to-date)", ext.name) + return + else: -+ log.info("building '%s' executable", ext.name) ++ logging.info("building '%s' executable", ext.name) + + # First, scan the sources for SWIG definition files (.i), run + # SWIG on 'em to create .c files, and modify the sources list @@ -416,13 +396,13 @@ + if why is not None: + assert why, "please give a reason, or None" + self.excluded_extensions.append((ext, why)) -+ print("Skipping %s: %s" % (ext.name, why)) ++ print(f"Skipping {ext.name}: {why}") + return + self.current_extension = ext + + ext.finalize_options(self) + -+ # ensure the SWIG .i files are treated as dependencies. ++ # Ensure the SWIG .i files are treated as dependencies. + for source in ext.sources: + if source.endswith(".i"): + self.find_swig() # for the side-effect of the environment value. @@ -495,17 +475,6 @@ + # Patch up the filenames for various special cases... + if os.path.basename(base) in swig_interface_parents: + swig_targets[source] = base + target_ext -+ elif ( -+ self.current_extension.name == "winxpgui" -+ and os.path.basename(base) == "win32gui" -+ ): -+ # More vile hacks. winxpmodule is built from win32gui.i - -+ # just different #defines are setup for windows.h. -+ new_target = os.path.join( -+ os.path.dirname(base), "winxpgui_swig%s" % (target_ext,) -+ ) -+ swig_targets[source] = new_target -+ new_sources.append(new_target) + else: + new_target = "%s_swig%s" % (base, target_ext) + new_sources.append(new_target) @@ -518,10 +487,7 @@ + + swig = self.find_swig() + for source in swig_sources: -+ swig_cmd = [swig, "-python", "-c++"] -+ swig_cmd.append( -+ "-dnone", -+ ) # we never use the .doc files. ++ swig_cmd = [swig, "-python", "-c++", "-dnone"] + swig_cmd.extend(self.current_extension.extra_swig_commands) + + if "64 bit" in sys.version: @@ -559,10 +525,10 @@ + if source == "com/win32comext/mapi/src/exchange.i": + rebuild = True + -+ log.debug("should swig %s->%s=%s", source, target, rebuild) ++ logging.debug("should swig %s->%s=%s", source, target, rebuild) + if rebuild: + swig_cmd.extend(["-o", fqtarget, fqsource]) -+ log.info("swigging %s to %s", source, target) ++ logging.info("swigging %s to %s", source, target) + out_dir = os.path.dirname(source) + cwd = os.getcwd() + os.chdir(out_dir) @@ -571,7 +537,7 @@ + finally: + os.chdir(cwd) + else: -+ log.info("skipping swig of %s", source) ++ logging.info("skipping swig of %s", source) + + return new_sources + @@ -579,58 +545,41 @@ class my_install(install): def run(self): install.run(self) -@@ -928,7 +1419,10 @@ - if not self.dry_run and not self.root: +@@ -895,7 +1363,7 @@ class my_install(install): + # some other directory than Python itself (eg, into a temp directory + # for bdist_wininst to use) - in which case we must *not* run our + # installer +- if not self.dry_run and not self.root: ++ if "MSC" in sys.version and not self.dry_run and not self.root: # We must run the script we just installed into Scripts, as it # may have had 2to3 run over it. -- filename = os.path.join(self.install_scripts, "pywin32_postinstall.py") -+ if "MSC" in sys.version: -+ filename = os.path.join(self.install_scripts, "pywin32_postinstall.py") -+ else: -+ filename = os.path.join(self.prefix, "bin", "pywin32_postinstall.py") - if not os.path.isfile(filename): - raise RuntimeError("Can't find '%s'" % (filename,)) - print("Executing post install script...") -@@ -966,19 +1460,25 @@ - - - def my_new_compiler(**kw): -- if "compiler" in kw and kw["compiler"] in (None, "msvc"): -+ if "compiler" in kw and kw["compiler"] in (None, "msvc", "mingw32"): - return my_compiler() - return orig_new_compiler(**kw) - - - # No way to cleanly wedge our compiler sub-class in. - from distutils import ccompiler --from distutils._msvccompiler import MSVCCompiler -+if "MSC" in sys.version: -+ from distutils._msvccompiler import MSVCCompiler -+else: -+ from distutils.cygwinccompiler import Mingw32CCompiler - + filename = os.path.join(self.install_scripts, "pywin32_postinstall.py") +@@ -945,14 +1413,21 @@ def my_new_compiler(**kw): orig_new_compiler = ccompiler.new_compiler - ccompiler.new_compiler = my_new_compiler + ccompiler.new_compiler = my_new_compiler # type: ignore[assignment] # Assuming the caller will always use only kwargs --base_compiler = MSVCCompiler +if "MSC" in sys.version: + base_compiler = MSVCCompiler +else: ++ from distutils.cygwinccompiler import Mingw32CCompiler + base_compiler = Mingw32CCompiler ++ - - class my_compiler(base_compiler): -@@ -986,7 +1486,8 @@ +-class my_compiler(MSVCCompiler): ++class my_compiler(base_compiler): + # Just one GUIDS.CPP and it gives trouble on mainwin too. Maybe I # should just rename the file, but a case-only rename is likely to be # worse! This can probably go away once we kill the VS project files # though, as we can just specify the lowercase name in the module def. -- _cpp_extensions = base_compiler._cpp_extensions + [".CPP"] +- _cpp_extensions = MSVCCompiler._cpp_extensions + [".CPP"] +- src_extensions = MSVCCompiler.src_extensions + [".CPP"] + if "MSC" in sys.version: + _cpp_extensions = base_compiler._cpp_extensions + [".CPP"] - src_extensions = base_compiler.src_extensions + [".CPP"] ++ src_extensions = base_compiler.src_extensions + [".CPP"] def link( -@@ -1060,7 +1561,7 @@ + self, +@@ -1025,7 +1500,7 @@ class my_compiler(MSVCCompiler): return (e, b) sources = sorted(sources, key=key_reverse_mc) @@ -639,7 +588,7 @@ def spawn(self, cmd): is_link = cmd[0].endswith("link.exe") or cmd[0].endswith('"link.exe"') -@@ -1123,6 +1624,10 @@ +@@ -1085,6 +1560,10 @@ class my_install_data(install_data): ################################################################ @@ -650,7 +599,7 @@ pywintypes = WinExt_system32( "pywintypes", sources=[ -@@ -1148,6 +1653,7 @@ +@@ -1110,6 +1589,7 @@ pywintypes = WinExt_system32( ], extra_compile_args=["-DBUILD_PYWINTYPES"], libraries="advapi32 user32 ole32 oleaut32", @@ -658,7 +607,7 @@ pch_header="PyWinTypes.h", ) -@@ -1189,7 +1695,7 @@ +@@ -1151,7 +1631,7 @@ for info in ( ("win32cred", "AdvAPI32 credui", 0x0501, "win32/src/win32credmodule.cpp"), ( "win32crypt", @@ -667,7 +616,7 @@ 0x0500, """ win32/src/win32crypt/win32cryptmodule.cpp -@@ -1308,7 +1814,7 @@ +@@ -1269,7 +1749,7 @@ win32_extensions += [ WinExt_win32( "win32evtlog", sources=""" @@ -676,7 +625,7 @@ """.split(), libraries="advapi32 oleaut32", delay_load_libraries="wevtapi", -@@ -1390,6 +1896,13 @@ +@@ -1338,6 +1818,13 @@ dirs = { "win32com": "com/win32com/src", } @@ -690,9 +639,9 @@ # The COM modules. pythoncom = WinExt_system32( "pythoncom", -@@ -1467,9 +1980,10 @@ - """ - % dirs +@@ -1417,9 +1904,10 @@ pythoncom = WinExt_system32( + **dirs + ) ).split(), - libraries="oleaut32 ole32 user32 urlmon", + libraries="oleaut32 ole32 user32 urlmon" + pythoncom_dep, @@ -702,16 +651,16 @@ pch_header="stdafx.h", windows_h_version=0x500, base_address=dll_base_address, -@@ -1479,7 +1993,7 @@ - com_extensions += [ +@@ -1429,7 +1917,7 @@ com_extensions = [ + pythoncom, WinExt_win32com( "adsi", - libraries="ACTIVEDS ADSIID user32 advapi32", + libraries="activeds adsiid user32 advapi32", sources=( """ - %(adsi)s/adsi.i %(adsi)s/adsi.cpp -@@ -1981,6 +2495,7 @@ + {adsi}/adsi.i {adsi}/adsi.cpp +@@ -1948,6 +2436,7 @@ pythonwin_extensions = [ "Pythonwin/Win32uiHostGlue.h", "Pythonwin/win32win.h", ], @@ -719,22 +668,34 @@ optional_headers=["afxres.h"], ), WinExt_pythonwin( -@@ -2226,6 +2741,9 @@ +@@ -2188,6 +2677,12 @@ ext_modules = ( win32_extensions + com_extensions + pythonwin_extensions + other_extensions ) +if "GCC" in sys.version: + my_build_ext = mingw_build_ext ++ install_scripts = [] ++else: ++ install_scripts = ["pywin32_postinstall.py", "pywin32_testall.py"] + cmdclass = { "install": my_install, "build": my_build, -@@ -2418,7 +2936,7 @@ - print("*** NOTE: The following extensions were NOT %s:" % what_string) - for ext, why in excluded_extensions: - print(" %s: %s" % (ext.name, why)) -- if ext.name not in skip_whitelist: -+ if "MSC" in sys.version and ext.name not in skip_whitelist: - skipped_ex.append(ext.name) - print("For more details on installing the correct libraries and headers,") - print("please execute this script with no arguments (or see the docstring)") +@@ -2272,7 +2767,7 @@ dist = setup( + "user_access_control": "auto", + }, + }, +- scripts=["pywin32_postinstall.py", "pywin32_testall.py"], ++ scripts=install_scripts, + ext_modules=ext_modules, + package_dir={ + "win32com": "com/win32com", +@@ -2381,7 +2876,7 @@ if "build_ext" in dist.command_obj: + print("*** NOTE: The following extensions were NOT %s:" % what_string) + for ext, why in excluded_extensions: + print(f" {ext.name}: {why}") +- if ext.name not in skip_whitelist: ++ if "MSC" in sys.version and ext.name not in skip_whitelist: + skipped_ex.append(ext.name) + print("For more details on installing the correct libraries and headers,") + print("please execute this script with no arguments (or see the docstring)") diff --git a/mingw-w64-python-pywin32/002-com-extensions-fix.patch b/mingw-w64-python-pywin32/002-com-extensions-fix.patch index a411494ed6218..a8b08f4c454f3 100644 --- a/mingw-w64-python-pywin32/002-com-extensions-fix.patch +++ b/mingw-w64-python-pywin32/002-com-extensions-fix.patch @@ -1,7 +1,8 @@ -diff -urN pywin32-b306-orig/com/win32com/src/ErrorUtils.cpp pywin32-b306/com/win32com/src/ErrorUtils.cpp ---- pywin32-b306-orig/com/win32com/src/ErrorUtils.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32com/src/ErrorUtils.cpp 2023-04-07 08:42:45.201381100 +0800 -@@ -1076,18 +1076,18 @@ +diff --git a/com/win32com/src/ErrorUtils.cpp b/com/win32com/src/ErrorUtils.cpp +index ff16d99..a67bf64 100644 +--- a/com/win32com/src/ErrorUtils.cpp ++++ b/com/win32com/src/ErrorUtils.cpp +@@ -1070,18 +1070,18 @@ LPCTSTR GetScodeRangeString(HRESULT hr) } static const RANGE_ENTRY hrRangeTable[] = { @@ -32,10 +33,11 @@ diff -urN pywin32-b306-orig/com/win32com/src/ErrorUtils.cpp pywin32-b306/com/win }; #undef MAKE_RANGE_ENTRY -diff -urN pywin32-b306-orig/com/win32com/src/MiscTypes.cpp pywin32-b306/com/win32com/src/MiscTypes.cpp ---- pywin32-b306-orig/com/win32com/src/MiscTypes.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32com/src/MiscTypes.cpp 2023-04-07 08:42:45.257401900 +0800 -@@ -288,7 +288,7 @@ +diff --git a/com/win32com/src/MiscTypes.cpp b/com/win32com/src/MiscTypes.cpp +index 64808d6..82bb805 100644 +--- a/com/win32com/src/MiscTypes.cpp ++++ b/com/win32com/src/MiscTypes.cpp +@@ -288,7 +288,7 @@ PyTypeObject PyOleArgNotFoundType = { BOOL PyObject_AsOLEMENUGROUPWIDTHS(PyObject *oblpMenuWidths, OLEMENUGROUPWIDTHS *pWidths) { return PyArg_ParseTuple(oblpMenuWidths, "iiiiii", &pWidths->width[0], &pWidths->width[1], &pWidths->width[2], @@ -44,10 +46,11 @@ diff -urN pywin32-b306-orig/com/win32com/src/MiscTypes.cpp pywin32-b306/com/win3 } PyObject *PyObject_FromOLEMENUGROUPWIDTHS(const OLEMENUGROUPWIDTHS *pWidths) -diff -urN pywin32-b306-orig/com/win32com/src/PyIUnknown.cpp pywin32-b306/com/win32com/src/PyIUnknown.cpp ---- pywin32-b306-orig/com/win32com/src/PyIUnknown.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32com/src/PyIUnknown.cpp 2023-04-07 08:45:29.481350500 +0800 -@@ -31,8 +31,16 @@ +diff --git a/com/win32com/src/PyIUnknown.cpp b/com/win32com/src/PyIUnknown.cpp +index 1473cb8..96c5959 100644 +--- a/com/win32com/src/PyIUnknown.cpp ++++ b/com/win32com/src/PyIUnknown.cpp +@@ -31,8 +31,16 @@ PyObject *PyIUnknown::repr() { // @comm The repr of this object displays both the object's address, and its attached IUnknown's address char buf[256]; @@ -64,10 +67,11 @@ diff -urN pywin32-b306-orig/com/win32com/src/PyIUnknown.cpp pywin32-b306/com/win } /*static*/ IUnknown *PyIUnknown::GetI(PyObject *self) -diff -urN pywin32-b306-orig/com/win32com/src/PyRecord.cpp pywin32-b306/com/win32com/src/PyRecord.cpp ---- pywin32-b306-orig/com/win32com/src/PyRecord.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32com/src/PyRecord.cpp 2023-04-08 02:34:17.144054500 +0800 -@@ -348,7 +348,7 @@ +diff --git a/com/win32com/src/PyRecord.cpp b/com/win32com/src/PyRecord.cpp +index df389bf..abf746d 100644 +--- a/com/win32com/src/PyRecord.cpp ++++ b/com/win32com/src/PyRecord.cpp +@@ -348,7 +348,7 @@ static void _FreeFieldNames(BSTR *strings, ULONG num_names) delete[] strings; } @@ -76,7 +80,7 @@ diff -urN pywin32-b306-orig/com/win32com/src/PyRecord.cpp pywin32-b306/com/win32 { if (!w) { // hrm - string version doesn't do this, but I saw PyObject_Repr() return NULL... Py_XDECREF(*pv); -@@ -360,7 +360,7 @@ +@@ -360,7 +360,7 @@ void PyWinCoreString_Concat(register PyObject **pv, register PyObject *w) *pv = tmp; } @@ -85,10 +89,11 @@ diff -urN pywin32-b306-orig/com/win32com/src/PyRecord.cpp pywin32-b306/com/win32 { PyWinCoreString_Concat(pv, w); Py_XDECREF(w); -diff -urN pywin32-b306-orig/com/win32com/src/dllmain.cpp pywin32-b306/com/win32com/src/dllmain.cpp ---- pywin32-b306-orig/com/win32com/src/dllmain.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32com/src/dllmain.cpp 2023-04-07 08:45:29.767019800 +0800 -@@ -134,7 +134,7 @@ +diff --git a/com/win32com/src/dllmain.cpp b/com/win32com/src/dllmain.cpp +index bac646e..03e13db 100644 +--- a/com/win32com/src/dllmain.cpp ++++ b/com/win32com/src/dllmain.cpp +@@ -125,7 +125,7 @@ extern "C" __declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD ** tell us). */ @@ -97,10 +102,11 @@ diff -urN pywin32-b306-orig/com/win32com/src/dllmain.cpp pywin32-b306/com/win32c /* ** we don't need to be notified about threads -diff -urN pywin32-b306-orig/com/win32com/src/extensions/PyIPropertySetStorage.cpp pywin32-b306/com/win32com/src/extensions/PyIPropertySetStorage.cpp ---- pywin32-b306-orig/com/win32com/src/extensions/PyIPropertySetStorage.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32com/src/extensions/PyIPropertySetStorage.cpp 2023-04-07 08:45:29.842007700 +0800 -@@ -173,7 +173,7 @@ +diff --git a/com/win32com/src/extensions/PyIPropertySetStorage.cpp b/com/win32com/src/extensions/PyIPropertySetStorage.cpp +index 8f8b96c..fb000df 100644 +--- a/com/win32com/src/extensions/PyIPropertySetStorage.cpp ++++ b/com/win32com/src/extensions/PyIPropertySetStorage.cpp +@@ -172,7 +172,7 @@ STDMETHODIMP PyGPropertySetStorage::Create( TmpPyObject obfmtid = PyWinObject_FromIID(rfmtid); if (obfmtid == NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("Create"); @@ -109,7 +115,7 @@ diff -urN pywin32-b306-orig/com/win32com/src/extensions/PyIPropertySetStorage.cp } if (FAILED(hr)) return hr; -@@ -196,7 +196,7 @@ +@@ -195,7 +195,7 @@ STDMETHODIMP PyGPropertySetStorage::Open( if (ppprstg == NULL) return E_POINTER; PyObject *result; @@ -118,10 +124,11 @@ diff -urN pywin32-b306-orig/com/win32com/src/extensions/PyIPropertySetStorage.cp if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params -diff -urN pywin32-b306-orig/com/win32com/src/extensions/PyIPropertyStorage.cpp pywin32-b306/com/win32com/src/extensions/PyIPropertyStorage.cpp ---- pywin32-b306-orig/com/win32com/src/extensions/PyIPropertyStorage.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32com/src/extensions/PyIPropertyStorage.cpp 2023-04-07 08:45:29.855013200 +0800 -@@ -951,7 +951,7 @@ +diff --git a/com/win32com/src/extensions/PyIPropertyStorage.cpp b/com/win32com/src/extensions/PyIPropertyStorage.cpp +index bbc2c07..7f7b482 100644 +--- a/com/win32com/src/extensions/PyIPropertyStorage.cpp ++++ b/com/win32com/src/extensions/PyIPropertyStorage.cpp +@@ -950,7 +950,7 @@ STDMETHODIMP PyGPropertyStorage::WriteMultiple( TmpPyObject obpropvars = PyObject_FromPROPVARIANTs((PROPVARIANT *)rgpropvar, cpspec); if (obpropvars == NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("WriteMultiple"); @@ -130,7 +137,7 @@ diff -urN pywin32-b306-orig/com/win32com/src/extensions/PyIPropertyStorage.cpp p } return hr; } -@@ -1045,7 +1045,7 @@ +@@ -1044,7 +1044,7 @@ STDMETHODIMP PyGPropertyStorage::WritePropertyNames( TmpPyObject obnames = PyWinObject_FromWCHARArray(rglpwstrName, cpropid); if (obnames == NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("WritePropertyNames"); @@ -139,7 +146,7 @@ diff -urN pywin32-b306-orig/com/win32com/src/extensions/PyIPropertyStorage.cpp p } } -@@ -1130,7 +1130,7 @@ +@@ -1129,7 +1129,7 @@ STDMETHODIMP PyGPropertyStorage::SetTimes( Py_INCREF(Py_None); obmtime = Py_None; } @@ -148,10 +155,11 @@ diff -urN pywin32-b306-orig/com/win32com/src/extensions/PyIPropertyStorage.cpp p } return hr; } -diff -urN pywin32-b306-orig/com/win32com/src/include/PythonCOM.h pywin32-b306/com/win32com/src/include/PythonCOM.h ---- pywin32-b306-orig/com/win32com/src/include/PythonCOM.h 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32com/src/include/PythonCOM.h 2023-04-07 08:45:29.875009000 +0800 -@@ -110,10 +110,21 @@ +diff --git a/com/win32com/src/include/PythonCOM.h b/com/win32com/src/include/PythonCOM.h +index 446500a..3e47c9e 100644 +--- a/com/win32com/src/include/PythonCOM.h ++++ b/com/win32com/src/include/PythonCOM.h +@@ -92,10 +92,21 @@ #ifdef __MINGW32__ // Special Mingw32 considerations. @@ -175,10 +183,11 @@ diff -urN pywin32-b306-orig/com/win32com/src/include/PythonCOM.h pywin32-b306/co #endif // __MINGW32__ -diff -urN pywin32-b306-orig/com/win32com/src/univgw.cpp pywin32-b306/com/win32com/src/univgw.cpp ---- pywin32-b306-orig/com/win32com/src/univgw.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32com/src/univgw.cpp 2023-04-07 08:58:31.718696400 +0800 -@@ -253,7 +253,7 @@ +diff --git a/com/win32com/src/univgw.cpp b/com/win32com/src/univgw.cpp +index 73616e4..1168bc6 100644 +--- a/com/win32com/src/univgw.cpp ++++ b/com/win32com/src/univgw.cpp +@@ -253,7 +253,7 @@ static pfnGWMethod make_method(DWORD index, UINT argsize, UINT argc) } *(int *)(code + 30) = index; @@ -187,9 +196,10 @@ diff -urN pywin32-b306-orig/com/win32com/src/univgw.cpp pywin32-b306/com/win32co DWORD oldprotect; if (!VirtualProtect(code, sizeof(wrapper), PAGE_EXECUTE, &oldprotect)) { -diff -urN pywin32-b306-orig/com/win32comext/adsi/src/PyIADs.cpp pywin32-b306/com/win32comext/adsi/src/PyIADs.cpp ---- pywin32-b306-orig/com/win32comext/adsi/src/PyIADs.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/adsi/src/PyIADs.cpp 2023-04-07 08:58:39.006455600 +0800 +diff --git a/com/win32comext/adsi/src/PyIADs.cpp b/com/win32comext/adsi/src/PyIADs.cpp +index 1452a5d..bd88d49 100644 +--- a/com/win32comext/adsi/src/PyIADs.cpp ++++ b/com/win32comext/adsi/src/PyIADs.cpp @@ -4,8 +4,8 @@ // getattr for the type. // All "get_" methods have been exposed as properties. @@ -201,10 +211,11 @@ diff -urN pywin32-b306-orig/com/win32comext/adsi/src/PyIADs.cpp pywin32-b306/com #include "PyIADs.h" // @doc - This file contains autoduck documentation -diff -urN pywin32-b306-orig/com/win32comext/adsi/src/PyIDirectoryObject.i pywin32-b306/com/win32comext/adsi/src/PyIDirectoryObject.i ---- pywin32-b306-orig/com/win32comext/adsi/src/PyIDirectoryObject.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/adsi/src/PyIDirectoryObject.i 2023-04-07 08:58:39.017474900 +0800 -@@ -120,17 +120,17 @@ +diff --git a/com/win32comext/adsi/src/PyIDirectoryObject.i b/com/win32comext/adsi/src/PyIDirectoryObject.i +index a656092..e4a4c37 100644 +--- a/com/win32comext/adsi/src/PyIDirectoryObject.i ++++ b/com/win32comext/adsi/src/PyIDirectoryObject.i +@@ -120,17 +120,17 @@ PyObject *PyIDirectoryObject::CreateDSObject(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "OO:CreateDSObject", &obName, &obAttr)) return NULL; @@ -228,10 +239,11 @@ diff -urN pywin32-b306-orig/com/win32comext/adsi/src/PyIDirectoryObject.i pywin3 Py_BEGIN_ALLOW_THREADS _result = (HRESULT )_swig_self->CreateDSObject(szName, attr, cattr, &pRet); -diff -urN pywin32-b306-orig/com/win32comext/adsi/src/PyIDirectorySearch.i pywin32-b306/com/win32comext/adsi/src/PyIDirectorySearch.i ---- pywin32-b306-orig/com/win32comext/adsi/src/PyIDirectorySearch.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/adsi/src/PyIDirectorySearch.i 2023-04-07 08:58:39.027474800 +0800 -@@ -81,9 +81,9 @@ +diff --git a/com/win32comext/adsi/src/PyIDirectorySearch.i b/com/win32comext/adsi/src/PyIDirectorySearch.i +index f32aec8..2d56186 100644 +--- a/com/win32comext/adsi/src/PyIDirectorySearch.i ++++ b/com/win32comext/adsi/src/PyIDirectorySearch.i +@@ -81,9 +81,9 @@ PyObject *PyIDirectorySearch::ExecuteSearch(PyObject *self, PyObject *args) // @pyparm [, ...]|attrNames|| if (!PyArg_ParseTuple(args, "OO", &obFilter, &obNames)) return NULL; @@ -244,7 +256,7 @@ diff -urN pywin32-b306-orig/com/win32comext/adsi/src/PyIDirectorySearch.i pywin3 WCHAR **names = NULL; DWORD cnames = -1; -@@ -94,7 +94,7 @@ +@@ -94,7 +94,7 @@ PyObject *PyIDirectorySearch::ExecuteSearch(PyObject *self, PyObject *args) } HRESULT _result; @@ -253,18 +265,19 @@ diff -urN pywin32-b306-orig/com/win32comext/adsi/src/PyIDirectorySearch.i pywin3 Py_BEGIN_ALLOW_THREADS _result = (HRESULT )_swig_self->ExecuteSearch(szFilter, names, cnames, &handle); -@@ -106,7 +106,7 @@ +@@ -106,7 +106,7 @@ PyObject *PyIDirectorySearch::ExecuteSearch(PyObject *self, PyObject *args) ret = PyLong_FromSsize_t((Py_ssize_t)handle); - } + } PyADSI_FreeNames(names, cnames); - PyWinObject_FreeWCHAR(szFilter); + PyWinObject_FreeWCHAR(szFilter); return ret; } -diff -urN pywin32-b306-orig/com/win32comext/adsi/src/adsilib.i pywin32-b306/com/win32comext/adsi/src/adsilib.i ---- pywin32-b306-orig/com/win32comext/adsi/src/adsilib.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/adsi/src/adsilib.i 2023-04-07 08:58:39.038456000 +0800 +diff --git a/com/win32comext/adsi/src/adsilib.i b/com/win32comext/adsi/src/adsilib.i +index fa74a61..c5ad193 100644 +--- a/com/win32comext/adsi/src/adsilib.i ++++ b/com/win32comext/adsi/src/adsilib.i @@ -1,7 +1,12 @@ /* ADSI SWIG Support */ @@ -279,10 +292,11 @@ diff -urN pywin32-b306-orig/com/win32comext/adsi/src/adsilib.i pywin32-b306/com/ extern PyObject *OleSetADSIError(HRESULT hr, IUnknown *pUnk, REFIID iid); %} -diff -urN pywin32-b306-orig/com/win32comext/axcontrol/src/PyIOleInPlaceSiteWindowless.cpp pywin32-b306/com/win32comext/axcontrol/src/PyIOleInPlaceSiteWindowless.cpp ---- pywin32-b306-orig/com/win32comext/axcontrol/src/PyIOleInPlaceSiteWindowless.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/axcontrol/src/PyIOleInPlaceSiteWindowless.cpp 2023-04-07 09:00:42.610136400 +0800 -@@ -394,7 +394,7 @@ +diff --git a/com/win32comext/axcontrol/src/PyIOleInPlaceSiteWindowless.cpp b/com/win32comext/axcontrol/src/PyIOleInPlaceSiteWindowless.cpp +index 4e6c0e4..c35fd36 100644 +--- a/com/win32comext/axcontrol/src/PyIOleInPlaceSiteWindowless.cpp ++++ b/com/win32comext/axcontrol/src/PyIOleInPlaceSiteWindowless.cpp +@@ -394,7 +394,7 @@ STDMETHODIMP PyGOleInPlaceSiteWindowless::InvalidateRgn( /* [in] */ BOOL fErase) { PY_GATEWAY_METHOD; @@ -291,10 +305,11 @@ diff -urN pywin32-b306-orig/com/win32comext/axcontrol/src/PyIOleInPlaceSiteWindo return hr; } -diff -urN pywin32-b306-orig/com/win32comext/axcontrol/src/PyIViewObject.cpp pywin32-b306/com/win32comext/axcontrol/src/PyIViewObject.cpp ---- pywin32-b306-orig/com/win32comext/axcontrol/src/PyIViewObject.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/axcontrol/src/PyIViewObject.cpp 2023-04-07 09:00:42.624137500 +0800 -@@ -256,7 +256,7 @@ +diff --git a/com/win32comext/axcontrol/src/PyIViewObject.cpp b/com/win32comext/axcontrol/src/PyIViewObject.cpp +index 5d66cbb..5d7db00 100644 +--- a/com/win32comext/axcontrol/src/PyIViewObject.cpp ++++ b/com/win32comext/axcontrol/src/PyIViewObject.cpp +@@ -256,7 +256,7 @@ STDMETHODIMP PyGViewObject::Draw( Py_BuildValue("llll", lprcWBounds->left, lprcWBounds->top, lprcWBounds->right, lprcWBounds->bottom); if (oblprcWBounds == NULL) return PyCom_HandlePythonFailureToCOM(); @@ -303,9 +318,10 @@ diff -urN pywin32-b306-orig/com/win32comext/axcontrol/src/PyIViewObject.cpp pywi if (obFuncContinue == NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *obContinue = PyWinObject_FromULONG_PTR(dwContinue); -diff -urN pywin32-b306-orig/com/win32comext/ifilter/src/stdafx.h pywin32-b306/com/win32comext/ifilter/src/stdafx.h ---- pywin32-b306-orig/com/win32comext/ifilter/src/stdafx.h 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/ifilter/src/stdafx.h 2023-04-07 09:00:42.637160600 +0800 +diff --git a/com/win32comext/ifilter/src/stdafx.h b/com/win32comext/ifilter/src/stdafx.h +index 8a9b1c2..973248f 100644 +--- a/com/win32comext/ifilter/src/stdafx.h ++++ b/com/win32comext/ifilter/src/stdafx.h @@ -13,7 +13,9 @@ #include #include @@ -316,12 +332,42 @@ diff -urN pywin32-b306-orig/com/win32comext/ifilter/src/stdafx.h pywin32-b306/co #ifdef MISSING_PROPSTG // Ack - NTQuery.h is failing with the Vista SDK - pull in what we need // Problem is missing propstg.h, and all the work-arounds are uglier than -diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIAddrBook.i pywin32-b306/com/win32comext/mapi/src/PyIAddrBook.i ---- pywin32-b306-orig/com/win32comext/mapi/src/PyIAddrBook.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/mapi/src/PyIAddrBook.i 2023-04-07 09:07:53.795904000 +0800 -@@ -39,14 +39,14 @@ +diff --git a/com/win32comext/mapi/src/mapiutil.cpp b/com/win32comext/mapi/src/mapiutil.cpp +index b704c77..9ede990 100644 +--- a/com/win32comext/mapi/src/mapiutil.cpp ++++ b/com/win32comext/mapi/src/mapiutil.cpp +@@ -1,5 +1,5 @@ + // General utilities and conversion routines for MAPI support. +-#include "pywintypes.h" ++#include "PyWinTypes.h" + #include "PythonCOM.h" + #include "PyMAPIUtil.h" + // @doc +@@ -350,7 +350,7 @@ BOOL PyMAPIObject_AsSPropValue(PyObject *Valob, SPropValue *pv, void *pAllocMore + + default: { + char buf[128]; +- sprintf(buf, "Unsupported MAPI property type 0x%X", PROP_TYPE(pv->ulPropTag)); ++ sprintf(buf, "Unsupported MAPI property type 0x%lX", PROP_TYPE(pv->ulPropTag)); + PyErr_SetString(PyExc_TypeError, buf); + ok = FALSE; + } +@@ -511,7 +511,7 @@ PyObject *PyMAPIObject_FromSPropValue(SPropValue *pv) + break; + + default: +- printf("File %s: Unsupported MAPI property type 0x%X", __FILE__, PROP_TYPE(pv->ulPropTag)); ++ printf("File %s: Unsupported MAPI property type 0x%lX", __FILE__, PROP_TYPE(pv->ulPropTag)); + /* Don't set exception, as this prevents otherwise valid props from + being returned + */ +diff --git a/com/win32comext/mapi/src/PyIAddrBook.i b/com/win32comext/mapi/src/PyIAddrBook.i +index de09011..7f1f2c5 100644 +--- a/com/win32comext/mapi/src/PyIAddrBook.i ++++ b/com/win32comext/mapi/src/PyIAddrBook.i +@@ -39,14 +39,14 @@ HRESULT ResolveName( // @pyswig |OpenEntry|Opens a folder or message and returns an interface object for further access. - PyObject *PyIAddrBook::OpenEntry(PyObject *self, PyObject *args) + PyObject *PyIAddrBook::OpenEntry(PyObject *self, PyObject *args) { - HRESULT _result; - char * entryString; @@ -340,18 +386,18 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIAddrBook.i pywin32-b306/ ULONG resType; PyObject *obEntry; -@@ -55,8 +55,8 @@ +@@ -55,8 +55,8 @@ PyObject *PyIAddrBook::OpenEntry(PyObject *self, PyObject *args) // @pyparm string|entryId||The entryID of the object // @pyparm |iid||The IID of the object to return, or None for the default IID // @pyparm int|flags||Bitmask of flags that controls how the object is opened. -- if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) +- if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) - return NULL; -+ if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) ++ if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) + return NULL; if (obEntry==Py_None) { entryString = NULL; entryStrLen = 0; -@@ -75,12 +75,12 @@ +@@ -75,12 +75,12 @@ PyObject *PyIAddrBook::OpenEntry(PyObject *self, PyObject *args) return NULL; } Py_BEGIN_ALLOW_THREADS @@ -369,21 +415,39 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIAddrBook.i pywin32-b306/ } %} -@@ -101,7 +101,7 @@ +@@ -101,7 +101,7 @@ PyObject *PyIAddrBook::CompareEntryIDs(PyObject *self, PyObject *args) IAddrBook *_swig_self; PyObject *obE1, *obE2; if ((_swig_self=GetI(self))==NULL) return NULL; -- if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", -+ if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", +- if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", ++ if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", &obE1, // @pyparm string|entryId||The first entry ID to be compared &obE2, // @pyparm string|entryId||The second entry ID to be compared &flags)) // @pyparm int|flags|0|Reserved - must be zero. -diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIConverterSession.i pywin32-b306/com/win32comext/mapi/src/PyIConverterSession.i ---- pywin32-b306-orig/com/win32comext/mapi/src/PyIConverterSession.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/mapi/src/PyIConverterSession.i 2023-04-07 09:00:42.677143800 +0800 -@@ -72,9 +72,12 @@ +diff --git a/com/win32comext/mapi/src/PyIAttach.i b/com/win32comext/mapi/src/PyIAttach.i +index a80c4f0..dd1eb5f 100644 +--- a/com/win32comext/mapi/src/PyIAttach.i ++++ b/com/win32comext/mapi/src/PyIAttach.i +@@ -42,10 +42,10 @@ PyObject *PyIAttach::GetLastError(PyObject *self, PyObject *args) + IAttach *_swig_self; + if ((_swig_self=GetI(self))==NULL) return NULL; + +- if(!PyArg_ParseTuple(args,"l|l:GetLastError", ++ if(!PyArg_ParseTuple(args,"l|l:GetLastError", + &hr, // @pyparm int|hr||Contains the error code generated in the previous method call. + &flags)) // @pyparm int|flags||Indicates for format for the output. +- return NULL; ++ return NULL; + + Py_BEGIN_ALLOW_THREADS + hRes = _swig_self->GetLastError(hr, flags, &me); +diff --git a/com/win32comext/mapi/src/PyIConverterSession.i b/com/win32comext/mapi/src/PyIConverterSession.i +index 9496b4d..4fac2dd 100644 +--- a/com/win32comext/mapi/src/PyIConverterSession.i ++++ b/com/win32comext/mapi/src/PyIConverterSession.i +@@ -72,9 +72,12 @@ PyObject *PyIConverterSession::MIMEToMAPI(PyObject *self, PyObject *args) IMessage *pMsg = NULL; - + if (!PyCom_InterfaceFromPyObject(obStream, IID_IStream, (void **)&pStream, FALSE)) - goto done; + if (pStream) @@ -396,53 +460,53 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIConverterSession.i pywin { PY_INTERFACE_PRECALL; -@@ -90,12 +93,6 @@ +@@ -90,12 +93,6 @@ PyObject *PyIConverterSession::MIMEToMAPI(PyObject *self, PyObject *args) result = Py_None; } - + -done: - if (pStream) - pStream->Release(); - if (pMsg) - pMsg->Release(); -- +- return result; } -@@ -117,9 +114,12 @@ +@@ -117,9 +114,11 @@ PyObject *PyIConverterSession::MAPIToMIMEStm(PyObject *self, PyObject *args) IMessage *pMsg = NULL; if (!PyCom_InterfaceFromPyObject(obMsg, IID_IMessage, (void **)&pMsg, FALSE)) -- goto done; -+ if (pStream) -+ pStream->Release(); -+ - if (!PyCom_InterfaceFromPyObject(obStream, IID_IStream, (void **)&pStream, FALSE)) - goto done; + if (pMsg) + pMsg->Release(); + if (!PyCom_InterfaceFromPyObject(obStream, IID_IStream, (void **)&pStream, FALSE)) +- goto done; ++ if (pStream) ++ pStream->Release(); { PY_INTERFACE_PRECALL; -@@ -135,12 +135,6 @@ +@@ -135,12 +134,6 @@ PyObject *PyIConverterSession::MAPIToMIMEStm(PyObject *self, PyObject *args) result = Py_None; } - + -done: - if (pStream) - pStream->Release(); - if (pMsg) - pMsg->Release(); -- +- return result; } -diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIContainer.i pywin32-b306/com/win32comext/mapi/src/PyIMAPIContainer.i ---- pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIContainer.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/mapi/src/PyIMAPIContainer.i 2023-04-07 09:00:42.688174400 +0800 -@@ -30,24 +30,24 @@ - // @pyswig |OpenEntry|Opens an object and returns an interface object for further access. - PyObject *PyIMAPIContainer::OpenEntry(PyObject *self, PyObject *args) +diff --git a/com/win32comext/mapi/src/PyIMAPIContainer.i b/com/win32comext/mapi/src/PyIMAPIContainer.i +index 04e2192..e351441 100644 +--- a/com/win32comext/mapi/src/PyIMAPIContainer.i ++++ b/com/win32comext/mapi/src/PyIMAPIContainer.i +@@ -30,14 +30,14 @@ PyIMAPIContainer::~PyIMAPIContainer() + // @pyswig |OpenEntry|Opens an object and returns an interface object for further access. + PyObject *PyIMAPIContainer::OpenEntry(PyObject *self, PyObject *args) { - HRESULT _result; - char * entryString; @@ -461,22 +525,18 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIContainer.i pywin32- ULONG resType; PyObject *obEntry; - IMAPIContainer *_swig_self; - if ((_swig_self=GetI(self))==NULL) return NULL; -- // @pyparm string|entryId||The EntryID to open. -- // @pyparm |iid||The IID of the returned interface, or None for the default interface. -- // @pyparm int|flags||Flags for the call. May include MAPI_BEST_ACCESS, MAPI_DEFERRED_ERRORS, MAPI_MODIFY and possibly others (see the MAPI documentation) -- if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) +@@ -46,8 +46,8 @@ PyObject *PyIMAPIContainer::OpenEntry(PyObject *self, PyObject *args) + // @pyparm string|entryId||The EntryID to open. + // @pyparm |iid||The IID of the returned interface, or None for the default interface. + // @pyparm int|flags||Flags for the call. May include MAPI_BEST_ACCESS, MAPI_DEFERRED_ERRORS, MAPI_MODIFY and possibly others (see the MAPI documentation) +- if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) - return NULL; -+ // @pyparm string|entryId||The EntryID to open. -+ // @pyparm |iid||The IID of the returned interface, or None for the default interface. -+ // @pyparm int|flags||Flags for the call. May include MAPI_BEST_ACCESS, MAPI_DEFERRED_ERRORS, MAPI_MODIFY and possibly others (see the MAPI documentation) -+ if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) ++ if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) + return NULL; if (obEntry==Py_None) { entryString = NULL; entryStrLen = 0; -@@ -66,12 +66,12 @@ +@@ -66,12 +66,12 @@ PyObject *PyIMAPIContainer::OpenEntry(PyObject *self, PyObject *args) return NULL; } Py_BEGIN_ALLOW_THREADS @@ -494,62 +554,49 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIContainer.i pywin32- } -diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIFolder.i pywin32-b306/com/win32comext/mapi/src/PyIMAPIFolder.i ---- pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIFolder.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/mapi/src/PyIMAPIFolder.i 2023-04-07 09:00:42.696140200 +0800 -@@ -43,10 +43,10 @@ +diff --git a/com/win32comext/mapi/src/PyIMAPIFolder.i b/com/win32comext/mapi/src/PyIMAPIFolder.i +index f67f8b0..89d47a4 100644 +--- a/com/win32comext/mapi/src/PyIMAPIFolder.i ++++ b/com/win32comext/mapi/src/PyIMAPIFolder.i +@@ -43,10 +43,10 @@ PyObject *PyIMAPIFolder::GetLastError(PyObject *self, PyObject *args) IMAPIFolder *_swig_self; if ((_swig_self=GetI(self))==NULL) return NULL; - + - if(!PyArg_ParseTuple(args,"l|l:GetLastError", + if(!PyArg_ParseTuple(args,"l|l:GetLastError", &hr, // @pyparm int|hr||Contains the error code generated in the previous method call. &flags)) // @pyparm int|flags||Indicates for format for the output. - return NULL; + return NULL; - + Py_BEGIN_ALLOW_THREADS hRes = _swig_self->GetLastError(hr, flags, &me); -@@ -156,12 +156,12 @@ +@@ -156,12 +156,12 @@ PyObject *PyIMAPIFolder::DeleteFolder(PyObject *self, PyObject *args) IMAPIFolder *_swig_self; if ((_swig_self=GetI(self))==NULL) return NULL; - + - if(!PyArg_ParseTuple(args,"OOO|l:DeleteFolder", + if(!PyArg_ParseTuple(args,"OOO|l:DeleteFolder", &obEntryId, // @pyparm string|entryId||The EntryID of the subfolder to delete. &obUIParam, // @pyparm long|uiParam||Handle of the parent window of the progress indicator. &obProgress, // @pyparm |progress||A progress object, or None - &flags)) + &flags)) - return NULL; + return NULL; if (PyBytes_Check(obEntryId)) { eid = (LPENTRYID)PyBytes_AsString(obEntryId); cbEID = PyBytes_Size(obEntryId); -diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIProp.i pywin32-b306/com/win32comext/mapi/src/PyIMAPIProp.i ---- pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIProp.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/mapi/src/PyIMAPIProp.i 2023-04-07 09:00:42.707140400 +0800 -@@ -36,29 +36,29 @@ - - // @pyswig int, [items, ]|GetProps|Returns a list of property values. - PyObject *PyIMAPIProp::GetProps(PyObject *self, PyObject *args) { -- PyObject * _resultobj; -- HRESULT _result; -- SPropTagArray * _arg0 = NULL; -- unsigned long _arg1=0; -- PyObject * _obj0 = 0; -+ PyObject * _resultobj; -+ HRESULT _result; -+ SPropTagArray * _arg0 = NULL; -+ unsigned long _arg1=0; -+ PyObject * _obj0 = 0; - - IMAPIProp *_swig_self; +diff --git a/com/win32comext/mapi/src/PyIMAPIProp.i b/com/win32comext/mapi/src/PyIMAPIProp.i +index 65dea9a..5d9eac7 100644 +--- a/com/win32comext/mapi/src/PyIMAPIProp.i ++++ b/com/win32comext/mapi/src/PyIMAPIProp.i +@@ -46,19 +46,19 @@ PyObject *PyIMAPIProp::GetProps(PyObject *self, PyObject *args) { if ((_swig_self=GetI(self))==NULL) return NULL; // @pyparm |propList||The list of properties // @pyparm int|flags|0| -- if(!PyArg_ParseTuple(args,"O|l:GetProps",&_obj0,&_arg1)) +- if(!PyArg_ParseTuple(args,"O|l:GetProps",&_obj0,&_arg1)) - return NULL; -+ if(!PyArg_ParseTuple(args,"O|l:GetProps",&_obj0,&_arg1)) ++ if(!PyArg_ParseTuple(args,"O|l:GetProps",&_obj0,&_arg1)) + return NULL; if (!PyMAPIObject_AsSPropTagArray(_obj0, &_arg0)) return NULL; @@ -569,8 +616,8 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIProp.i pywin32-b306/ _resultobj = PyTuple_New(numValues); if (_resultobj==NULL) { -@@ -86,7 +86,7 @@ - PyObject *PyIMAPIProp::DeleteProps(PyObject *self, PyObject *args) +@@ -86,7 +86,7 @@ PyObject *PyIMAPIProp::GetProps(PyObject *self, PyObject *args) { + PyObject *PyIMAPIProp::DeleteProps(PyObject *self, PyObject *args) { PyObject *obs; - SPropTagArray * _arg0; @@ -578,7 +625,7 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIProp.i pywin32-b306/ HRESULT hr; IMAPIProp *pMAPIProp; PyObject *obWantProblems = Py_False; -@@ -94,7 +94,7 @@ +@@ -94,7 +94,7 @@ PyObject *PyIMAPIProp::DeleteProps(PyObject *self, PyObject *args) if ((pMAPIProp=GetI(self))==NULL) return NULL; // @pyparm |propList||The list of properties // @pyparm bool|wantProblems|False|Return detailed error information @@ -587,7 +634,7 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIProp.i pywin32-b306/ return NULL; int wantProblems = PyObject_IsTrue(obWantProblems); if (wantProblems == -1) -@@ -128,7 +128,7 @@ +@@ -128,7 +128,7 @@ PyObject *PyIMAPIProp::SetProps(PyObject *self, PyObject *args) if ((pMAPIProp=GetI(self))==NULL) return NULL; // @pyparm [, ]|propList||The list of properties // @pyparm bool|wantProblems|False|Return detailed error information @@ -596,7 +643,7 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIProp.i pywin32-b306/ return NULL; if (!PySequence_Check(obs)) { PyErr_SetString(PyExc_TypeError, "Properties must be a sequence of tuples"); -@@ -183,7 +183,7 @@ +@@ -183,7 +183,7 @@ PyObject *PyIMAPIProp::CopyTo(PyObject *self, PyObject *args) // @pyparm |dest||The destination object // @pyparm int|flags||flags // @pyparm bool|wantProblems|False|Return detailed error information @@ -605,7 +652,7 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIProp.i pywin32-b306/ return NULL; int wantProblems = PyObject_IsTrue(obWantProblems); if (wantProblems == -1) -@@ -264,7 +264,7 @@ +@@ -264,7 +264,7 @@ PyObject *PyIMAPIProp::CopyProps(PyObject *self, PyObject *args) // @pyparm |dest||The destination object // @pyparm int|flags||flags // @pyparm bool|wantProblems|False|Return detailed error information @@ -614,34 +661,35 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPIProp.i pywin32-b306/ return NULL; int wantProblems = PyObject_IsTrue(obWantProblems); if (wantProblems == -1) -@@ -314,7 +314,7 @@ +@@ -314,7 +314,7 @@ PyObject *PyIMAPIProp::OpenProperty(PyObject *self, PyObject *args) // @pyparm |iid||The IID of the resulting interface. - // @pyparm int|interfaceOptions||Data that relates to the interface identified by the lpiid parameter. + // @pyparm int|interfaceOptions||Data that relates to the interface identified by the lpiid parameter. // @pyparm int|flags||flags - if(!PyArg_ParseTuple(args,"kOll:OpenProperty",&propTag, &obIID, &interfaceOptions, &flags)) + if(!PyArg_ParseTuple(args,"kOll:OpenProperty",&propTag, &obIID, &interfaceOptions, &flags)) return NULL; // IID. if (!PyWinObject_AsIID(obIID, &iid)) -@@ -418,10 +418,10 @@ +@@ -418,10 +418,10 @@ PyObject *PyIMAPIProp::GetLastError(PyObject *self, PyObject *args) IMAPIProp *_swig_self; if ((_swig_self=GetI(self))==NULL) return NULL; - + - if(!PyArg_ParseTuple(args,"l|l:GetLastError", + if(!PyArg_ParseTuple(args,"l|l:GetLastError", &hr, // @pyparm int|hr||Contains the error code generated in the previous method call. &flags)) // @pyparm int|flags||Indicates for format for the output. - return NULL; + return NULL; - + Py_BEGIN_ALLOW_THREADS hRes = _swig_self->GetLastError(hr, flags, &me); -diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPISession.i pywin32-b306/com/win32comext/mapi/src/PyIMAPISession.i ---- pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPISession.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/mapi/src/PyIMAPISession.i 2023-04-07 09:07:25.427721900 +0800 -@@ -35,14 +35,14 @@ - // @pyswig |OpenEntry|Opens an object and returns an interface object for further access. - PyObject *PyIMAPISession::OpenEntry(PyObject *self, PyObject *args) +diff --git a/com/win32comext/mapi/src/PyIMAPISession.i b/com/win32comext/mapi/src/PyIMAPISession.i +index 293d36c..f51e053 100644 +--- a/com/win32comext/mapi/src/PyIMAPISession.i ++++ b/com/win32comext/mapi/src/PyIMAPISession.i +@@ -35,14 +35,14 @@ PyIMAPISession::~PyIMAPISession() + // @pyswig |OpenEntry|Opens an object and returns an interface object for further access. + PyObject *PyIMAPISession::OpenEntry(PyObject *self, PyObject *args) { - HRESULT _result; - char *entryString; @@ -660,18 +708,18 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPISession.i pywin32-b3 ULONG resType; PyObject *obEntry; -@@ -51,8 +51,8 @@ +@@ -51,8 +51,8 @@ PyObject *PyIMAPISession::OpenEntry(PyObject *self, PyObject *args) // @pyparm string|entryId||The EntryID to open. // @pyparm |iid||The IID of the returned interface, or None for the default interface. // @pyparm int|flags||Flags for the call. May include MAPI_BEST_ACCESS, MAPI_DEFERRED_ERRORS, MAPI_MODIFY and possibly others (see the MAPI documentation) -- if(!PyArg_ParseTuple(args,"OOl:OpenEntry", &obEntry, &objIID, &flags)) +- if(!PyArg_ParseTuple(args,"OOl:OpenEntry", &obEntry, &objIID, &flags)) - return NULL; -+ if(!PyArg_ParseTuple(args,"OOl:OpenEntry", &obEntry, &objIID, &flags)) ++ if(!PyArg_ParseTuple(args,"OOl:OpenEntry", &obEntry, &objIID, &flags)) + return NULL; if (obEntry==Py_None) { entryString = NULL; entryStrLen = 0; -@@ -71,11 +71,11 @@ +@@ -71,11 +71,11 @@ PyObject *PyIMAPISession::OpenEntry(PyObject *self, PyObject *args) return NULL; } Py_BEGIN_ALLOW_THREADS @@ -687,9 +735,9 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPISession.i pywin32-b3 return PyMAPIObject_FromTypedUnknown( resType, pUnk, FALSE /*bAddRef*/); } %} -@@ -85,24 +85,24 @@ +@@ -85,15 +85,15 @@ PyObject *PyIMAPISession::OpenEntry(PyObject *self, PyObject *args) // @pyswig |OpenMsgStore|Opens a message store. - PyObject *PyIMAPISession::OpenMsgStore(PyObject *self, PyObject *args) + PyObject *PyIMAPISession::OpenMsgStore(PyObject *self, PyObject *args) { - HRESULT _result; - char * entryString; @@ -710,22 +758,18 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPISession.i pywin32-b3 IMAPISession *_swig_self; if ((_swig_self=GetI(self))==NULL) return NULL; -- // @pyparm int|uiParam||Handle to the parent window for dialogs. -- // @pyparm string|entryId||The entry ID of the message store to open. -- // @pyparm |iid||The IID of the interface returned, or None -- // @pyparm int|flags||Options for the call. -- if(!PyArg_ParseTuple(args,"ls#Ol:OpenMsgStore",&ulParm,&entryString,&entryStrLen, &objIID,&flags)) +@@ -101,8 +101,8 @@ PyObject *PyIMAPISession::OpenMsgStore(PyObject *self, PyObject *args) + // @pyparm string|entryId||The entry ID of the message store to open. + // @pyparm |iid||The IID of the interface returned, or None + // @pyparm int|flags||Options for the call. +- if(!PyArg_ParseTuple(args,"ls#Ol:OpenMsgStore",&ulParm,&entryString,&entryStrLen, &objIID,&flags)) - return NULL; -+ // @pyparm int|uiParam||Handle to the parent window for dialogs. -+ // @pyparm string|entryId||The entry ID of the message store to open. -+ // @pyparm |iid||The IID of the interface returned, or None -+ // @pyparm int|flags||Options for the call. -+ if(!PyArg_ParseTuple(args,"ls#Ol:OpenMsgStore",&ulParm,&entryString,&entryStrLen, &objIID,&flags)) ++ if(!PyArg_ParseTuple(args,"ls#Ol:OpenMsgStore",&ulParm,&entryString,&entryStrLen, &objIID,&flags)) + return NULL; if (objIID==Py_None) pIID = NULL; else { -@@ -111,13 +111,13 @@ +@@ -111,13 +111,13 @@ PyObject *PyIMAPISession::OpenMsgStore(PyObject *self, PyObject *args) return NULL; } Py_BEGIN_ALLOW_THREADS @@ -745,18 +789,18 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPISession.i pywin32-b3 } %} -@@ -131,8 +131,8 @@ +@@ -131,8 +131,8 @@ PyObject *PyIMAPISession::QueryIdentity(PyObject *self, PyObject *args) LPENTRYID peid; IMAPISession *_swig_self; if ((_swig_self=GetI(self))==NULL) return NULL; -- if(!PyArg_ParseTuple(args,":QueryIdentity")) +- if(!PyArg_ParseTuple(args,":QueryIdentity")) - return NULL; -+ if(!PyArg_ParseTuple(args,":QueryIdentity")) ++ if(!PyArg_ParseTuple(args,":QueryIdentity")) + return NULL; HRESULT _result; Py_BEGIN_ALLOW_THREADS -@@ -142,8 +142,8 @@ +@@ -142,8 +142,8 @@ PyObject *PyIMAPISession::QueryIdentity(PyObject *self, PyObject *args) if (_result==S_OK) rc = PyBytes_FromStringAndSize((char *)peid, cb); else if (FAILED(_result)) { @@ -767,34 +811,35 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMAPISession.i pywin32-b3 rc = Py_None; Py_INCREF(Py_None); } -@@ -223,7 +223,7 @@ +@@ -223,7 +223,7 @@ PyObject *PyIMAPISession::CompareEntryIDs(PyObject *self, PyObject *args) IMAPISession *_swig_self; PyObject *obE1, *obE2; if ((_swig_self=GetI(self))==NULL) return NULL; -- if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", -+ if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", +- if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", ++ if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", &obE1, // @pyparm string|entryId||The first entry ID to be compared &obE2, // @pyparm string|entryId||The second entry ID to be compared &flags)) // @pyparm int|flags|0|Reserved - must be zero. -@@ -263,10 +263,10 @@ +@@ -263,10 +263,10 @@ PyObject *PyIMAPISession::GetLastError(PyObject *self, PyObject *args) IMAPISession *_swig_self; if ((_swig_self=GetI(self))==NULL) return NULL; - + - if(!PyArg_ParseTuple(args,"l|l:GetLastError", + if(!PyArg_ParseTuple(args,"l|l:GetLastError", &hr, // @pyparm int|hr||Contains the error code generated in the previous method call. &flags)) // @pyparm int|flags||Indicates for format for the output. - return NULL; + return NULL; - + Py_BEGIN_ALLOW_THREADS hRes = _swig_self->GetLastError(hr, flags, &me); -diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMsgStore.i pywin32-b306/com/win32comext/mapi/src/PyIMsgStore.i ---- pywin32-b306-orig/com/win32comext/mapi/src/PyIMsgStore.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/mapi/src/PyIMsgStore.i 2023-04-07 09:08:57.171587200 +0800 -@@ -33,14 +33,14 @@ +diff --git a/com/win32comext/mapi/src/PyIMsgStore.i b/com/win32comext/mapi/src/PyIMsgStore.i +index 64fe62c..394faf8 100644 +--- a/com/win32comext/mapi/src/PyIMsgStore.i ++++ b/com/win32comext/mapi/src/PyIMsgStore.i +@@ -33,14 +33,14 @@ PyIMsgStore::~PyIMsgStore() // @pyswig |OpenEntry|Opens a folder or message and returns an interface object for further access. - PyObject *PyIMsgStore::OpenEntry(PyObject *self, PyObject *args) + PyObject *PyIMsgStore::OpenEntry(PyObject *self, PyObject *args) { - HRESULT _result; - char * entryString; @@ -813,18 +858,18 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMsgStore.i pywin32-b306/ ULONG resType; PyObject *obEntry; -@@ -49,8 +49,8 @@ +@@ -49,8 +49,8 @@ PyObject *PyIMsgStore::OpenEntry(PyObject *self, PyObject *args) // @pyparm string|entryId||The entryID of the object // @pyparm |iid||The IID of the object to return, or None for the default IID // @pyparm int|flags||Bitmask of flags that controls how the object is opened. -- if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) +- if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) - return NULL; -+ if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) ++ if(!PyArg_ParseTuple(args,"OOl:OpenEntry",&obEntry, &objIID,&flags)) + return NULL; if (obEntry==Py_None) { entryString = NULL; entryStrLen = 0; -@@ -69,12 +69,12 @@ +@@ -69,12 +69,12 @@ PyObject *PyIMsgStore::OpenEntry(PyObject *self, PyObject *args) return NULL; } Py_BEGIN_ALLOW_THREADS @@ -842,29 +887,29 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMsgStore.i pywin32-b306/ } %} -@@ -144,7 +144,7 @@ +@@ -170,7 +170,7 @@ PyObject *PyIMsgStore::CompareEntryIDs(PyObject *self, PyObject *args) IMsgStore *_swig_self; PyObject *obE1, *obE2; if ((_swig_self=GetI(self))==NULL) return NULL; -- if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", -+ if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", +- if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", ++ if(!PyArg_ParseTuple(args,"OO|i:CompareEntryIDs", &obE1, // @pyparm string|entryId||The first entry ID to be compared &obE2, // @pyparm string|entryId||The second entry ID to be compared &flags)) // @pyparm int|flags|0|Reserved - must be zero. -@@ -182,10 +182,10 @@ +@@ -208,10 +208,10 @@ PyObject *PyIMsgStore::GetLastError(PyObject *self, PyObject *args) IMsgStore *_swig_self; if ((_swig_self=GetI(self))==NULL) return NULL; - + - if(!PyArg_ParseTuple(args,"l|l:GetLastError", + if(!PyArg_ParseTuple(args,"l|l:GetLastError", &hr, // @pyparm int|hr||Contains the error code generated in the previous method call. &flags)) // @pyparm int|flags||Indicates for format for the output. - return NULL; + return NULL; - + Py_BEGIN_ALLOW_THREADS hRes = _swig_self->GetLastError(hr, flags, &me); -@@ -255,11 +255,11 @@ +@@ -281,11 +281,11 @@ PyObject *PyIMsgStore::Advise(PyObject *self, PyObject *args) IMsgStore *_swig_self; if ((_swig_self=GetI(self))==NULL) return NULL; @@ -878,9 +923,10 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/PyIMsgStore.i pywin32-b306/ if (obEntryId == Py_None) { eid = NULL; -diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win32comext/mapi/src/mapi.i ---- pywin32-b306-orig/com/win32comext/mapi/src/mapi.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/mapi/src/mapi.i 2023-04-07 09:21:45.436662600 +0800 +diff --git a/com/win32comext/mapi/src/mapi.i b/com/win32comext/mapi/src/mapi.i +index b661334..6602767 100644 +--- a/com/win32comext/mapi/src/mapi.i ++++ b/com/win32comext/mapi/src/mapi.i @@ -25,6 +25,10 @@ %include "mapilib.i" @@ -892,7 +938,7 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win #include "mapiaux.h" #include "PythonCOMServer.h" -@@ -621,9 +625,9 @@ +@@ -631,9 +635,9 @@ PyObject *PyMAPILogonEx(PyObject *self, PyObject *args) return NULL; if (!PyWinObject_AsMAPIStr(obProfileName, &lpszProfileName, ulFlags & MAPI_UNICODE, FALSE)) @@ -901,23 +947,21 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win if (!PyWinObject_AsMAPIStr(obPassword, &lpszPassword, ulFlags & MAPI_UNICODE, TRUE)) - goto done; + PyWinObject_FreeMAPIStr(lpszPassword, ulFlags & MAPI_UNICODE); - + Py_BEGIN_ALLOW_THREADS hRes = ::MAPILogonEx(ulUIParam, lpszProfileName, lpszPassword, ulFlags, &lpSession); -@@ -633,11 +637,7 @@ - result = OleSetOleError(hRes); +@@ -644,10 +648,6 @@ PyObject *PyMAPILogonEx(PyObject *self, PyObject *args) else MAKE_OUTPUT_INTERFACE(&lpSession, result, IID_IMAPISession); -- + -done: - PyWinObject_FreeMAPIStr(lpszProfileName, ulFlags & MAPI_UNICODE); - PyWinObject_FreeMAPIStr(lpszPassword, ulFlags & MAPI_UNICODE); -- -+ +- return result; } %} -@@ -779,7 +779,7 @@ +@@ -789,7 +789,7 @@ PyObject *PyOpenIMsgSession(PyObject *self, PyObject *args) PY_INTERFACE_POSTCALL; if (FAILED(hr)) return OleSetOleError(hr); @@ -926,7 +970,7 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win } %} // @pyswig |CloseIMsgSession| -@@ -787,7 +787,7 @@ +@@ -797,7 +797,7 @@ PyObject *PyOpenIMsgSession(PyObject *self, PyObject *args) %{ PyObject *PyCloseIMsgSession(PyObject *self, PyObject *args) { @@ -935,7 +979,7 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win if (!PyArg_ParseTuple(args, "l:CloseIMsgSession", &session)) return NULL; PY_INTERFACE_PRECALL; -@@ -811,7 +811,7 @@ +@@ -821,7 +821,7 @@ PyObject *PyOpenIMsgOnIStg(PyObject *self, PyObject *args) long flags = 0; HRESULT hr = E_FAIL; PyObject *rc = NULL; @@ -944,7 +988,30 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win if (!PyArg_ParseTuple(args, "lOO|Oll:OpenIMsgOnIStg", &lSession, // @pyparm object|session|| -@@ -935,7 +935,7 @@ +@@ -841,7 +841,7 @@ PyObject *PyOpenIMsgOnIStg(PyObject *self, PyObject *args) + IMessage *pRet = NULL; + + if (!PyCom_InterfaceFromPyObject(obStorage, IID_IStorage, (void **)&pStorage, FALSE)) +- goto done; ++ if (pStorage) pStorage->Release(); + + { + PY_INTERFACE_PRECALL; +@@ -859,12 +859,9 @@ PyObject *PyOpenIMsgOnIStg(PyObject *self, PyObject *args) + } + if (FAILED(hr)) { + OleSetOleError(hr); +- goto done; ++ if (pSupport) pSupport->Release(); + } + rc = PyCom_PyObjectFromIUnknown(pRet, IID_IMessage, /*BOOL bAddRef =*/ FALSE); +-done: +- if (pSupport) pSupport->Release(); +- if (pStorage) pStorage->Release(); + return rc; + } + %} +@@ -945,7 +942,7 @@ void decodertfhtml(char *buf,unsigned int *len) else if (strncmp(c,"\\pntext",7)==0) {c+=7; while (c|OpenStreamOnFileW|Allocates and initializes an OLE IStream object to access the contents of a file. %native(OpenStreamOnFileW) PyOpenStreamOnFileW; %{ -@@ -1113,6 +1110,7 @@ +@@ -1123,6 +1117,7 @@ PyObject *PyOpenStreamOnFileW(PyObject *self, PyObject *args) return PyCom_PyObjectFromIUnknown(pStream, IID_IStream, FALSE); } %} @@ -993,16 +1060,16 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win // @pyswig item|HrGetOneProp|Retrieves the value of a single property from an IMAPIProp object. %native(HrGetOneProp) PyHrGetOneProp; -@@ -1132,7 +1130,7 @@ +@@ -1142,7 +1137,7 @@ PyObject *PyHrGetOneProp(PyObject *self, PyObject *args) return NULL; - + if (!PyCom_InterfaceFromPyObject(obProp, IID_IMAPIProp, (void **)&pProp, FALSE)) - goto done; + if (pProp) pProp->Release(); { PY_INTERFACE_PRECALL; -@@ -1142,10 +1140,10 @@ +@@ -1152,10 +1147,10 @@ PyObject *PyHrGetOneProp(PyObject *self, PyObject *args) if (FAILED(hRes)) { OleSetOleError(hRes); @@ -1012,10 +1079,10 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win if ((ret = PyMAPIObject_FromSPropValue(pPV)) == NULL) - goto done; + MAPIFreeBuffer(pPV); - + // PyMAPIObject_FromSPropValue does not raise an exception for types // it cannot handle so that GetProps doesn't blow up. Since we are processing -@@ -1154,15 +1152,12 @@ +@@ -1164,14 +1159,11 @@ PyObject *PyHrGetOneProp(PyObject *self, PyObject *args) PyLong_AsUnsignedLong(PyTuple_GET_ITEM(ret, 0)) != PT_NULL) { char buf[128]; @@ -1028,12 +1095,10 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win -done: - if (pProp) pProp->Release(); - MAPIFreeBuffer(pPV); -- -+ + return ret; } - %} -@@ -1175,6 +1170,7 @@ +@@ -1185,6 +1177,7 @@ PyObject *PyHrSetOneProp(PyObject *self, PyObject *args) HRESULT hRes; PyObject *obProp; PyObject *obPropValue; @@ -1041,9 +1106,9 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win IMAPIProp *pProp = NULL; PyObject *ret = NULL; SPropValue *pPV = NULL; -@@ -1185,14 +1181,14 @@ +@@ -1195,14 +1188,14 @@ PyObject *PyHrSetOneProp(PyObject *self, PyObject *args) return NULL; - + if (!PyCom_InterfaceFromPyObject(obProp, IID_IMAPIProp, (void **)&pProp, FALSE)) - goto done; + if (pProp) pProp->Release(); @@ -1059,7 +1124,7 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win { PY_INTERFACE_PRECALL; -@@ -1202,13 +1198,10 @@ +@@ -1212,13 +1205,10 @@ PyObject *PyHrSetOneProp(PyObject *self, PyObject *args) if (FAILED(hRes)) { OleSetOleError(hRes); @@ -1071,12 +1136,13 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapi.i pywin32-b306/com/win -done: - if (pProp) pProp->Release(); - MAPIFreeBuffer(pPV); - + return ret; } -diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapilib.i pywin32-b306/com/win32comext/mapi/src/mapilib.i ---- pywin32-b306-orig/com/win32comext/mapi/src/mapilib.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/mapi/src/mapilib.i 2023-04-07 09:00:42.796145000 +0800 +diff --git a/com/win32comext/mapi/src/mapilib.i b/com/win32comext/mapi/src/mapilib.i +index 266efb6..15ae650 100644 +--- a/com/win32comext/mapi/src/mapilib.i ++++ b/com/win32comext/mapi/src/mapilib.i @@ -1,12 +1,35 @@ /* MAPI Support */ @@ -1114,43 +1180,3 @@ diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapilib.i pywin32-b306/com/ // A MAPIUID is close enough to an IID for now! %typemap(python,in) MAPIUID *INPUT(MAPIUID temp) { -diff -urN pywin32-b306-orig/com/win32comext/mapi/src/mapiutil.cpp pywin32-b306/com/win32comext/mapi/src/mapiutil.cpp ---- pywin32-b306-orig/com/win32comext/mapi/src/mapiutil.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/mapi/src/mapiutil.cpp 2023-04-07 09:00:42.805152700 +0800 -@@ -1,5 +1,5 @@ - // General utilities and conversion routines for MAPI support. --#include "pywintypes.h" -+#include "PyWinTypes.h" - #include "PythonCOM.h" - #include "PyMAPIUtil.h" - // @doc -@@ -350,7 +350,7 @@ - - default: { - char buf[128]; -- sprintf(buf, "Unsupported MAPI property type 0x%X", PROP_TYPE(pv->ulPropTag)); -+ sprintf(buf, "Unsupported MAPI property type 0x%luX", PROP_TYPE(pv->ulPropTag)); - PyErr_SetString(PyExc_TypeError, buf); - ok = FALSE; - } -@@ -511,7 +511,7 @@ - break; - - default: -- printf("File %s: Unsupported MAPI property type 0x%X", __FILE__, PROP_TYPE(pv->ulPropTag)); -+ printf("File %s: Unsupported MAPI property type 0x%luX", __FILE__, PROP_TYPE(pv->ulPropTag)); - /* Dont set exception, as this prevents otherwise valid props from - being returned - */ -diff -urN pywin32-b306-orig/com/win32comext/taskscheduler/src/PyIScheduledWorkItem.cpp pywin32-b306/com/win32comext/taskscheduler/src/PyIScheduledWorkItem.cpp ---- pywin32-b306-orig/com/win32comext/taskscheduler/src/PyIScheduledWorkItem.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/com/win32comext/taskscheduler/src/PyIScheduledWorkItem.cpp 2023-04-07 09:15:42.099591800 +0800 -@@ -488,7 +488,7 @@ - else - // Task Scheduler won't take an empty string for data anymore ?????? - if (data_len == 0) -- workitem_data = NULL; -+ workitem_data = NULL; - } - - HRESULT hr; diff --git a/mingw-w64-python-pywin32/003-win32-extensions-fix.patch b/mingw-w64-python-pywin32/003-win32-extensions-fix.patch index ff11aa51bda8e..4bd8b8ee611d5 100644 --- a/mingw-w64-python-pywin32/003-win32-extensions-fix.patch +++ b/mingw-w64-python-pywin32/003-win32-extensions-fix.patch @@ -1,7 +1,21 @@ -diff -urN pywin32-b306-orig/win32/src/PerfMon/PyPerfMon.cpp pywin32-b306/win32/src/PerfMon/PyPerfMon.cpp ---- pywin32-b306-orig/win32/src/PerfMon/PyPerfMon.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/PerfMon/PyPerfMon.cpp 2023-04-07 09:30:09.612441600 +0800 -@@ -13,7 +13,7 @@ +diff --git a/win32/src/PerfMon/PerfCounterDefn.cpp b/win32/src/PerfMon/PerfCounterDefn.cpp +index 9e3e17b..77516ec 100644 +--- a/win32/src/PerfMon/PerfCounterDefn.cpp ++++ b/win32/src/PerfMon/PerfCounterDefn.cpp +@@ -81,7 +81,7 @@ PyObject *PyPERF_COUNTER_DEFINITION::Get(PyObject *self, PyObject *args) + PyPERF_COUNTER_DEFINITION *This = (PyPERF_COUNTER_DEFINITION *)self; + if (!PyArg_ParseTuple(args, ":Get")) + return NULL; +- if (!This->m_pCounterValue == NULL) { ++ if (This->m_pCounterValue != NULL) { + PyErr_SetString(PyExc_ValueError, "The counter does not exist in a counter block"); + return NULL; + } +diff --git a/win32/src/PerfMon/PyPerfMon.cpp b/win32/src/PerfMon/PyPerfMon.cpp +index fc4decf..e4e2995 100644 +--- a/win32/src/PerfMon/PyPerfMon.cpp ++++ b/win32/src/PerfMon/PyPerfMon.cpp +@@ -13,7 +13,7 @@ generates Windows .hlp files. ******************************************************************/ #include "PyWinTypes.h" @@ -10,10 +24,11 @@ diff -urN pywin32-b306-orig/win32/src/PerfMon/PyPerfMon.cpp pywin32-b306/win32/s #include "tchar.h" extern PyObject *PerfmonMethod_NewPERF_COUNTER_DEFINITION(PyObject *self, PyObject *args); -diff -urN pywin32-b306-orig/win32/src/PerfMon/PyPerfMonControl.h pywin32-b306/win32/src/PerfMon/PyPerfMonControl.h ---- pywin32-b306-orig/win32/src/PerfMon/PyPerfMonControl.h 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/PerfMon/PyPerfMonControl.h 2023-04-07 09:30:09.624439400 +0800 -@@ -18,6 +18,6 @@ +diff --git a/win32/src/PerfMon/PyPerfMonControl.h b/win32/src/PerfMon/PyPerfMonControl.h +index 8a45068..6ac2f15 100644 +--- a/win32/src/PerfMon/PyPerfMonControl.h ++++ b/win32/src/PerfMon/PyPerfMonControl.h +@@ -18,6 +18,6 @@ struct MappingManagerControlData { DWORD ControlSize; // Size of this structure. DWORD TotalSize; // Total Size allocated in the mapped file. SupplierStatus supplierStatus; @@ -22,32 +37,32 @@ diff -urN pywin32-b306-orig/win32/src/PerfMon/PyPerfMonControl.h pywin32-b306/wi + WCHAR ServiceName[MMCD_SERVICE_SIZE+1]; // The name of the service or application. + WCHAR EventSourceName[MMCD_EVENTSOURCE_SIZE+1]; // Source Name that appears in Event Log for errors. }; -diff -urN pywin32-b306-orig/win32/src/PerfMon/PyPerfMsgs.mc pywin32-b306/win32/src/PerfMon/PyPerfMsgs.mc ---- pywin32-b306-orig/win32/src/PerfMon/PyPerfMsgs.mc 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/PerfMon/PyPerfMsgs.mc 2023-04-07 09:30:09.634400100 +0800 -@@ -86,3 +86,4 @@ +diff --git a/win32/src/PerfMon/PyPerfMsgs.mc b/win32/src/PerfMon/PyPerfMsgs.mc +index b50f764..965b5f1 100644 +--- a/win32/src/PerfMon/PyPerfMsgs.mc ++++ b/win32/src/PerfMon/PyPerfMsgs.mc +@@ -86,3 +86,4 @@ The collection DLL and application have mismatched structure sizes. The version . ;// ;#endif // _PYPERFMSG_H_ + -diff -urN pywin32-b306-orig/win32/src/PyHANDLE.cpp pywin32-b306/win32/src/PyHANDLE.cpp ---- pywin32-b306-orig/win32/src/PyHANDLE.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/PyHANDLE.cpp 2023-04-07 09:30:30.398988500 +0800 -@@ -129,7 +129,11 @@ +diff --git a/win32/src/PyHANDLE.cpp b/win32/src/PyHANDLE.cpp +index c1baf75..999fab9 100644 +--- a/win32/src/PyHANDLE.cpp ++++ b/win32/src/PyHANDLE.cpp +@@ -129,7 +129,7 @@ static PyNumberMethods PyHANDLE_NumberMethods = { PyHANDLE::binaryFailureFunc, /* nb_xor */ PyHANDLE::binaryFailureFunc, /* nb_or */ - PyHANDLE::intFunc, /* nb_int */ -+#if (PY_VERSION_HEX < 0x03000000) - PyHANDLE::longFunc, /* nb_long */ -+#else -+ 0, -+#endif - PyHANDLE::unaryFailureFunc, /* nb_float */ - // These removed in 3.0 + PyHANDLE::intFunc, /* nb_int */ +- PyHANDLE::longFunc, /* nb_long */ ++ 0, /* nb_long */ + PyHANDLE::unaryFailureFunc, /* nb_float */ + // These removed in 3.0 }; -diff -urN pywin32-b306-orig/win32/src/PyWinTypes.h pywin32-b306/win32/src/PyWinTypes.h ---- pywin32-b306-orig/win32/src/PyWinTypes.h 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/PyWinTypes.h 2023-04-07 09:30:41.318120800 +0800 +diff --git a/win32/src/PyWinTypes.h b/win32/src/PyWinTypes.h +index 620aada..310ed05 100644 +--- a/win32/src/PyWinTypes.h ++++ b/win32/src/PyWinTypes.h @@ -18,6 +18,18 @@ #include "structmember.h" #include "windows.h" @@ -67,42 +82,43 @@ diff -urN pywin32-b306-orig/win32/src/PyWinTypes.h pywin32-b306/win32/src/PyWinT // Helpers for our modules. // Some macros to help the pywin32 modules co-exist in py2x and py3k. // Creates and initializes local variables called 'module' and 'dict'. -diff -urN pywin32-b306-orig/win32/src/PyWinTypesmodule.cpp pywin32-b306/win32/src/PyWinTypesmodule.cpp ---- pywin32-b306-orig/win32/src/PyWinTypesmodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/PyWinTypesmodule.cpp 2023-04-07 09:30:41.350131400 +0800 -@@ -1087,11 +1087,17 @@ +diff --git a/win32/src/PyWinTypesmodule.cpp b/win32/src/PyWinTypesmodule.cpp +index 1564f84..25068f6 100644 +--- a/win32/src/PyWinTypesmodule.cpp ++++ b/win32/src/PyWinTypesmodule.cpp +@@ -1062,11 +1062,17 @@ extern "C" __declspec(dllexport) BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwR } // Function to format a python traceback into a character string. +#ifdef _MSC_VER - #define GPEM_ERROR(what) \ - { \ + #define GPEM_ERROR(what) \ + { \ errorMsg = L""; \ -- goto done; \ +- goto done; \ } +#else -+#define GPEM_ERROR(what) \ -+ { \ -+ errorMsg = L""; \ ++#define GPEM_ERROR(what) \ ++ { \ ++ errorMsg = L""; \ + } +#endif PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_value, PyObject *exc_tb) { WCHAR *result = NULL; -@@ -1110,22 +1116,27 @@ +@@ -1085,22 +1091,27 @@ PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_va if (modStringIO == NULL) - GPEM_ERROR("cant import cStringIO"); + GPEM_ERROR("can't import cStringIO"); + Py_XDECREF(modStringIO); modTB = PyImport_ImportModule("traceback"); if (modTB == NULL) - GPEM_ERROR("cant import traceback"); + GPEM_ERROR("can't import traceback"); + Py_XDECREF(modTB); /* Construct a cStringIO object */ obFuncStringIO = PyObject_GetAttrString(modStringIO, "StringIO"); if (obFuncStringIO == NULL) - GPEM_ERROR("cant find cStringIO.StringIO"); + GPEM_ERROR("can't find cStringIO.StringIO"); + Py_XDECREF(obFuncStringIO); obStringIO = PyObject_CallObject(obFuncStringIO, NULL); if (obStringIO == NULL) @@ -112,20 +128,20 @@ diff -urN pywin32-b306-orig/win32/src/PyWinTypesmodule.cpp pywin32-b306/win32/sr /* Get the traceback.print_exception function, and call it. */ obFuncTB = PyObject_GetAttrString(modTB, "print_exception"); if (obFuncTB == NULL) - GPEM_ERROR("cant find traceback.print_exception"); + GPEM_ERROR("can't find traceback.print_exception"); + Py_XDECREF(obFuncTB); // Py3k has added an undocumented 'chain' argument which defaults to True // and causes all kinds of exceptions while trying to print a traceback! // This *could* be useful thought if we can tame it - later! -@@ -1140,6 +1151,7 @@ - ); +@@ -1112,6 +1123,7 @@ PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_va + obStringIO, chain); if (argsTB == NULL) - GPEM_ERROR("cant make print_exception arguments"); + GPEM_ERROR("can't make print_exception arguments"); + Py_XDECREF(argsTB); obResult = PyObject_CallObject(obFuncTB, argsTB); if (obResult == NULL) { -@@ -1150,32 +1162,27 @@ +@@ -1122,32 +1134,27 @@ PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_va // PyUnicodeObject *uo=(PyUnicodeObject *)v; // DebugBreak(); GPEM_ERROR("traceback.print_exception() failed"); @@ -135,7 +151,7 @@ diff -urN pywin32-b306-orig/win32/src/PyWinTypesmodule.cpp pywin32-b306/win32/sr Py_DECREF(obFuncStringIO); obFuncStringIO = PyObject_GetAttrString(obStringIO, "getvalue"); if (obFuncStringIO == NULL) - GPEM_ERROR("cant find getvalue function"); + GPEM_ERROR("can't find getvalue function"); + Py_XDECREF(obFuncStringIO); Py_DECREF(obResult); obResult = PyObject_CallObject(obFuncStringIO, NULL); @@ -163,10 +179,11 @@ diff -urN pywin32-b306-orig/win32/src/PyWinTypesmodule.cpp pywin32-b306/win32/sr - Py_XDECREF(obResult); return result; } -diff -urN pywin32-b306-orig/win32/src/PythonService.cpp pywin32-b306/win32/src/PythonService.cpp ---- pywin32-b306-orig/win32/src/PythonService.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/PythonService.cpp 2023-04-07 09:30:41.385168300 +0800 -@@ -1302,7 +1302,7 @@ +diff --git a/win32/src/PythonService.cpp b/win32/src/PythonService.cpp +index 181c97b..3bc1ece 100644 +--- a/win32/src/PythonService.cpp ++++ b/win32/src/PythonService.cpp +@@ -1298,7 +1298,7 @@ static void ReportAPIError(DWORD msgCode, DWORD errCode /*= 0*/) TCHAR cvtBuf[20]; wsprintf(cvtBuf, L"%d", errCode); @@ -175,10 +192,11 @@ diff -urN pywin32-b306-orig/win32/src/PythonService.cpp pywin32-b306/win32/src/P ReportError(msgCode, (LPCTSTR *)lpszStrings); } -diff -urN pywin32-b306-orig/win32/src/PythonServiceMessages.mc pywin32-b306/win32/src/PythonServiceMessages.mc ---- pywin32-b306-orig/win32/src/PythonServiceMessages.mc 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/PythonServiceMessages.mc 2023-04-07 09:30:41.428148900 +0800 -@@ -137,7 +137,7 @@ +diff --git a/win32/src/PythonServiceMessages.mc b/win32/src/PythonServiceMessages.mc +index 40d9c0f..8ecce64 100644 +--- a/win32/src/PythonServiceMessages.mc ++++ b/win32/src/PythonServiceMessages.mc +@@ -137,7 +137,7 @@ MessageId=0x7 Severity=Error SymbolicName=E_UNUSED2 Language=English @@ -187,18 +205,16 @@ diff -urN pywin32-b306-orig/win32/src/PythonServiceMessages.mc pywin32-b306/win3 . MessageId=0x8 -diff -urN pywin32-b306-orig/win32/src/_winxptheme.i pywin32-b306/win32/src/_winxptheme.i ---- pywin32-b306-orig/win32/src/_winxptheme.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/_winxptheme.i 2023-04-07 09:30:41.443119100 +0800 -@@ -15,12 +15,14 @@ +diff --git a/win32/src/_winxptheme.i b/win32/src/_winxptheme.i +index 3ef07bb..9f2b9b2 100644 +--- a/win32/src/_winxptheme.i ++++ b/win32/src/_winxptheme.i +@@ -15,10 +15,11 @@ %include "pywintypes.i" %{ -+#undef _WIN32_IE - #define _WIN32_IE 0x0501 // to enable balloon notifications in Shell_NotifyIcon +#undef _WIN32_WINNT #define _WIN32_WINNT 0x0501 - //#define ISOLATION_AWARE_ENABLED 1 #undef PyHANDLE -#include "pywinobjects.h" @@ -206,7 +222,7 @@ diff -urN pywin32-b306-orig/win32/src/_winxptheme.i pywin32-b306/win32/src/_winx #include "windows.h" #include "Uxtheme.h" #include "commctrl.h" -@@ -93,6 +95,8 @@ +@@ -91,6 +92,8 @@ typedef float HDC; return NULL; } @@ -215,10 +231,11 @@ diff -urN pywin32-b306-orig/win32/src/_winxptheme.i pywin32-b306/win32/src/_winx %typemap(python,ignore) RECT *OUTPUT(RECT temp) { $target = &temp; -diff -urN pywin32-b306-orig/win32/src/mmapfilemodule.cpp pywin32-b306/win32/src/mmapfilemodule.cpp ---- pywin32-b306-orig/win32/src/mmapfilemodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/mmapfilemodule.cpp 2023-04-07 09:30:41.474125500 +0800 -@@ -71,7 +71,7 @@ +diff --git a/win32/src/mmapfilemodule.cpp b/win32/src/mmapfilemodule.cpp +index 44b1eda..1f7834d 100644 +--- a/win32/src/mmapfilemodule.cpp ++++ b/win32/src/mmapfilemodule.cpp +@@ -71,7 +71,7 @@ static PyObject *mmapfile_read_byte_method(mmapfile_object *self, PyObject *args { char *where = (self->data + self->pos); CHECK_VALID; @@ -227,10 +244,11 @@ diff -urN pywin32-b306-orig/win32/src/mmapfilemodule.cpp pywin32-b306/win32/src/ PyObject *ret = PyBytes_FromStringAndSize(where, 1); if (ret) self->pos += 1; -diff -urN pywin32-b306-orig/win32/src/odbc.cpp pywin32-b306/win32/src/odbc.cpp ---- pywin32-b306-orig/win32/src/odbc.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/odbc.cpp 2023-04-07 09:30:41.500137000 +0800 -@@ -93,8 +93,8 @@ +diff --git a/win32/src/odbc.cpp b/win32/src/odbc.cpp +index 6190ce5..2e7523b 100644 +--- a/win32/src/odbc.cpp ++++ b/win32/src/odbc.cpp +@@ -93,8 +93,8 @@ typedef struct { static cursorObject *cursor(PyObject *o) { return (cursorObject *)o; } static void cursorDealloc(PyObject *self); @@ -241,7 +259,7 @@ diff -urN pywin32-b306-orig/win32/src/odbc.cpp pywin32-b306/win32/src/odbc.cpp static PyTypeObject Cursor_Type = { PYWIN_OBJECT_HEAD "odbccur", /*tp_name */ -@@ -137,8 +137,8 @@ +@@ -137,8 +137,8 @@ static PyTypeObject Cursor_Type = { }; static void connectionDealloc(PyObject *self); @@ -252,7 +270,7 @@ diff -urN pywin32-b306-orig/win32/src/odbc.cpp pywin32-b306/win32/src/odbc.cpp static PyTypeObject Connection_Type = { PYWIN_OBJECT_HEAD "odbcconn", /*tp_name */ sizeof(connectionObject), /*tp_basicsize */ -@@ -379,7 +379,7 @@ +@@ -379,7 +379,7 @@ static PyObject *odbcClose(PyObject *self, PyObject *args) } /* @object connection|An object representing an ODBC connection */ @@ -261,7 +279,7 @@ diff -urN pywin32-b306-orig/win32/src/odbc.cpp pywin32-b306/win32/src/odbc.cpp {"setautocommit", odbcSetAutoCommit, 1}, /* @pymeth setautocommit|Sets the autocommit mode. */ {"commit", odbcCommit, 1}, /* @pymeth commit|Commits a transaction. */ {"rollback", odbcRollback, 1}, /* @pymeth rollback|Rollsback a transaction. */ -@@ -387,7 +387,7 @@ +@@ -387,7 +387,7 @@ static struct PyMethodDef connectionMethods[] = { {"close", odbcClose, 1}, /* @pymeth close|Closes the connection. */ {0, 0}}; @@ -270,7 +288,16 @@ diff -urN pywin32-b306-orig/win32/src/odbc.cpp pywin32-b306/win32/src/odbc.cpp {NULL}}; static void connectionDealloc(PyObject *self) -@@ -1418,7 +1418,7 @@ +@@ -856,7 +856,7 @@ static int rewriteQuery(TCHAR *out, const TCHAR *in) + parseContext ctx; + + initParseContext(&ctx, in); +- while (*out++ = doParse(&ctx)); ++ while (*out++ == doParse(&ctx)); + return ctx.parmCount; + } + +@@ -1420,7 +1420,7 @@ static PyObject *odbcCurSetOutputSize(PyObject *self, PyObject *args) } /* @object cursor|An object representing an ODBC cursor. */ @@ -279,7 +306,7 @@ diff -urN pywin32-b306-orig/win32/src/odbc.cpp pywin32-b306/win32/src/odbc.cpp {"close", odbcCurClose, 1}, /* @pymeth close|Closes the cursor */ {"execute", odbcCurExec, 1}, /* @pymeth execute|Execute some SQL */ {"fetchone", odbcCurFetchOne, 1}, /* @pymeth fetchone|Fetch one row of data */ -@@ -1428,7 +1428,7 @@ +@@ -1430,7 +1430,7 @@ static PyMethodDef cursorMethods[] = { {"setoutputsize", odbcCurSetOutputSize, 1}, /* @pymeth setoutputsize| */ {0, 0}}; @@ -288,7 +315,7 @@ diff -urN pywin32-b306-orig/win32/src/odbc.cpp pywin32-b306/win32/src/odbc.cpp {"error", T_OBJECT, offsetof(cursorObject, cursorError), READONLY}, {NULL}}; -@@ -1448,13 +1448,25 @@ +@@ -1450,13 +1450,25 @@ static void parseInfo(connectionObject *conn, const TCHAR *c) if (!firstEqualsSign || (firstSlash && firstSlash < firstEqualsSign)) { _tcsncpy(buf, c, sizeof(buf) / sizeof(TCHAR)); @@ -314,22 +341,24 @@ diff -urN pywin32-b306-orig/win32/src/odbc.cpp pywin32-b306/win32/src/odbc.cpp if (p) { _tcsncpy(pwd, p, sizeof(pwd) / sizeof(TCHAR)); } -diff -urN pywin32-b306-orig/win32/src/timermodule.cpp pywin32-b306/win32/src/timermodule.cpp ---- pywin32-b306-orig/win32/src/timermodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/timermodule.cpp 2023-04-07 09:30:41.513120500 +0800 +diff --git a/win32/src/timermodule.cpp b/win32/src/timermodule.cpp +index f06e8a4..b2ec845 100644 +--- a/win32/src/timermodule.cpp ++++ b/win32/src/timermodule.cpp @@ -8,7 +8,7 @@ // @doc - Contains autoduck comments for documentation -#include "pywintypes.h" +#include "PyWinTypes.h" - //#include "abstract.h" + // #include "abstract.h" static PyObject *timer_id_callback_map = NULL; -diff -urN pywin32-b306-orig/win32/src/win32apimodule.cpp pywin32-b306/win32/src/win32apimodule.cpp ---- pywin32-b306-orig/win32/src/win32apimodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32apimodule.cpp 2023-04-07 09:30:41.555130500 +0800 -@@ -528,7 +528,7 @@ +diff --git a/win32/src/win32apimodule.cpp b/win32/src/win32apimodule.cpp +index 026816e..3072b6e 100644 +--- a/win32/src/win32apimodule.cpp ++++ b/win32/src/win32apimodule.cpp +@@ -528,7 +528,7 @@ static PyObject *PyFindExecutable(PyObject *self, PyObject *args) if (rc == (HINSTANCE)31) PyErr_SetString(PyWinExc_ApiError, "FindExecutable: There is no association for the file"); else @@ -338,7 +367,7 @@ diff -urN pywin32-b306-orig/win32/src/win32apimodule.cpp pywin32-b306/win32/src/ } else ret = Py_BuildValue("(NN)", PyWinLong_FromHANDLE(rc), PyWinObject_FromTCHAR(res)); } -@@ -1173,7 +1173,7 @@ +@@ -1173,7 +1173,7 @@ static PyObject *PyLoadCursor(PyObject *self, PyObject *args) if (!PyWinObject_AsResourceId(obid, &id)) return NULL; // @pyseeapi LoadCursor @@ -347,7 +376,7 @@ diff -urN pywin32-b306-orig/win32/src/win32apimodule.cpp pywin32-b306/win32/src/ PyW32_END_ALLOW_THREADS PyWinObject_FreeResourceId(id); if (ret == NULL) ReturnAPIError("LoadCursor"); -@@ -1780,7 +1780,7 @@ +@@ -1787,7 +1787,7 @@ static PyObject *PyGetProcAddress(PyObject *self, PyObject *args) if (proc == NULL) return ReturnAPIError("GetProcAddress"); // @pyseeapi GetProcAddress @@ -356,7 +385,7 @@ diff -urN pywin32-b306-orig/win32/src/win32apimodule.cpp pywin32-b306/win32/src/ } // @pymethod |win32api|GetDllDirectory|Returns the DLL search path -@@ -4298,7 +4298,7 @@ +@@ -4298,7 +4298,7 @@ static PyObject *PyShellExecute(PyObject *self, PyObject *args) PyW32_BEGIN_ALLOW_THREADS HINSTANCE rc = ::ShellExecute(hwnd, op, file, params, dir, show); PyW32_END_ALLOW_THREADS // @pyseeapi ShellExecute @@ -365,7 +394,7 @@ diff -urN pywin32-b306-orig/win32/src/win32apimodule.cpp pywin32-b306/win32/src/ else ret = PyWinLong_FromVoidPtr(rc); } PyWinObject_FreeTCHAR(op); -@@ -5277,8 +5277,8 @@ +@@ -5277,8 +5277,8 @@ static PyObject *PyApply(PyObject *self, PyObject *args) } PyThreadState *stateSave = PyThreadState_Swap(NULL); PyThreadState_Swap(stateSave); @@ -376,9 +405,10 @@ diff -urN pywin32-b306-orig/win32/src/win32apimodule.cpp pywin32-b306/win32/src/ { // Do my best to restore the thread state to a sane spot. PyThreadState *stateCur = PyThreadState_Swap(NULL); -diff -urN pywin32-b306-orig/win32/src/win32clipboardmodule.cpp pywin32-b306/win32/src/win32clipboardmodule.cpp ---- pywin32-b306-orig/win32/src/win32clipboardmodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32clipboardmodule.cpp 2023-04-07 09:30:41.580132800 +0800 +diff --git a/win32/src/win32clipboardmodule.cpp b/win32/src/win32clipboardmodule.cpp +index 9ffe4b0..c89bef6 100644 +--- a/win32/src/win32clipboardmodule.cpp ++++ b/win32/src/win32clipboardmodule.cpp @@ -15,7 +15,7 @@ #define PY_SSIZE_T_CLEAN // this should be Py_ssize_t clean! @@ -388,7 +418,7 @@ diff -urN pywin32-b306-orig/win32/src/win32clipboardmodule.cpp pywin32-b306/win3 #define CHECK_NO_ARGS2(args, fnName) \ do { \ -@@ -1098,12 +1098,11 @@ +@@ -1107,12 +1107,11 @@ static struct PyMethodDef clipboard_functions[] = { {NULL, NULL}}; #define ADD_CONSTANT(tok) \ @@ -402,34 +432,58 @@ diff -urN pywin32-b306-orig/win32/src/win32clipboardmodule.cpp pywin32-b306/win3 ADD_CONSTANT(CF_TEXT); ADD_CONSTANT(CF_BITMAP); ADD_CONSTANT(CF_METAFILEPICT); -diff -urN pywin32-b306-orig/win32/src/win32consolemodule.cpp pywin32-b306/win32/src/win32consolemodule.cpp ---- pywin32-b306-orig/win32/src/win32consolemodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32consolemodule.cpp 2023-04-07 09:30:41.611133800 +0800 +diff --git a/win32/src/win32consolemodule.cpp b/win32/src/win32consolemodule.cpp +index daae981..df0ba07 100644 +--- a/win32/src/win32consolemodule.cpp ++++ b/win32/src/win32consolemodule.cpp @@ -1,4 +1,5 @@ // @doc +#undef _WIN32_WINNT #define _WIN32_WINNT 0x501 #include "PyWinTypes.h" #include "PyWinObjects.h" -diff -urN pywin32-b306-orig/win32/src/win32credmodule.cpp pywin32-b306/win32/src/win32credmodule.cpp ---- pywin32-b306-orig/win32/src/win32credmodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32credmodule.cpp 2023-04-07 09:30:41.635134700 +0800 +diff --git a/win32/src/win32credmodule.cpp b/win32/src/win32credmodule.cpp +index 2825c22..084b85d 100644 +--- a/win32/src/win32credmodule.cpp ++++ b/win32/src/win32credmodule.cpp @@ -1,4 +1,5 @@ // @doc +#undef _WIN32_WINNT #define _WIN32_WINNT 0x501 // Credentials functions only available on WinXP #include "PyWinTypes.h" #include "PyWinObjects.h" -diff -urN pywin32-b306-orig/win32/src/win32crypt/win32cryptmodule.cpp pywin32-b306/win32/src/win32crypt/win32cryptmodule.cpp ---- pywin32-b306-orig/win32/src/win32crypt/win32cryptmodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32crypt/win32cryptmodule.cpp 2023-04-07 09:30:41.663164200 +0800 +@@ -1175,8 +1176,10 @@ PYWIN_MODULE_INIT_FUNC(win32cred) + PyModule_AddIntConstant(module, "CRED_TYPE_DOMAIN_PASSWORD", CRED_TYPE_DOMAIN_PASSWORD); + PyModule_AddIntConstant(module, "CRED_TYPE_DOMAIN_CERTIFICATE", CRED_TYPE_DOMAIN_CERTIFICATE); + PyModule_AddIntConstant(module, "CRED_TYPE_DOMAIN_VISIBLE_PASSWORD", CRED_TYPE_DOMAIN_VISIBLE_PASSWORD); ++#ifdef _MSC_VER + PyModule_AddIntConstant(module, "CRED_TYPE_GENERIC_CERTIFICATE", CRED_TYPE_GENERIC_CERTIFICATE); + PyModule_AddIntConstant(module, "CRED_TYPE_DOMAIN_EXTENDED", CRED_TYPE_DOMAIN_EXTENDED); ++#endif + PyModule_AddIntConstant(module, "CRED_TYPE_MAXIMUM", CRED_TYPE_MAXIMUM); + PyModule_AddIntConstant(module, "CRED_TYPE_MAXIMUM_EX", CRED_TYPE_MAXIMUM + 1000); + // credential flags +@@ -1238,7 +1241,9 @@ PYWIN_MODULE_INIT_FUNC(win32cred) + PyModule_AddIntConstant(module, "CREDUI_MAX_USERNAME_LENGTH", CREDUI_MAX_USERNAME_LENGTH); + PyModule_AddIntConstant(module, "CREDUI_MAX_PASSWORD_LENGTH", CREDUI_MAX_PASSWORD_LENGTH); + ++#ifdef _MSC_VER + PyModule_AddIntConstant(module, "CRED_ENUMERATE_ALL_CREDENTIALS", CRED_ENUMERATE_ALL_CREDENTIALS); ++#endif + + PYWIN_MODULE_INIT_RETURN_SUCCESS; + } +diff --git a/win32/src/win32crypt/win32cryptmodule.cpp b/win32/src/win32crypt/win32cryptmodule.cpp +index 3f801fc..2a1c637 100644 +--- a/win32/src/win32crypt/win32cryptmodule.cpp ++++ b/win32/src/win32crypt/win32cryptmodule.cpp @@ -1,4 +1,5 @@ // @doc +#undef _WIN32_WINNT #define _WIN32_WINNT 0x502 #include "win32crypt.h" -@@ -584,6 +585,7 @@ +@@ -583,6 +584,7 @@ static PyObject *PyCertOpenStore(PyObject *self, PyObject *args, PyObject *kwarg pvPara = (void *)&cssrp; } else { @@ -437,7 +491,7 @@ diff -urN pywin32-b306-orig/win32/src/win32crypt/win32cryptmodule.cpp pywin32-b3 switch ((ULONG_PTR)StoreProvider) { case CERT_STORE_PROV_PHYSICAL: case CERT_STORE_PROV_FILENAME: -@@ -625,6 +627,41 @@ +@@ -624,6 +626,41 @@ static PyObject *PyCertOpenStore(PyObject *self, PyObject *args, PyObject *kwarg return NULL; } } @@ -479,10 +533,11 @@ diff -urN pywin32-b306-orig/win32/src/win32crypt/win32cryptmodule.cpp pywin32-b3 } Py_BEGIN_ALLOW_THREADS hcertstore = CertOpenStore(StoreProvider, dwEncodingType, hcryptprov, dwFlags, pvPara); -diff -urN pywin32-b306-orig/win32/src/win32dynamicdialog.cpp pywin32-b306/win32/src/win32dynamicdialog.cpp ---- pywin32-b306-orig/win32/src/win32dynamicdialog.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32dynamicdialog.cpp 2023-04-07 09:30:41.692131000 +0800 -@@ -31,7 +31,7 @@ +diff --git a/win32/src/win32dynamicdialog.cpp b/win32/src/win32dynamicdialog.cpp +index bef6473..9e159a3 100644 +--- a/win32/src/win32dynamicdialog.cpp ++++ b/win32/src/win32dynamicdialog.cpp +@@ -31,14 +31,14 @@ #ifdef WIN32GUI // being compiled from WIN32GUI #define PYW_EXPORT @@ -491,10 +546,8 @@ diff -urN pywin32-b306-orig/win32/src/win32dynamicdialog.cpp pywin32-b306/win32/ #undef PyHANDLE #include #include "commctrl.h" -@@ -40,8 +40,8 @@ - #ifdef MS_WINCE - #include "winbase.h" - #endif + #include "windowsx.h" // For edit control hacks. + -#include "pywintypes.h" -#include "pywinobjects.h" +#include "PyWinTypes.h" @@ -502,7 +555,7 @@ diff -urN pywin32-b306-orig/win32/src/win32dynamicdialog.cpp pywin32-b306/win32/ #include "tchar.h" #define BASED_CODE -@@ -54,7 +54,7 @@ +@@ -51,7 +51,7 @@ #endif #include "win32dynamicdialog.h" @@ -511,7 +564,7 @@ diff -urN pywin32-b306-orig/win32/src/win32dynamicdialog.cpp pywin32-b306/win32/ { size_t offset = ((ULONG_PTR)*ptr) & 0x03; if (offset > 0) { -@@ -214,7 +214,7 @@ +@@ -211,7 +211,7 @@ void CPythonDialogTemplate::Set(DLGTEMPLATE *tmpl) HGLOBAL CPythonDialogTemplate::ClaimTemplate() { @@ -520,16 +573,16 @@ diff -urN pywin32-b306-orig/win32/src/win32dynamicdialog.cpp pywin32-b306/win32/ m_h = NULL; m_alloc = 0; m_len = 0; -@@ -600,7 +600,7 @@ +@@ -597,7 +597,7 @@ static BOOL ParseDlgItemList(CPythonDialogTemplate *dlg, PyObject *tmpl) goto cleanup; if (IS_INTRESOURCE(wclass)) - ret = dlg->Add((WORD)wclass, &tpl, caption); + ret = dlg->Add((DWORD_PTR)wclass, &tpl, caption); else - ret = dlg->Add(wclass, &tpl, caption, pybuf.len(), (BYTE*)pybuf.ptr()); + ret = dlg->Add(wclass, &tpl, caption, pybuf.len(), (BYTE *)pybuf.ptr()); -@@ -631,7 +631,7 @@ +@@ -628,7 +628,7 @@ PYW_EXPORT HGLOBAL MakeResourceFromDlgList(PyObject *tmpl) if (dlg == NULL) return NULL; @@ -538,9 +591,10 @@ diff -urN pywin32-b306-orig/win32/src/win32dynamicdialog.cpp pywin32-b306/win32/ if (!ParseDlgItemList(dlg, PyTuple_GET_ITEM(obdlg, i))) { delete dlg; Py_DECREF(obdlg); -diff -urN pywin32-b306-orig/win32/src/win32event.i pywin32-b306/win32/src/win32event.i ---- pywin32-b306-orig/win32/src/win32event.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32event.i 2023-04-07 09:30:41.712132700 +0800 +diff --git a/win32/src/win32event.i b/win32/src/win32event.i +index 2ed1fab..992b1b6 100644 +--- a/win32/src/win32event.i ++++ b/win32/src/win32event.i @@ -18,6 +18,7 @@ // only seem able to make this work with an incorrect level of @@ -549,26 +603,36 @@ diff -urN pywin32-b306-orig/win32/src/win32event.i pywin32-b306/win32/src/win32e %typemap(python,in) PTIMERAPCROUTINE *(PTIMERAPCROUTINE temp) { if ($source != Py_None) { PyErr_SetString(PyExc_TypeError, "This param must be None"); -@@ -95,7 +96,6 @@ +@@ -84,14 +85,13 @@ + + #define EVENT_ALL_ACCESS EVENT_ALL_ACCESS // Specifies all possible access flags for the event object. + +-#define EVENT_MODIFY_STATE EVENT_MODIFY_STATE // Enables use of the event handle in the SetEvent and ResetEvent�functions to modify the event�s state. ++#define EVENT_MODIFY_STATE EVENT_MODIFY_STATE // Enables use of the event handle in the SetEvent and ResetEvent functions to modify the event's state. + +-#define SYNCHRONIZE SYNCHRONIZE // Windows NT only:�Enables use of the event handle in any of the wait functions�to wait for the event�s state to be signaled. ++#define SYNCHRONIZE SYNCHRONIZE // Windows NT only: Enables use of the event handle in any of the wait functions to wait for the event's state to be signaled. + + // @pyswig |CancelWaitableTimer|Cancels a waiting timer. BOOLAPI CancelWaitableTimer(PyHANDLE handle); - #endif -#end // @pyswig |CreateEvent|Creates a waitable event // @rdesc The result is a handle to the created object -@@ -399,7 +399,7 @@ +@@ -384,7 +384,7 @@ static PyObject *MyWaitForMultipleObjectsEx( + DWORD dwMilliseconds, // @pyparm int|milliseconds||time-out interval in milliseconds BOOL bAlertable // @pyparm bool|bAlertable||alertable wait flag. ); - #endif -%typedef DWORD DWORD_WAITAPI +%typedef DWORD DWORD_WAITAPI; %typemap(python,except) DWORD_WAITAPI { Py_BEGIN_ALLOW_THREADS $function -diff -urN pywin32-b306-orig/win32/src/win32evtlog.i pywin32-b306/win32/src/win32evtlog.i ---- pywin32-b306-orig/win32/src/win32evtlog.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32evtlog.i 2023-04-07 09:30:41.753152600 +0800 +diff --git a/win32/src/win32evtlog.i b/win32/src/win32evtlog.i +index 111b0a3..dd865f2 100644 +--- a/win32/src/win32evtlog.i ++++ b/win32/src/win32evtlog.i @@ -4,9 +4,18 @@ // The Evt* functions are only available on Vista and later. Attempting to call // them on XP will result in the process exiting, rather than a python exception. @@ -588,10 +652,11 @@ diff -urN pywin32-b306-orig/win32/src/win32evtlog.i pywin32-b306/win32/src/win32 %{ #include -diff -urN pywin32-b306-orig/win32/src/win32file.i pywin32-b306/win32/src/win32file.i ---- pywin32-b306-orig/win32/src/win32file.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32file.i 2023-04-07 09:30:41.783139900 +0800 -@@ -48,7 +48,7 @@ +diff --git a/win32/src/win32file.i b/win32/src/win32file.i +index 5b1b010..4f05d0b 100644 +--- a/win32/src/win32file.i ++++ b/win32/src/win32file.i +@@ -47,7 +47,7 @@ #include "winsock2.h" #include "mswsock.h" @@ -600,7 +665,7 @@ diff -urN pywin32-b306-orig/win32/src/win32file.i pywin32-b306/win32/src/win32fi #include "winbase.h" #include "assert.h" #include -@@ -73,6 +73,9 @@ +@@ -71,6 +71,9 @@ %include "typemaps.i" %include "pywin32.i" @@ -610,7 +675,7 @@ diff -urN pywin32-b306-orig/win32/src/win32file.i pywin32-b306/win32/src/win32fi %{ #include "datetime.h" // python's datetime header. -@@ -723,8 +726,8 @@ +@@ -697,8 +700,8 @@ static PyObject *PySetFileTime (PyObject *self, PyObject *args, PyObject *kwargs &obHandle, &obCreationTime, &obLastAccessTime, &obLastWriteTime, &UTCTimes)) return NULL; @@ -621,7 +686,7 @@ diff -urN pywin32-b306-orig/win32/src/win32file.i pywin32-b306/win32/src/win32fi if (obCreationTime != Py_None){ if (!PyWinObject_AsFILETIME(obCreationTime, &FileTime)) return NULL; -@@ -5356,7 +5359,7 @@ +@@ -5297,7 +5300,7 @@ static PyObject *py_GetFullPathName(PyObject *self, PyObject *args, PyObject *kw PyErr_Clear(); char *cpathin; @@ -630,59 +695,59 @@ diff -urN pywin32-b306-orig/win32/src/win32file.i pywin32-b306/win32/src/win32fi if (htrans) CHECK_PFN(GetFullPathNameTransactedA); char *cpathret=NULL, *cfilepart, *cpathsave=NULL; -diff -urN pywin32-b306-orig/win32/src/win32file_comm.cpp pywin32-b306/win32/src/win32file_comm.cpp ---- pywin32-b306-orig/win32/src/win32file_comm.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32file_comm.cpp 2023-04-07 09:30:41.989293800 +0800 -@@ -163,7 +163,7 @@ - PyDCB::~PyDCB(void) {} - - #define GET_BITFIELD_ENTRY(bitfield_name) \ -- else if (strcmp(name, #bitfield_name) == 0) { return PyLong_FromLong(pydcb->m_DCB.##bitfield_name); } -+ else if (strcmp(name, #bitfield_name) == 0) { return PyLong_FromLong(pydcb->m_DCB.bitfield_name); } +diff --git a/win32/src/win32file_comm.cpp b/win32/src/win32file_comm.cpp +index bcd2d36..cb2eda0 100644 +--- a/win32/src/win32file_comm.cpp ++++ b/win32/src/win32file_comm.cpp +@@ -165,7 +165,7 @@ PyDCB::~PyDCB(void) {} + #define GET_BITFIELD_ENTRY(bitfield_name) \ + else if (strcmp(name, #bitfield_name) == 0) \ + { \ +- return PyLong_FromLong(pydcb->m_DCB.##bitfield_name); \ ++ return PyLong_FromLong(pydcb->m_DCB.bitfield_name); \ + } PyObject *PyDCB::getattro(PyObject *self, PyObject *obname) - { -@@ -194,11 +194,11 @@ - #define SET_BITFIELD_ENTRY(bitfield_name) \ - else if (strcmp(name, #bitfield_name) == 0) \ - { \ -- if (!PyLong_Check(v)) { \ -+ if (!PyLong_Check(v)) { \ +@@ -201,7 +201,7 @@ PyObject *PyDCB::getattro(PyObject *self, PyObject *obname) PyErr_Format(PyExc_TypeError, szNeedIntAttr, #bitfield_name); \ return -1; \ } \ -- pydcb->m_DCB.##bitfield_name = PyLong_AsLong(v); \ +- pydcb->m_DCB.##bitfield_name = PyLong_AsLong(v); \ + pydcb->m_DCB.bitfield_name = PyLong_AsLong(v); \ return 0; \ } -@@ -362,7 +362,7 @@ - - #undef GET_BITFIELD_ENTRY - #define GET_BITFIELD_ENTRY(bitfield_name) \ -- else if (strcmp(name, #bitfield_name) == 0) { return PyLong_FromLong(pyCOMSTAT->m_COMSTAT.##bitfield_name); } -+ else if (strcmp(name, #bitfield_name) == 0) { return PyLong_FromLong(pyCOMSTAT->m_COMSTAT.bitfield_name); } +@@ -367,7 +367,7 @@ PyCOMSTAT::~PyCOMSTAT(void) {} + #define GET_BITFIELD_ENTRY(bitfield_name) \ + else if (strcmp(name, #bitfield_name) == 0) \ + { \ +- return PyLong_FromLong(pyCOMSTAT->m_COMSTAT.##bitfield_name); \ ++ return PyLong_FromLong(pyCOMSTAT->m_COMSTAT.bitfield_name); \ + } PyObject *PyCOMSTAT::getattro(PyObject *self, PyObject *obname) - { -@@ -387,11 +387,11 @@ - #define SET_BITFIELD_ENTRY(bitfield_name) \ - else if (strcmp(name, #bitfield_name) == 0) \ - { \ -- if (!PyLong_Check(v)) { \ -+ if (!PyLong_Check(v)) { \ +@@ -397,7 +397,7 @@ PyObject *PyCOMSTAT::getattro(PyObject *self, PyObject *obname) PyErr_Format(PyExc_TypeError, szNeedIntAttr, #bitfield_name); \ return -1; \ } \ -- pyCOMSTAT->m_COMSTAT.##bitfield_name = PyLong_AsLong(v); \ +- pyCOMSTAT->m_COMSTAT.##bitfield_name = PyLong_AsLong(v); \ + pyCOMSTAT->m_COMSTAT.bitfield_name = PyLong_AsLong(v); \ return 0; \ } -diff -urN pywin32-b306-orig/win32/src/win32gui.i pywin32-b306/win32/src/win32gui.i ---- pywin32-b306-orig/win32/src/win32gui.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32gui.i 2023-04-07 09:30:42.189189600 +0800 -@@ -23,9 +23,20 @@ +diff --git a/win32/src/win32gui.i b/win32/src/win32gui.i +index 518e84c..ecc30ef 100644 +--- a/win32/src/win32gui.i ++++ b/win32/src/win32gui.i +@@ -4,15 +4,28 @@ + %module win32gui // A module which provides an interface to the native win32 GUI API. + + %{ ++#ifndef _WIN32_WINNT + #define _WIN32_WINNT 0x0501 ++#endif + + %} %include "typemaps.i" %include "pywintypes.i" @@ -704,7 +769,7 @@ diff -urN pywin32-b306-orig/win32/src/win32gui.i pywin32-b306/win32/src/win32gui #include "winuser.h" #include "commctrl.h" #include "windowsx.h" // For edit control hacks. -@@ -367,14 +378,14 @@ +@@ -336,14 +349,14 @@ typedef float HDC, HCURSOR, HINSTANCE, HMENU, HICON, HGDIOBJ, HIMAGELIST, HACCEL } %apply COLORREF {long}; @@ -721,7 +786,7 @@ diff -urN pywin32-b306-orig/win32/src/win32gui.i pywin32-b306/win32/src/win32gui %typemap(python,in) NULL_ONLY { if ($source != Py_None) { -@@ -1750,9 +1761,9 @@ +@@ -1711,9 +1724,9 @@ static PyObject *PyGetBufferAddressAndLen(PyObject *self, PyObject *args) %native (PyGetBufferAddressAndLen) PyGetBufferAddressAndLen; @@ -734,7 +799,7 @@ diff -urN pywin32-b306-orig/win32/src/win32gui.i pywin32-b306/win32/src/win32gui %typemap(python,arginit) STRING_OR_ATOM_CW, RESOURCE_ID, RESOURCE_ID_NULLOK{ $target=NULL; -@@ -1816,12 +1827,12 @@ +@@ -1776,12 +1789,12 @@ PyObject *PyFlashWindowEx(PyObject *self, PyObject *args) return NULL; // not on NT HMODULE hmod = GetModuleHandle(_T("user32")); @@ -753,7 +818,7 @@ diff -urN pywin32-b306-orig/win32/src/win32gui.i pywin32-b306/win32/src/win32gui Py_BEGIN_ALLOW_THREADS rc = (*pfnFW)(&f); Py_END_ALLOW_THREADS -@@ -7676,13 +7687,13 @@ +@@ -7521,13 +7534,13 @@ PyObject *PyRegisterDeviceNotification(PyObject *self, PyObject *args) "structure says it has %d bytes, but %d was provided", (int)struct_bytes, (int)pybuf.len()); // @pyseeapi RegisterDeviceNotification @@ -771,10 +836,11 @@ diff -urN pywin32-b306-orig/win32/src/win32gui.i pywin32-b306/win32/src/win32gui } %} %native(RegisterDeviceNotification) PyRegisterDeviceNotification; -diff -urN pywin32-b306-orig/win32/src/win32helpmodule.cpp pywin32-b306/win32/src/win32helpmodule.cpp ---- pywin32-b306-orig/win32/src/win32helpmodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32helpmodule.cpp 2023-04-07 09:30:42.251187600 +0800 -@@ -2546,13 +2546,11 @@ +diff --git a/win32/src/win32helpmodule.cpp b/win32/src/win32helpmodule.cpp +index 9bf9bf7..ee48fdd 100644 +--- a/win32/src/win32helpmodule.cpp ++++ b/win32/src/win32helpmodule.cpp +@@ -2544,13 +2544,11 @@ data tuple items must be integers"); // Module constants: #define ADD_CONSTANT(tok) \ @@ -789,7 +855,7 @@ diff -urN pywin32-b306-orig/win32/src/win32helpmodule.cpp pywin32-b306/win32/src #ifdef _DEBUG int debug = 1; #else -@@ -3093,7 +3091,7 @@ +@@ -3091,7 +3089,7 @@ int AddConstants(PyObject *module) // @const win32help|HH_GPROPID_CONTENT_LANGUAGE|long: LandId for desired // content. @@ -798,9 +864,10 @@ diff -urN pywin32-b306-orig/win32/src/win32helpmodule.cpp pywin32-b306/win32/src } /* List of functions exported by this module */ -diff -urN pywin32-b306-orig/win32/src/win32inet_winhttp.cpp pywin32-b306/win32/src/win32inet_winhttp.cpp ---- pywin32-b306-orig/win32/src/win32inet_winhttp.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32inet_winhttp.cpp 2023-04-07 09:30:42.277191800 +0800 +diff --git a/win32/src/win32inet_winhttp.cpp b/win32/src/win32inet_winhttp.cpp +index a3292da..2c7b0ea 100644 +--- a/win32/src/win32inet_winhttp.cpp ++++ b/win32/src/win32inet_winhttp.cpp @@ -6,8 +6,8 @@ // The intent is to only wrap stuff which isn't otherwise doable from // Python, such as the proxy stuff. @@ -812,10 +879,11 @@ diff -urN pywin32-b306-orig/win32/src/win32inet_winhttp.cpp pywin32-b306/win32/s #include "winhttp.h" // @doc -diff -urN pywin32-b306-orig/win32/src/win32lzmodule.cpp pywin32-b306/win32/src/win32lzmodule.cpp ---- pywin32-b306-orig/win32/src/win32lzmodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32lzmodule.cpp 2023-04-07 09:30:42.289189100 +0800 -@@ -11,7 +11,7 @@ +diff --git a/win32/src/win32lzmodule.cpp b/win32/src/win32lzmodule.cpp +index 651bdcf..9ac5406 100644 +--- a/win32/src/win32lzmodule.cpp ++++ b/win32/src/win32lzmodule.cpp +@@ -11,7 +11,7 @@ generates Windows .hlp files. ******************************************************************/ @@ -824,10 +892,11 @@ diff -urN pywin32-b306-orig/win32/src/win32lzmodule.cpp pywin32-b306/win32/src/w #include "lzexpand.h" static PyObject *obHandleMap = NULL; -diff -urN pywin32-b306-orig/win32/src/win32net/win32netmisc.cpp pywin32-b306/win32/src/win32net/win32netmisc.cpp ---- pywin32-b306-orig/win32/src/win32net/win32netmisc.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32net/win32netmisc.cpp 2023-04-07 09:30:42.316178600 +0800 -@@ -1418,7 +1418,8 @@ +diff --git a/win32/src/win32net/win32netmisc.cpp b/win32/src/win32net/win32netmisc.cpp +index 025665e..7277690 100644 +--- a/win32/src/win32net/win32netmisc.cpp ++++ b/win32/src/win32net/win32netmisc.cpp +@@ -1355,7 +1355,8 @@ PyObject *PyNetServerComputerNameDel(PyObject *self, PyObject *args) #if WINVER >= 0x0500 @@ -837,7 +906,7 @@ diff -urN pywin32-b306-orig/win32/src/win32net/win32netmisc.cpp pywin32-b306/win // @pymethod |win32net|NetValidateName|Checks that domain/machine/workgroup name is valid for given context // @rdesc Returns none if valid, exception if not // @comm If Account and Password aren't passed, current logon credentials are used -@@ -1461,8 +1462,10 @@ +@@ -1398,8 +1399,10 @@ PyObject *PyNetValidateName(PyObject *self, PyObject *args) return ret; } @@ -850,10 +919,11 @@ diff -urN pywin32-b306-orig/win32/src/win32net/win32netmisc.cpp pywin32-b306/win static void PyObject_CleanupAUTH_INPUT(NET_VALIDATE_AUTHENTICATION_INPUT_ARG *p) { -diff -urN pywin32-b306-orig/win32/src/win32pdhmodule.cpp pywin32-b306/win32/src/win32pdhmodule.cpp ---- pywin32-b306-orig/win32/src/win32pdhmodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32pdhmodule.cpp 2023-04-07 09:30:42.335187600 +0800 -@@ -1004,7 +1004,7 @@ +diff --git a/win32/src/win32pdhmodule.cpp b/win32/src/win32pdhmodule.cpp +index 8d3c7d7..1b08a04 100644 +--- a/win32/src/win32pdhmodule.cpp ++++ b/win32/src/win32pdhmodule.cpp +@@ -1002,7 +1002,7 @@ PDH_STATUS __stdcall PyCounterPathCallback(DWORD_PTR dwArg) { \ if (i < seqLen) { \ PyObject *subItem = PyTuple_GET_ITEM(flags_tuple, i); \ @@ -862,10 +932,11 @@ diff -urN pywin32-b306-orig/win32/src/win32pdhmodule.cpp pywin32-b306/win32/src/ } \ } -diff -urN pywin32-b306-orig/win32/src/win32process.i pywin32-b306/win32/src/win32process.i ---- pywin32-b306-orig/win32/src/win32process.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32process.i 2023-04-07 09:30:42.392190300 +0800 -@@ -1630,6 +1630,7 @@ +diff --git a/win32/src/win32process.i b/win32/src/win32process.i +index 331ed0f..6689827 100644 +--- a/win32/src/win32process.i ++++ b/win32/src/win32process.i +@@ -1598,6 +1598,7 @@ PyObject *PyIsWow64Process(PyObject *self, PyObject *args) $target = PyWinLong_FromVoidPtr($source); } @@ -873,10 +944,11 @@ diff -urN pywin32-b306-orig/win32/src/win32process.i pywin32-b306/win32/src/win3 // @pyswig long|VirtualAllocEx| LONG_VOIDPTR VirtualAllocEx( -diff -urN pywin32-b306-orig/win32/src/win32rasmodule.cpp pywin32-b306/win32/src/win32rasmodule.cpp ---- pywin32-b306-orig/win32/src/win32rasmodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32rasmodule.cpp 2023-04-07 09:30:42.424182900 +0800 -@@ -15,7 +15,7 @@ +diff --git a/win32/src/win32rasmodule.cpp b/win32/src/win32rasmodule.cpp +index 3ed8c33..9aeac86 100644 +--- a/win32/src/win32rasmodule.cpp ++++ b/win32/src/win32rasmodule.cpp +@@ -15,7 +15,7 @@ generates Windows .hlp files. #define WINVER 0x500 #endif @@ -885,7 +957,7 @@ diff -urN pywin32-b306-orig/win32/src/win32rasmodule.cpp pywin32-b306/win32/src/ #include "ras.h" #include "raserror.h" -@@ -549,7 +549,7 @@ +@@ -549,7 +549,7 @@ static PyObject *PyRasDial(PyObject *self, PyObject *args) pNotification = NULL; } else if (PyCallable_Check(obCallback)) { @@ -894,7 +966,7 @@ diff -urN pywin32-b306-orig/win32/src/win32rasmodule.cpp pywin32-b306/win32/src/ notType = 1; } else if (PyLong_Check(obCallback)) { -@@ -787,15 +787,15 @@ +@@ -782,15 +782,15 @@ static PyObject *PyRasGetEntryDialParams(PyObject *self, PyObject *args) // @pymethod string|win32ras|GetErrorString|Returns an error string for a RAS error code. static PyObject *PyRasGetErrorString(PyObject *self, PyObject *args) { @@ -913,7 +985,7 @@ diff -urN pywin32-b306-orig/win32/src/win32rasmodule.cpp pywin32-b306/win32/src/ return ReturnRasError("RasGetErrorString"); return PyWinObject_FromTCHAR(buf); } -@@ -803,14 +803,14 @@ +@@ -798,14 +798,14 @@ static PyObject *PyRasGetErrorString(PyObject *self, PyObject *args) // @pymethod |win32ras|HangUp|Terminates a remote access session. static PyObject *PyRasHangUp(PyObject *self, PyObject *args) { @@ -930,7 +1002,7 @@ diff -urN pywin32-b306-orig/win32/src/win32rasmodule.cpp pywin32-b306/win32/src/ return ReturnRasError("RasHangup"); Py_INCREF(Py_None); return Py_None; -@@ -823,7 +823,7 @@ +@@ -818,7 +818,7 @@ static PyObject *PyRasIsHandleValid(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "O&:IsHandleValid", PyWinObject_AsHANDLE, &hras)) // @pyparm int|hras||The handle to the RAS connection being checked. return NULL; @@ -939,7 +1011,7 @@ diff -urN pywin32-b306-orig/win32/src/win32rasmodule.cpp pywin32-b306/win32/src/ return PyBool_FromLong(bRet); } -@@ -929,7 +929,7 @@ +@@ -924,7 +924,7 @@ static struct PyMethodDef win32ras_functions[] = { {NULL, NULL}}; #define ADD_CONSTANT(tok) \ @@ -948,7 +1020,7 @@ diff -urN pywin32-b306-orig/win32/src/win32rasmodule.cpp pywin32-b306/win32/src/ return rc #define ADD_ENUM(parta, partb) \ if (rc = PyModule_AddIntConstant(module, #parta "_" #partb, parta::partb)) \ -@@ -940,7 +940,6 @@ +@@ -935,7 +935,6 @@ static struct PyMethodDef win32ras_functions[] = { static int AddConstants(PyObject *module) { @@ -956,9 +1028,10 @@ diff -urN pywin32-b306-orig/win32/src/win32rasmodule.cpp pywin32-b306/win32/src/ ADD_CONSTANT(RASCS_OpenPort); // @const win32ras|RASCS_OpenPort|Constant for RAS state. ADD_CONSTANT(RASCS_PortOpened); // @const win32ras|RASCS_PortOpened|Constant for RAS state. ADD_CONSTANT(RASCS_ConnectDevice); // @const win32ras|RASCS_ConnectDevice|Constant for RAS state. -diff -urN pywin32-b306-orig/win32/src/win32security.i pywin32-b306/win32/src/win32security.i ---- pywin32-b306-orig/win32/src/win32security.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32security.i 2023-04-07 09:30:42.457185700 +0800 +diff --git a/win32/src/win32security.i b/win32/src/win32security.i +index c614d30..c0de13a 100644 +--- a/win32/src/win32security.i ++++ b/win32/src/win32security.i @@ -5,6 +5,7 @@ %module win32security // An interface to the win32 security API's @@ -967,7 +1040,7 @@ diff -urN pywin32-b306-orig/win32/src/win32security.i pywin32-b306/win32/src/win #define _WIN32_WINNT 0x0600 // Vista! %} -@@ -76,7 +77,7 @@ +@@ -76,7 +77,7 @@ static IsTokenRestrictedfunc pfnIsTokenRestricted = NULL; typedef PSecurityFunctionTableW (SEC_ENTRY *InitSecurityInterfacefunc)(void); static InitSecurityInterfacefunc pfnInitSecurityInterface=NULL; @@ -976,7 +1049,7 @@ diff -urN pywin32-b306-orig/win32/src/win32security.i pywin32-b306/win32/src/win typedef BOOL (WINAPI *TranslateNamefunc)(LPCTSTR, EXTENDED_NAME_FORMAT, EXTENDED_NAME_FORMAT, LPTSTR, PULONG); static TranslateNamefunc pfnTranslateName=NULL; -@@ -89,20 +90,20 @@ +@@ -89,20 +90,20 @@ static LogonUserExExfunc pfnLogonUserExEx = NULL; // function pointers used in win32security_sspi.cpp and win32security_ds.cpp @@ -1011,7 +1084,7 @@ diff -urN pywin32-b306-orig/win32/src/win32security.i pywin32-b306/win32/src/win static HMODULE advapi32_dll=NULL; static HMODULE secur32_dll =NULL; -@@ -114,8 +115,8 @@ +@@ -114,8 +115,8 @@ static HMODULE netapi32_dll=NULL; HMODULE loadmodule(WCHAR *dllname) { HMODULE hmodule = GetModuleHandle(dllname); @@ -1022,7 +1095,7 @@ diff -urN pywin32-b306-orig/win32/src/win32security.i pywin32-b306/win32/src/win return hmodule; } -@@ -3337,12 +3338,14 @@ +@@ -3337,12 +3338,14 @@ static PyObject *PyCreateRestrictedToken(PyObject *self, PyObject *args, PyObjec if (PyWinObject_AsHANDLE(obExistingTokenHandle, &ExistingTokenHandle)) if (PyWinObject_AsSID_AND_ATTRIBUTESArray(obSidsToDisable, &SidsToDisable, &DisableSidCount)) if (PyWinObject_AsSID_AND_ATTRIBUTESArray(obSidsToRestrict, &SidsToRestrict, &RestrictedSidCount)) @@ -1040,9 +1113,10 @@ diff -urN pywin32-b306-orig/win32/src/win32security.i pywin32-b306/win32/src/win if (SidsToDisable!=NULL) free(SidsToDisable); if (PrivilegesToDelete!=NULL) -diff -urN pywin32-b306-orig/win32/src/win32service.i pywin32-b306/win32/src/win32service.i ---- pywin32-b306-orig/win32/src/win32service.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32service.i 2023-04-07 09:30:42.479185200 +0800 +diff --git a/win32/src/win32service.i b/win32/src/win32service.i +index 1150dff..c43ad17 100644 +--- a/win32/src/win32service.i ++++ b/win32/src/win32service.i @@ -3,9 +3,18 @@ %module win32service // An interface to the Windows NT Service API @@ -1062,18 +1136,22 @@ diff -urN pywin32-b306-orig/win32/src/win32service.i pywin32-b306/win32/src/win3 %{ #undef PyHANDLE #include "PyWinObjects.h" -diff -urN pywin32-b306-orig/win32/src/win32tsmodule.cpp pywin32-b306/win32/src/win32tsmodule.cpp ---- pywin32-b306-orig/win32/src/win32tsmodule.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32tsmodule.cpp 2023-04-07 09:30:42.494186700 +0800 -@@ -1,4 +1,5 @@ +diff --git a/win32/src/win32tsmodule.cpp b/win32/src/win32tsmodule.cpp +index c4156f9..c5f8e37 100644 +--- a/win32/src/win32tsmodule.cpp ++++ b/win32/src/win32tsmodule.cpp +@@ -1,5 +1,7 @@ // @doc -+#undef _WIN32_WINNT ++#ifndef _WIN32_WINNT #define _WIN32_WINNT 0x501 ++#endif #include "PyWinTypes.h" #include "PyWinObjects.h" -diff -urN pywin32-b306-orig/win32/src/win32wnet/PyNCB.cpp pywin32-b306/win32/src/win32wnet/PyNCB.cpp ---- pywin32-b306-orig/win32/src/win32wnet/PyNCB.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32wnet/PyNCB.cpp 2023-04-07 09:30:42.533383100 +0800 + #include "structmember.h" +diff --git a/win32/src/win32wnet/PyNCB.cpp b/win32/src/win32wnet/PyNCB.cpp +index e2290be..ee73e80 100644 +--- a/win32/src/win32wnet/PyNCB.cpp ++++ b/win32/src/win32wnet/PyNCB.cpp @@ -17,9 +17,9 @@ ******************************************************************/ // @doc @@ -1086,9 +1164,10 @@ diff -urN pywin32-b306-orig/win32/src/win32wnet/PyNCB.cpp pywin32-b306/win32/src #include "PyNCB.h" #include -diff -urN pywin32-b306-orig/win32/src/win32wnet/PyNetresource.cpp pywin32-b306/win32/src/win32wnet/PyNetresource.cpp ---- pywin32-b306-orig/win32/src/win32wnet/PyNetresource.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32wnet/PyNetresource.cpp 2023-04-07 09:30:42.547369500 +0800 +diff --git a/win32/src/win32wnet/PyNetresource.cpp b/win32/src/win32wnet/PyNetresource.cpp +index 9d928b3..8e258ae 100644 +--- a/win32/src/win32wnet/PyNetresource.cpp ++++ b/win32/src/win32wnet/PyNetresource.cpp @@ -18,7 +18,7 @@ // @doc @@ -1098,9 +1177,10 @@ diff -urN pywin32-b306-orig/win32/src/win32wnet/PyNetresource.cpp pywin32-b306/w static PyObject *NETRESOURCE_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { -diff -urN pywin32-b306-orig/win32/src/win32wnet/win32wnet.cpp pywin32-b306/win32/src/win32wnet/win32wnet.cpp ---- pywin32-b306-orig/win32/src/win32wnet/win32wnet.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/win32/src/win32wnet/win32wnet.cpp 2023-04-07 09:30:42.566367800 +0800 +diff --git a/win32/src/win32wnet/win32wnet.cpp b/win32/src/win32wnet/win32wnet.cpp +index fe5c6cc..a57ff9d 100644 +--- a/win32/src/win32wnet/win32wnet.cpp ++++ b/win32/src/win32wnet/win32wnet.cpp @@ -38,8 +38,8 @@ #include "PyWinTypes.h" diff --git a/mingw-w64-python-pywin32/004-isapi-fix.patch b/mingw-w64-python-pywin32/004-isapi-fix.patch index 3fdc4a15b5d54..45233563941e1 100644 --- a/mingw-w64-python-pywin32/004-isapi-fix.patch +++ b/mingw-w64-python-pywin32/004-isapi-fix.patch @@ -1,10 +1,11 @@ -diff -urN pywin32-b306-orig/isapi/src/PyExtensionObjects.cpp pywin32-b306/isapi/src/PyExtensionObjects.cpp ---- pywin32-b306-orig/isapi/src/PyExtensionObjects.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/isapi/src/PyExtensionObjects.cpp 2023-04-07 09:31:10.813179500 +0800 +diff --git a/isapi/src/PyExtensionObjects.cpp b/isapi/src/PyExtensionObjects.cpp +index 19208c1..3bf7223 100644 +--- a/isapi/src/PyExtensionObjects.cpp ++++ b/isapi/src/PyExtensionObjects.cpp @@ -24,8 +24,8 @@ */ - //#define PY_SSIZE_T_CLEAN // defined by isapi\src\StdAfx.h + // #define PY_SSIZE_T_CLEAN // defined by isapi\src\StdAfx.h -#include "stdafx.h" -#include "pywintypes.h" +#include "StdAfx.h" @@ -12,7 +13,7 @@ diff -urN pywin32-b306-orig/isapi/src/PyExtensionObjects.cpp pywin32-b306/isapi/ #include "Utils.h" #include "PyExtensionObjects.h" #include "PythonEng.h" -@@ -806,7 +806,7 @@ +@@ -815,7 +815,7 @@ PyObject *PyECB::IOCompletion(PyObject *self, PyObject *args) BOOL bRes; Py_BEGIN_ALLOW_THREADS bRes = @@ -21,10 +22,11 @@ diff -urN pywin32-b306-orig/isapi/src/PyExtensionObjects.cpp pywin32-b306/isapi/ Py_END_ALLOW_THREADS if (!bRes) return SetPyECBError("ServerSupportFunction(HSE_REQ_IO_COMPLETION)"); Py_RETURN_NONE; } -diff -urN pywin32-b306-orig/isapi/src/PyFilterObjects.cpp pywin32-b306/isapi/src/PyFilterObjects.cpp ---- pywin32-b306-orig/isapi/src/PyFilterObjects.cpp 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/isapi/src/PyFilterObjects.cpp 2023-04-07 09:31:10.839162200 +0800 -@@ -307,7 +307,7 @@ +diff --git a/isapi/src/PyFilterObjects.cpp b/isapi/src/PyFilterObjects.cpp +index 0239313..06fc210 100644 +--- a/isapi/src/PyFilterObjects.cpp ++++ b/isapi/src/PyFilterObjects.cpp +@@ -311,7 +311,7 @@ PyObject *PyHFC::SendResponseHeader(PyObject *self, PyObject *args) // The Java code passes "\r\n" as first DWORD, and header in second, // but docs clearly have second as unused. Either way, I can't see the // specific header! diff --git a/mingw-w64-python-pywin32/005-swig-fix.patch b/mingw-w64-python-pywin32/005-swig-fix.patch index b1a8eea790000..fce11113ef53c 100644 --- a/mingw-w64-python-pywin32/005-swig-fix.patch +++ b/mingw-w64-python-pywin32/005-swig-fix.patch @@ -1,7 +1,8 @@ -diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pythoncom.i pywin32-b306/SWIG/swig_lib/python/pythoncom.i ---- pywin32-b306-orig/SWIG/swig_lib/python/pythoncom.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/SWIG/swig_lib/python/pythoncom.i 2023-04-07 09:36:26.662919300 +0800 -@@ -8,6 +8,10 @@ +diff --git a/SWIG/swig_lib/python/pythoncom.i b/SWIG/swig_lib/python/pythoncom.i +index f37ae9f..609d227 100644 +--- a/SWIG/swig_lib/python/pythoncom.i ++++ b/SWIG/swig_lib/python/pythoncom.i +@@ -8,6 +8,10 @@ typedef long HRESULT; // This will raise COM Exception. %typedef long HRESULT_KEEP; // This will keep HRESULT, and return typedef long FLAGS; @@ -12,10 +13,11 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pythoncom.i pywin32-b306/SWIG/s %typemap(python,out) HRESULT { $target = Py_None; -diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/swig_lib/python/pywintypes.i ---- pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i 2023-03-26 07:53:26.000000000 +0800 -+++ pywin32-b306/SWIG/swig_lib/python/pywintypes.i 2023-04-07 09:36:26.714869100 +0800 -@@ -33,6 +33,8 @@ +diff --git a/SWIG/swig_lib/python/pywintypes.i b/SWIG/swig_lib/python/pywintypes.i +index 7ef58a4..cd61a0e 100644 +--- a/SWIG/swig_lib/python/pywintypes.i ++++ b/SWIG/swig_lib/python/pywintypes.i +@@ -33,6 +33,8 @@ typedef long LONG; typedef unsigned long ULONG; %apply unsigned long {ULONG}; @@ -24,7 +26,7 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %{ #define PyInt_FromLong PyLong_FromLong // py3k pain. -@@ -55,6 +57,7 @@ +@@ -55,6 +57,7 @@ typedef unsigned long ULONG; } // Override the SWIG default for this. @@ -32,7 +34,7 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %typemap(python,out) PyObject *{ if ($source==NULL) return NULL; // get out now! $target = $source; -@@ -64,7 +67,7 @@ +@@ -64,7 +67,7 @@ typedef unsigned long ULONG; // Map API functions that return BOOL to // functions that return None, but raise exceptions. // These functions must set the win32 LastError. @@ -41,7 +43,7 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %typemap(python,out) BOOLAPI { $target = Py_None; -@@ -81,7 +84,7 @@ +@@ -81,7 +84,7 @@ typedef unsigned long ULONG; } } @@ -50,7 +52,7 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %typemap(python,out) DWORDAPI { $target = Py_None; -@@ -110,11 +113,13 @@ +@@ -110,11 +113,13 @@ typedef unsigned long ULONG; } } @@ -64,7 +66,7 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %typemap(python,arginit) TCHAR *,OLECHAR *, WCHAR * { $target = NULL; -@@ -200,6 +205,7 @@ +@@ -200,6 +205,7 @@ typedef unsigned long ULONG; return NULL; } @@ -72,7 +74,7 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %typemap(python,in) OVERLAPPED * { if (!PyWinObject_AsOVERLAPPED($source, &$target, TRUE)) -@@ -254,6 +260,7 @@ +@@ -254,6 +260,7 @@ typedef unsigned long ULONG; } @@ -80,7 +82,7 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %typemap(python,in) SECURITY_ATTRIBUTES *{ if (!PyWinObject_AsSECURITY_ATTRIBUTES($source, &$target)) -@@ -408,6 +415,7 @@ +@@ -412,6 +419,7 @@ typedef float HWND; // LARGE_INTEGER support // //--------------------------------------------------------------------------- @@ -88,7 +90,7 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %typemap(python,in) LARGE_INTEGER { if (!PyWinObject_AsLARGE_INTEGER($source, &$target)) return NULL; -@@ -417,6 +425,7 @@ +@@ -421,6 +429,7 @@ typedef float HWND; if (!PyWinObject_AsLARGE_INTEGER($source, $target)) return NULL; } @@ -96,7 +98,7 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %typemap(python,in) ULARGE_INTEGER { if (!PyWinObject_AsULARGE_INTEGER($source, &$target)) return NULL; -@@ -531,6 +540,7 @@ +@@ -535,6 +544,7 @@ typedef float HWND; // TIME // //--------------------------------------------------------------------------- @@ -104,7 +106,7 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %typemap(python,in) FILETIME * { if (!PyWinObject_AsFILETIME($source, $target, FALSE)) return NULL; -@@ -569,6 +579,7 @@ +@@ -573,6 +583,7 @@ typedef float HWND; // SOCKET support. // //--------------------------------------------------------------------------- @@ -112,11 +114,10 @@ diff -urN pywin32-b306-orig/SWIG/swig_lib/python/pywintypes.i pywin32-b306/SWIG/ %typemap(python,in) SOCKET *(SOCKET sockettemp) { $target = &sockettemp; -@@ -592,6 +603,6 @@ +@@ -596,5 +607,5 @@ typedef float HWND; #endif PyWinGlobals_Ensure(); PyDict_SetItemString(d, "error", PyWinExc_ApiError); -#endif SWIG_PYTHONCOM +#endif // SWIG_PYTHONCOM %} - diff --git a/mingw-w64-python-pywin32/006-mapi-headers-fix.patch b/mingw-w64-python-pywin32/006-mapi-headers-fix.patch index e1119d175e906..12a28a38c97d5 100644 --- a/mingw-w64-python-pywin32/006-mapi-headers-fix.patch +++ b/mingw-w64-python-pywin32/006-mapi-headers-fix.patch @@ -1,18 +1,20 @@ -diff -Naur pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/EdkMdb.h pywin32-b301/com/win32comext/mapi/src/mapi_headers/EdkMdb.h ---- pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/EdkMdb.h 2021-05-30 16:31:38 +0800 -+++ pywin32-b301/com/win32comext/mapi/src/mapi_headers/EdkMdb.h 2021-10-06 03:07:19 +0800 -@@ -78,7 +78,7 @@ - #define PR_PROFILE_RECONNECT_INTERVAL PROP_TAG( PT_LONG, pidProfileMin+0x1a) // dup tag of PR_USER_NAME - #define PR_PROFILE_SERVER_VERSION PROP_TAG( PT_LONG, pidProfileMin+0x1b) +diff --git a/com/win32comext/mapi/src/mapi_headers/EdkMdb.h b/com/win32comext/mapi/src/mapi_headers/EdkMdb.h +index 6de3859..39ac0c3 100644 +--- a/com/win32comext/mapi/src/mapi_headers/EdkMdb.h ++++ b/com/win32comext/mapi/src/mapi_headers/EdkMdb.h +@@ -76,7 +76,7 @@ + #define PR_PROFILE_RECONNECT_INTERVAL PROP_TAG(PT_LONG, pidProfileMin + 0x1a) // dup tag of PR_USER_NAME + #define PR_PROFILE_SERVER_VERSION PROP_TAG(PT_LONG, pidProfileMin + 0x1b) -/* SE 233155 - MarkH: EMSABP DCR /* +/* SE 233155 - MarkH: EMSABP DCR */ /* Properties in the abp section - I got these values from AlecDun (Outlook team) */ - #define PR_PROFILE_ABP_ALLOW_RECONNECT PROP_TAG( PT_LONG, pidProfileMin+0x39) - #define PR_PROFILE_ABP_MTHREAD_TIMEOUT_SECS PROP_TAG( PT_LONG, pidProfileMin+0x3A) -diff -Naur pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MAPI.h pywin32-b301/com/win32comext/mapi/src/mapi_headers/MAPI.h ---- pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MAPI.h 2021-05-30 16:31:38 +0800 -+++ pywin32-b301/com/win32comext/mapi/src/mapi_headers/MAPI.h 2021-10-06 01:42:20 +0800 + #define PR_PROFILE_ABP_ALLOW_RECONNECT PROP_TAG(PT_LONG, pidProfileMin + 0x39) + #define PR_PROFILE_ABP_MTHREAD_TIMEOUT_SECS PROP_TAG(PT_LONG, pidProfileMin + 0x3A) +diff --git a/com/win32comext/mapi/src/mapi_headers/MAPI.h b/com/win32comext/mapi/src/mapi_headers/MAPI.h +index 038b58f..dbc0e40 100644 +--- a/com/win32comext/mapi/src/mapi_headers/MAPI.h ++++ b/com/win32comext/mapi/src/mapi_headers/MAPI.h @@ -20,6 +20,13 @@ #pragma once #endif @@ -27,34 +29,35 @@ diff -Naur pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MAPI.h pywin3 /* * Types. */ -@@ -160,7 +167,7 @@ +@@ -160,7 +167,7 @@ typedef struct /* #define MAPI_LOGON_UI 0x00000001 Display logon UI */ /* #define MAPI_NEW_SESSION 0x00000002 Don't use shared session */ -/* #define MAPI_LONG_MSGID 0x00004000 /* allow 512 char returned ID */ -+/* #define MAPI_LONG_MSGID 0x00004000 allow 512 char returned ID */ ++/* #define MAPI_LONG_MSGID 0x00004000 allow 512 char returned ID */ /* MAPIAddress() flags. */ -diff -Naur pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MAPICode.h pywin32-b301/com/win32comext/mapi/src/mapi_headers/MAPICode.h ---- pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MAPICode.h 2021-05-30 16:31:38 +0800 -+++ pywin32-b301/com/win32comext/mapi/src/mapi_headers/MAPICode.h 2021-10-06 01:41:52 +0800 +diff --git a/com/win32comext/mapi/src/mapi_headers/MAPICode.h b/com/win32comext/mapi/src/mapi_headers/MAPICode.h +index 467023a..a27609d 100644 +--- a/com/win32comext/mapi/src/mapi_headers/MAPICode.h ++++ b/com/win32comext/mapi/src/mapi_headers/MAPICode.h @@ -216,5 +216,4 @@ #endif #endif /* MAPICODE_H */ - -diff -Naur pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MAPIDefS.h pywin32-b301/com/win32comext/mapi/src/mapi_headers/MAPIDefS.h ---- pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MAPIDefS.h 2021-05-30 16:31:38 +0800 -+++ pywin32-b301/com/win32comext/mapi/src/mapi_headers/MAPIDefS.h 2021-10-06 01:42:30 +0800 -@@ -51,6 +51,13 @@ +diff --git a/com/win32comext/mapi/src/mapi_headers/MAPIDefS.h b/com/win32comext/mapi/src/mapi_headers/MAPIDefS.h +index 159935b..a44ba3c 100644 +--- a/com/win32comext/mapi/src/mapi_headers/MAPIDefS.h ++++ b/com/win32comext/mapi/src/mapi_headers/MAPIDefS.h +@@ -51,6 +51,12 @@ #include #endif +#ifndef _MSC_VER +#define __in -+#define __in_opt +#define __out +#define __deref_out_ecount_full(x) +#endif @@ -62,24 +65,36 @@ diff -Naur pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MAPIDefS.h py /* Array dimension for structures with variable-sized arrays at the end. */ #ifndef MAPI_DIM -@@ -2728,5 +2735,4 @@ +@@ -2728,5 +2734,4 @@ DECLARE_MAPI_INTERFACE_(IMAPIProviderShutdown, IUnknown) #endif #endif /* MAPIDEFS_H */ - -diff -Naur pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MAPIForm.h pywin32-b301/com/win32comext/mapi/src/mapi_headers/MAPIForm.h ---- pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MAPIForm.h 2021-05-30 16:31:38 +0800 -+++ pywin32-b301/com/win32comext/mapi/src/mapi_headers/MAPIForm.h 2021-10-06 01:42:36 +0800 -@@ -631,5 +631,4 @@ +diff --git a/com/win32comext/mapi/src/mapi_headers/MAPIForm.h b/com/win32comext/mapi/src/mapi_headers/MAPIForm.h +index cfdd84a..02b9669 100644 +--- a/com/win32comext/mapi/src/mapi_headers/MAPIForm.h ++++ b/com/win32comext/mapi/src/mapi_headers/MAPIForm.h +@@ -631,5 +631,4 @@ DECLARE_MAPI_INTERFACE_(IMAPIFormFactory, IUnknown) #endif /* MAPIFORM_H */ - -diff -Naur pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MSPST.h pywin32-b301/com/win32comext/mapi/src/mapi_headers/MSPST.h ---- pywin32-b301-orig/com/win32comext/mapi/src/mapi_headers/MSPST.h 2021-05-30 16:31:38 +0800 -+++ pywin32-b301/com/win32comext/mapi/src/mapi_headers/MSPST.h 2021-10-06 01:42:42 +0800 +diff --git a/com/win32comext/mapi/src/mapi_headers/MAPIWin.h b/com/win32comext/mapi/src/mapi_headers/MAPIWin.h +index cc9ef14..9e913e9 100644 +--- a/com/win32comext/mapi/src/mapi_headers/MAPIWin.h ++++ b/com/win32comext/mapi/src/mapi_headers/MAPIWin.h +@@ -272,5 +272,4 @@ BOOL WINAPI IsBadBoundedStringPtr(const void FAR* lpsz, UINT cchMax); + #endif + + #endif /* __MAPIWIN_H__ */ +- + +diff --git a/com/win32comext/mapi/src/mapi_headers/MSPST.h b/com/win32comext/mapi/src/mapi_headers/MSPST.h +index dae5b31..9ca667d 100644 +--- a/com/win32comext/mapi/src/mapi_headers/MSPST.h ++++ b/com/win32comext/mapi/src/mapi_headers/MSPST.h @@ -97,5 +97,4 @@ 0xd9, 0x6e, 0x00, 0x00 } diff --git a/mingw-w64-python-pywin32/PKGBUILD b/mingw-w64-python-pywin32/PKGBUILD index a46402b019ca0..77da1c5de585d 100644 --- a/mingw-w64-python-pywin32/PKGBUILD +++ b/mingw-w64-python-pywin32/PKGBUILD @@ -6,36 +6,38 @@ _realname=pywin32 pkgbase=mingw-w64-python-${_realname} pkgname=${MINGW_PACKAGE_PREFIX}-python-${_realname} -url='https://github.com/mhammond/pywin32' +pkgver=308 +pkgrel=1 pkgdesc='Python for Windows Extensions (mingw-w64)' -license=('spdx:PSF-2.0') arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') +url='https://github.com/mhammond/pywin32' +license=('spdx:PSF-2.0') msys2_references=( 'pypi: pywin32' ) -pkgver=306 -pkgrel=3 -depends=("${MINGW_PACKAGE_PREFIX}-python") -makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools" +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-python") +makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-installer" + "${MINGW_PACKAGE_PREFIX}-python-setuptools" $([[ ${MINGW_PACKAGE_PREFIX} != *-clang-* ]] || echo "binutils") "${MINGW_PACKAGE_PREFIX}-cc") -source=(https://github.com/mhammond/${_realname}/archive/b${pkgver}.zip +source=(https://github.com/mhammond/pywin32/archive/refs/tags/b${pkgver}.tar.gz 001-compile-and-setup-fixes.patch 002-com-extensions-fix.patch 003-win32-extensions-fix.patch 004-isapi-fix.patch 005-swig-fix.patch 006-mapi-headers-fix.patch) -sha256sums=('28b9186237cb097816072ffc9e55a1d7332c07aac07be18e43f7e12ef9691f0a' - '8e0de5ab4ae0ecd88c70c4bfac28d9921f13979fb687ef676bfca21b95875030' - '47e4cfa575a7988caca160beb328d76a1ae8f15cf1cdd0e472c7d2a4ba326ae8' - 'c03977d5a8bf43a06bf4390bb0bd63046361bd273ee08627f4a4bb86c2721492' - '6b7045764e92d34c292aae3ddb01be60ece593384e30126eb7773386a709884c' - '0ad3acc9c946a558a7d4c13574c6f4a25e897a9f81daff4b8a4b09b1cf019c50' - 'a04e4c8ee86606188c55349c4be755c72a9f03830d6f24828aba6bfa251e030d') +sha256sums=('8aa09d39739764bec2378cfbd45940264c8b7f5a24caa17f04a01f7b750799ce' + '6cf1981d8484b9874891b582e3c71ba9409d6c180a6f4e7fd84ec3307bfd746e' + 'af050c9c1e9c92c5ed3be73b606a4b931c78d6bb01175ecf5db503ba688d64ba' + '0e4aadf7b6dec6baf1c347664396787110ad756d53720f2c1bb0eba48c733169' + '0d303188a4a34759e4be1c2e11d68ba33f40edaf3056656618490c983d932dff' + 'cfe20ab0034b7f872d96363ea85261430f6a64ae403831978bd433c20415566c' + '14c7c6db61fcef7fa799770874bc4cad464fb8c08495a56c9cf5beb795ba522b') -# Helper macros to help make tasks easier # apply_patch_with_msg() { for _patch in "$@" do @@ -45,31 +47,30 @@ apply_patch_with_msg() { } prepare() { - cd "${srcdir}/${_realname}-b${pkgver}" - apply_patch_with_msg \ + cd "${_realname}-b${pkgver}" + + apply_patch_with_msg \ 001-compile-and-setup-fixes.patch \ 002-com-extensions-fix.patch \ 003-win32-extensions-fix.patch \ 004-isapi-fix.patch \ 005-swig-fix.patch \ 006-mapi-headers-fix.patch - - cd "${srcdir}" - rm -rf "python-build-${MSYSTEM}" | true - cp -r "${_realname}-b${pkgver}" "python-build-${MSYSTEM}" } build() { - msg "Python build for ${MSYSTEM}" - cd "${srcdir}/python-build-${MSYSTEM}" - ${MINGW_PREFIX}/bin/python setup.py build --skip-verstamp + cp -r "${_realname}-b${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}" + + SETUPTOOLS_USE_DISTUTILS=1 \ + ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation } package() { - cd "${srcdir}/python-build-${MSYSTEM}" - MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ - ${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} \ - --root="${pkgdir}" --optimize=1 --skip-build + cd "python-build-${MSYSTEM}" + + MSYS2_ARG_CONV_EXCL="--prefix=" \ + ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ + --destdir="${pkgdir}" dist/*.whl install -Dm644 "win32/License.txt" "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE.txt" }