[pywin32-checkins] /hgroot/pywin32/pywin32: 3 new changesets
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <pyw...@li...> - 2013-06-13 08:29:24
|
changeset 606c6302d0df in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=606c6302d0df summary: configure adodbapi as 'binary' to prevent the eol extension complaining changeset 9cb6d1c727e7 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=9cb6d1c727e7 summary: Ignore PT_MV_TSTRING along with PT_TSTRING (Nick Czeczulin) changeset 1594b8c27383 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=1594b8c27383 summary: Get the exchange module (mostly) working in 64bit builds (Nick Czeczulin) diffstat: .hgeol | 4 +++ CHANGES.txt | 5 +++ com/win32comext/mapi/mapiutil.py | 2 +- com/win32comext/mapi/src/PyIExchangeManageStore.i | 1 + com/win32comext/mapi/src/exchange.i | 30 +++++++++++++++++++--- setup.py | 25 +++++++++++++------ 6 files changed, 54 insertions(+), 13 deletions(-) diffs (187 lines): diff -r 4ded0a838f8c -r 1594b8c27383 .hgeol --- a/.hgeol Mon Apr 29 10:01:40 2013 -0400 +++ b/.hgeol Thu Jun 13 18:29:09 2013 +1000 @@ -2,4 +2,8 @@ **.dsp = CRLF **.dsw = CRLF **.vbp = CRLF +# adodbapi appears to have been checked in with windows line endings +# and without the 'eol' extension enabled, so we say it's binary to stop +# hg continually thinking it has changed. +path:adodbapi = bin ** = native diff -r 4ded0a838f8c -r 1594b8c27383 CHANGES.txt --- a/CHANGES.txt Mon Apr 29 10:01:40 2013 -0400 +++ b/CHANGES.txt Thu Jun 13 18:29:09 2013 +1000 @@ -6,6 +6,11 @@ Since build 218: ---------------- + * win32com.mapi.exchange + Added 64-bit support by excluding the 32-bit Ex2kSdk.lib functions from 64-bit builds. + Unfortunately, this means that only IExchangeManageStore::CreateStoreEntryID + is currently available in a 64-bit build. (Nick Czeczulin) + * adodbapi updated to version 2.4.3 -- new examples folder includes short programs for reading and writing .xls spreadsheets and reading ACCESS .mdb files using SQL. New functions .is64bit.Python() and .is64bit.os() to help pick the correct drivers. diff -r 4ded0a838f8c -r 1594b8c27383 com/win32comext/mapi/mapiutil.py --- a/com/win32comext/mapi/mapiutil.py Mon Apr 29 10:01:40 2013 -0400 +++ b/com/win32comext/mapi/mapiutil.py Thu Jun 13 18:29:09 2013 +1000 @@ -72,7 +72,7 @@ # PT_TSTRING is a conditional assignment # for either PT_UNICODE or PT_STRING8 and # should not be returned during a lookup. - if name == 'PT_TSTRING': + if name in ['PT_TSTRING', 'PT_MV_TSTRING']: continue ptTable[value] = name diff -r 4ded0a838f8c -r 1594b8c27383 com/win32comext/mapi/src/PyIExchangeManageStore.i --- a/com/win32comext/mapi/src/PyIExchangeManageStore.i Mon Apr 29 10:01:40 2013 -0400 +++ b/com/win32comext/mapi/src/PyIExchangeManageStore.i Thu Jun 13 18:29:09 2013 +1000 @@ -10,6 +10,7 @@ %{ #include <edkmdb.h> #define INITGUID +#include <initguid.h> #define USES_IID_IExchangeManageStore #include <edkguid.h> %} diff -r 4ded0a838f8c -r 1594b8c27383 com/win32comext/mapi/src/exchange.i --- a/com/win32comext/mapi/src/exchange.i Mon Apr 29 10:01:40 2013 -0400 +++ b/com/win32comext/mapi/src/exchange.i Thu Jun 13 18:29:09 2013 +1000 @@ -28,16 +28,21 @@ #include "MAPIUTIL.H" #include "EDKMDB.H" -#include "EDKMAPI.H" -#include "EDKCFG.H" -#include "EDKUTILS.H" -#define INITGUID #define USES_IID_IExchangeManageStore #include <edkguid.h> #include "PyIExchangeManageStore.h" +%} +/* + Only include Ex2KSdk.lib functions for 32-bit builds. +*/ +#ifdef SWIG_PY32BIT +%{ +#include "EDKMAPI.H" +#include "EDKCFG.H" +#include "EDKUTILS.H" // What is the correct story here?? The Exchange SDK story sucks - it seems // certain functions in the stand-alone version are simply commented out. @@ -52,7 +57,10 @@ #if !defined(DONT_HAVE_MBLOGON) # include "MBLOGON.H" #endif +%} +#endif +%{ static int AddIID(PyObject *dict, const char *key, REFGUID guid) { PyObject *obiid = PyWinObject_FromIID(guid); @@ -67,11 +75,24 @@ %} + +// IExchangeManageStore::CreateStoreEntryId flags +#define OPENSTORE_USE_ADMIN_PRIVILEGE OPENSTORE_USE_ADMIN_PRIVILEGE +#define OPENSTORE_PUBLIC OPENSTORE_PUBLIC +#define OPENSTORE_HOME_LOGON OPENSTORE_HOME_LOGON +#define OPENSTORE_TAKE_OWNERSHIP OPENSTORE_TAKE_OWNERSHIP +#define OPENSTORE_OVERRIDE_HOME_MDB OPENSTORE_OVERRIDE_HOME_MDB + + %init %{ if ( PyCom_RegisterClientType(&PyIExchangeManageStore::type, &IID_IExchangeManageStore) != 0 ) return MODINIT_ERROR_RETURN; ADD_IID(IID_IExchangeManageStore); %} +/* + Only include Ex2KSdk.lib functions for 32-bit builds. +*/ +#ifdef SWIG_PY32BIT // @pyswig int, int|HrGetExchangeStatus|Obtains the current state of the server on a computer. // @rdesc The result is a tuple of serviceState, serverState HRESULT HrGetExchangeStatus( @@ -510,3 +531,4 @@ IMAPISession *INPUT, // @pyparm <o PyIMAPISession>|session||The MAPI session object IMAPIProp **OUTPUT ); +#endif /* SWIG_PY32BIT */ diff -r 4ded0a838f8c -r 1594b8c27383 setup.py --- a/setup.py Mon Apr 29 10:01:40 2013 -0400 +++ b/setup.py Thu Jun 13 18:29:09 2013 +1000 @@ -546,7 +546,7 @@ keyname = "SOFTWARE\Microsoft\Exchange\SDK" for root in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER: try: - keyob = _winreg.OpenKey(root, keyname) + keyob = _winreg.OpenKey(root, keyname, 0, _winreg.KEY_READ | _winreg.KEY_WOW64_32KEY) value, type_id = _winreg.QueryValueEx(keyob, "INSTALLDIR") if type_id == _winreg.REG_SZ: sdk_install_dir = value @@ -562,7 +562,11 @@ kw.setdefault("library_dirs", []).insert(0, d) # The stand-alone exchange SDK has these libs - libs += " Ex2KSdk sadapi mapi32 netapi32" + if distutils.util.get_platform() == 'win-amd64': + # Additional utility functions are only available for 32-bit builds. + pass + else: + libs += " version user32 advapi32 Ex2KSdk sadapi netapi32" kw["libraries"] = libs WinExt_win32com.__init__(self, name, **kw) @@ -791,10 +795,11 @@ def _why_cant_build_extension(self, ext): # Return None, or a reason it can't be built. - # This kinda sucks, but I'm giving up on exchange support in 64bit - # builds. - if self.plat_name == 'win-amd64' and ext.name in ['exchange', 'exchdapi']: - return "Can't get exchange support working in 64bit builds" + # Exclude exchange 32-bit utility libraries from 64-bit + # builds. Note that the exchange module now builds, but only + # includes interfaces for 64-bit builds. + if self.plat_name == 'win-amd64' and ext.name in ['exchdapi']: + return "No 64-bit library for utility functions available." include_dirs = self.compiler.include_dirs + \ os.environ.get("INCLUDE", "").split(os.pathsep) if self.windows_h_version is None: @@ -1345,6 +1350,10 @@ swig_cmd.extend(self.current_extension.extra_swig_commands) if not is_py3k: swig_cmd.append("-DSWIG_PY2K") + if distutils.util.get_platform() == 'win-amd64': + swig_cmd.append("-DSWIG_PY64BIT") + else: + swig_cmd.append("-DSWIG_PY32BIT") target = swig_targets[source] try: interface_parent = swig_interface_parents[ @@ -1932,12 +1941,12 @@ %(mapi)s/mapiutil.cpp %(mapi)s/mapiguids.cpp """ % dirs).split()), - WinExt_win32com_mapi('exchange', libraries="version user32 advapi32", + WinExt_win32com_mapi('exchange', libraries="mapi32", sources=(""" %(mapi)s/exchange.i %(mapi)s/exchange.cpp %(mapi)s/PyIExchangeManageStore.i %(mapi)s/PyIExchangeManageStore.cpp """ % dirs).split()), - WinExt_win32com_mapi('exchdapi', libraries="advapi32", + WinExt_win32com_mapi('exchdapi', libraries="mapi32", sources=(""" %(mapi)s/exchdapi.i %(mapi)s/exchdapi.cpp """ % dirs).split()), |