pywin32-checkins Mailing List for Python for Windows Extensions
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Mark H. <mha...@sk...> - 2017-09-19 07:10:46
|
Now that Python has moved to git and github, and sourceforge seems to be making it almost impossible to find their mercurial repos, I think pywin32 should also move to git and github. I intend moving the repo over first, and move the tracker over at some stage later. At this stage I'm only mailing the -checkins list, and hope that some of you may be able to have a quick look at this repo and ensure it is sane. I've rewritten some of the "authors" in commits to include an email address (using their github ID if I could find it) and rewritten some of the commit messages so that text like "fixed something (bug #123)" is now "fixed something (bug #sf123)" to try and differentiate old sourceforge references from github references. I've put the repo up at https://github.com/mhammond/pywin32-experimental-do-not-clone - I've named it that way just in-case there are objections or something I've missed, but I hope to rename it to simply pywin32 soon. Also, please feel free to send me your github IDs and I'll happily give you access to this repo. Please let me know if you have any concerns about this, and I'd appreciate it if you could give it a quick sanity check. Thanks! Mark |
From: <pyw...@li...> - 2017-03-29 00:21:48
|
changeset 7635c57fc1b8 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=7635c57fc1b8 summary: Add Python 3.7 builds changeset 07050221f9fb in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=07050221f9fb summary: Fix so new python versions which use a const return value from _PyUnicode_AsString work correctly changeset 0458995e9e9c in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=0458995e9e9c summary: increment build number to 221 changeset 0db1b26904d5 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=0db1b26904d5 summary: Added tag b221 for changeset 0458995e9e9c diffstat: .hgtags | 1 + build_all.bat | 6 +++++- make_all.bat | 5 +++++ setup.py | 2 +- win32/src/PyWinTypes.h | 2 +- 5 files changed, 13 insertions(+), 3 deletions(-) diffs (63 lines): diff -r 85c1c99b1cb8 -r 0db1b26904d5 .hgtags --- a/.hgtags Sat Apr 16 16:27:49 2016 +1000 +++ b/.hgtags Wed Mar 29 11:21:16 2017 +1100 @@ -53,3 +53,4 @@ 2d79b6bd94bc145f7f5a6e1c63d626737fc98e6c 218.5 713ac73c22e54a9d727f2fa4803b8c8939b14966 b219 f30ccd8f8f38d37a94b3a105dc357f28501f67ba b220 +0458995e9e9cb08da8fd284a6cbec0453197bb66 b221 diff -r 85c1c99b1cb8 -r 0db1b26904d5 build_all.bat --- a/build_all.bat Sat Apr 16 16:27:49 2016 +1000 +++ b/build_all.bat Wed Mar 29 11:21:16 2017 +1100 @@ -38,9 +38,13 @@ @if errorlevel 1 goto failed py -3.6 setup3.py -q build @if errorlevel 1 goto failed +py -3.7-32 setup3.py -q build +@if errorlevel 1 goto failed +py -3.7 setup3.py -q build +@if errorlevel 1 goto failed goto xit :failed @echo Oops - failed! goto xit -:xit \ No newline at end of file +:xit diff -r 85c1c99b1cb8 -r 0db1b26904d5 make_all.bat --- a/make_all.bat Sat Apr 16 16:27:49 2016 +1000 +++ b/make_all.bat Wed Mar 29 11:21:16 2017 +1100 @@ -51,6 +51,11 @@ @if exist build\bdist.win32 rd /s/q build\bdist.win32 & @if exist build\bdist.amd64 rd /s/q build\bdist.amd64 py -3.6 setup3.py -q bdist_wininst --target-version=3.6 --skip-build --plat-name=win-amd64 +@if exist build\bdist.win32 rd /s/q build\bdist.win32 & @if exist build\bdist.amd64 rd /s/q build\bdist.amd64 +py -3.7-32 setup3.py -q bdist_wininst --target-version=3.7 --skip-build +@if exist build\bdist.win32 rd /s/q build\bdist.win32 & @if exist build\bdist.amd64 rd /s/q build\bdist.amd64 +py -3.7 setup3.py -q bdist_wininst --target-version=3.7 --skip-build --plat-name=win-amd64 + rem And nuke the dirs one more time :) if exist build/bdist.win32/. rm -rf build/bdist.win32 if exist build/bdist.win-amd64/. rm -rf build/bdist.win-amd64 diff -r 85c1c99b1cb8 -r 0db1b26904d5 setup.py --- a/setup.py Sat Apr 16 16:27:49 2016 +1000 +++ b/setup.py Wed Mar 29 11:21:16 2017 +1100 @@ -1,4 +1,4 @@ -build_id="220.1" # may optionally include a ".{patchno}" suffix. +build_id="221" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) __doc__="""This is a distutils setup-script for the pywin32 extensions diff -r 85c1c99b1cb8 -r 0db1b26904d5 win32/src/PyWinTypes.h --- a/win32/src/PyWinTypes.h Sat Apr 16 16:27:49 2016 +1000 +++ b/win32/src/PyWinTypes.h Wed Mar 29 11:21:16 2017 +1100 @@ -114,7 +114,7 @@ documented, but is used extensively in the Python codebase itself, so it's reasonable to assume it won't disappear anytime soon. */ -#define PYWIN_ATTR_CONVERT _PyUnicode_AsString +#define PYWIN_ATTR_CONVERT (char *)_PyUnicode_AsString /* Some API functions changed/removed in python 3.0 Definitions for the string functions are in stringobject.h, |
From: <pyw...@li...> - 2016-04-16 06:47:34
|
changeset 85c1c99b1cb8 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=85c1c99b1cb8 summary: Add PyIMapiSession::AdminServices method (Nick Czeczulin via patch #161) diffstat: CHANGES.txt | 2 ++ com/win32comext/mapi/src/PyIMAPISession.i | 6 ++++++ 2 files changed, 8 insertions(+), 0 deletions(-) diffs (25 lines): diff -r 7a9466f06a9b -r 85c1c99b1cb8 CHANGES.txt --- a/CHANGES.txt Sat Apr 16 14:09:27 2016 +1000 +++ b/CHANGES.txt Sat Apr 16 16:27:49 2016 +1000 @@ -6,6 +6,8 @@ Since build 220: ---------------- +* Add PyIMapiSession::AdminServices method (Nick Czeczulin via patch #161) + * Allow win32com.client.CastTo() to have a typelib specified, which will be used to locate the object definition (Pieter Aarnoutse via patch #136) diff -r 7a9466f06a9b -r 85c1c99b1cb8 com/win32comext/mapi/src/PyIMAPISession.i --- a/com/win32comext/mapi/src/PyIMAPISession.i Sat Apr 16 14:09:27 2016 +1000 +++ b/com/win32comext/mapi/src/PyIMAPISession.i Sat Apr 16 16:27:49 2016 +1000 @@ -313,3 +313,9 @@ IID *INPUT_NULLOK, // @pyparm <o PyIID>|iid||The IID of the interface, or None. unsigned long flags, // @pyparm int|flags||Flags that control the opening. IProfSect **OUTPUT); + + +// @pyswig <o PyIMsgServiceAdmin>|AdminServices|Provides access to a message service administration object for making changes to the message services. +HRESULT AdminServices( + unsigned long ulFlags=0, // @pyparm int|flags|0|reserved; must be zero. + IMsgServiceAdmin **OUTPUT); |
From: <pyw...@li...> - 2016-04-16 04:10:04
|
changeset 9559d74774bc in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=9559d74774bc summary: Add pythoncom.StgOpenStorageOnILockBytes (Nick Czeczulin via patch #135) changeset 7a9466f06a9b in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=7a9466f06a9b summary: Allow win32com.client.CastTo() to have a typelib specified (Pieter Aarnoutse via patch #136) diffstat: CHANGES.txt | 5 +++++ com/win32com/client/__init__.py | 20 ++++++++++++++------ com/win32com/src/PyStorage.cpp | 35 +++++++++++++++++++++++++++++++++++ com/win32com/src/PythonCOM.cpp | 2 ++ 4 files changed, 56 insertions(+), 6 deletions(-) diffs (118 lines): diff -r fac37b1e89a7 -r 7a9466f06a9b CHANGES.txt --- a/CHANGES.txt Sat Apr 16 13:53:01 2016 +1000 +++ b/CHANGES.txt Sat Apr 16 14:09:27 2016 +1000 @@ -6,6 +6,11 @@ Since build 220: ---------------- +* Allow win32com.client.CastTo() to have a typelib specified, which will be + used to locate the object definition (Pieter Aarnoutse via patch #136) + +* Add pythoncom.StgOpenStorageOnILockBytes (Nick Czeczulin via patch #135) + * IDispatch failures will try and get error information via IErrorInfo (Stefan Schukat via patch #130) diff -r fac37b1e89a7 -r 7a9466f06a9b com/win32com/client/__init__.py --- a/com/win32com/client/__init__.py Sat Apr 16 13:53:01 2016 +1000 +++ b/com/win32com/client/__init__.py Sat Apr 16 14:09:27 2016 +1000 @@ -124,10 +124,17 @@ assert UnicodeToString is None, "this is deprecated and will go away" return Dispatch(ob, userName, returnCLSID,None) -def CastTo(ob, target): +def CastTo(ob, target, typelib = None): """'Cast' a COM object to another interface""" # todo - should support target being an IID - if hasattr(target, "index"): # string like + mod = None + if typelib is not None: # caller specified target typelib (TypelibSpec). See e.g. selecttlb.EnumTlbs(). + mod = gencache.MakeModuleForTypelib(typelib.clsid, typelib.lcid, int(typelib.major, 16), int(typelib.minor, 16)) + if not hasattr(mod, target): + raise ValueError("The interface name '%s' does not appear in the " \ + "specified library %r" % (target, typelib.ver_desc)) + + elif hasattr(target, "index"): # string like # for now, we assume makepy for this to work. if "CLSID" not in ob.__class__.__dict__: # Eeek - no makepy support - try and build it. @@ -152,10 +159,11 @@ raise ValueError("The interface name '%s' does not appear in the " \ "same library as object '%r'" % (target, ob)) mod = gencache.GetModuleForCLSID(target_clsid) - target_class = getattr(mod, target) - # resolve coclass to interface - target_class = getattr(target_class, "default_interface", target_class) - return target_class(ob) # auto QI magic happens + if mod is not None: + target_class = getattr(mod, target) + # resolve coclass to interface + target_class = getattr(target_class, "default_interface", target_class) + return target_class(ob) # auto QI magic happens raise ValueError class Constants: diff -r fac37b1e89a7 -r 7a9466f06a9b com/win32com/src/PyStorage.cpp --- a/com/win32com/src/PyStorage.cpp Sat Apr 16 13:53:01 2016 +1000 +++ b/com/win32com/src/PyStorage.cpp Sat Apr 16 14:09:27 2016 +1000 @@ -190,6 +190,41 @@ return PyCom_PyObjectFromIUnknown(pResult, IID_IStorage, FALSE); } +// @pymethod <o PyIStorage>|pythoncom|StgOpenStorageOnILockBytes|Open an existing storage object that does not reside in a disk file, but instead has an underlying <PyILockBytes> byte array provided by the caller. +PyObject *pythoncom_StgOpenStorageOnILockBytes(PyObject *self, PyObject *args) +{ + PyObject *obLockBytes; + PyObject *obStgPriority = NULL; + DWORD mode; + PyObject *obSnbExclude = NULL; + DWORD reserved = 0; + IStorage *pResult; + + if (!PyArg_ParseTuple(args, "OOk|Ok:StgOpenStorageOnILockBytes", + &obLockBytes, // @pyparm <o PyILockBytes>|lockBytes||The <o PyILockBytes> interface on the underlying byte array object on which to open an existing storage object. + &obStgPriority, // @pyparm <o PyIStorage>|stgPriority||Usually None, or another parent storage. + &mode, + &obSnbExclude, // @pyparm object|snbExclude|None|Not yet supported - must be None + &reserved)) // @pyparm int|reserved|0|A reserved value + return NULL; + ILockBytes *plb; + if (!PyCom_InterfaceFromPyObject(obLockBytes, IID_ILockBytes, (void **)&plb, FALSE)) + return NULL; + IStorage *pStgPriority; + if (!PyCom_InterfaceFromPyObject(obStgPriority, IID_IStorage, (void **)&pStgPriority, TRUE)) + { + plb->Release(); + return NULL; + } + PY_INTERFACE_PRECALL; + HRESULT hr = StgOpenStorageOnILockBytes(plb, pStgPriority, mode, NULL, reserved, &pResult); + plb->Release(); + if (pStgPriority) pStgPriority->Release(); + PY_INTERFACE_POSTCALL; + if (FAILED(hr)) return PyCom_BuildPyException(hr); + return PyCom_PyObjectFromIUnknown(pResult, IID_IStorage, FALSE); +} + #ifndef MS_WINCE // @pymethod int|pythoncom|StgIsStorageFile|Indicates whether a particular disk file contains a storage object. PyObject *pythoncom_StgIsStorageFile(PyObject *self, PyObject *args) diff -r fac37b1e89a7 -r 7a9466f06a9b com/win32com/src/PythonCOM.cpp --- a/com/win32com/src/PythonCOM.cpp Sat Apr 16 13:53:01 2016 +1000 +++ b/com/win32com/src/PythonCOM.cpp Sat Apr 16 14:09:27 2016 +1000 @@ -50,6 +50,7 @@ #endif // MS_WINCE extern PyObject *pythoncom_StgCreateDocfile(PyObject *self, PyObject *args); extern PyObject *pythoncom_StgCreateDocfileOnILockBytes(PyObject *self, PyObject *args); +extern PyObject *pythoncom_StgOpenStorageOnILockBytes(PyObject *self, PyObject *args); extern PyObject *pythoncom_WriteClassStg(PyObject *self, PyObject *args); extern PyObject *pythoncom_ReadClassStg(PyObject *self, PyObject *args); extern PyObject *pythoncom_WriteClassStm(PyObject *self, PyObject *args); @@ -2063,6 +2064,7 @@ #endif // MS_WINCE { "StgCreateDocfile", pythoncom_StgCreateDocfile, 1 }, // @pymeth StgCreateDocfile|Creates a new compound file storage object using the OLE-provided compound file implementation for the <o PyIStorage> interface. { "StgCreateDocfileOnILockBytes", pythoncom_StgCreateDocfileOnILockBytes, 1 }, // @pymeth StgCreateDocfileOnILockBytes|Creates a new compound file storage object using the OLE-provided compound file implementation for the <o PyIStorage> interface. + { "StgOpenStorageOnILockBytes", pythoncom_StgOpenStorageOnILockBytes, 1 }, // @pymeth StgOpenStorageOnILockBytes|Open an existing storage object that does not reside in a disk file, but instead has an underlying <PyILockBytes> byte array provided by the caller. #ifndef MS_WINCE { "StgIsStorageFile", pythoncom_StgIsStorageFile, 1 }, // @pymeth StgIsStorageFile|Indicates whether a particular disk file contains a storage object. #endif // MS_WINCE |
From: <pyw...@li...> - 2016-04-16 03:53:56
|
changeset fac37b1e89a7 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=fac37b1e89a7 summary: IDispatch failures will try and get error information via IErrorInfo (Stefan Schukat via patch #130) diffstat: CHANGES.txt | 3 + com/win32com/src/PyIDispatch.cpp | 78 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 76 insertions(+), 5 deletions(-) diffs (129 lines): diff -r cc08f2559b15 -r fac37b1e89a7 CHANGES.txt --- a/CHANGES.txt Thu Oct 22 08:54:40 2015 -0700 +++ b/CHANGES.txt Sat Apr 16 13:53:01 2016 +1000 @@ -6,6 +6,9 @@ Since build 220: ---------------- +* IDispatch failures will try and get error information via IErrorInfo (Stefan + Schukat via patch #130) + * A null SPropTagArray will now return None instead of crashing. * New mapi/exchange interfaces PyIExchangeManageStoreEx, PyIMAPIAdviseSink, diff -r cc08f2559b15 -r fac37b1e89a7 com/win32com/src/PyIDispatch.cpp --- a/com/win32com/src/PyIDispatch.cpp Thu Oct 22 08:54:40 2015 -0700 +++ b/com/win32com/src/PyIDispatch.cpp Sat Apr 16 13:53:01 2016 +1000 @@ -4,7 +4,69 @@ #include "stdafx.h" #include "PythonCOM.h" -static BOOL HandledDispatchFailure(HRESULT hr, EXCEPINFO *einfo, UINT nArgErr, UINT cArgs) +// Check if IDispatch implementation transports via IErrorInfo instead of +// EXCEPINFO +static BOOL ExcepInfoFromIErrorInfo(EXCEPINFO *einfo, IDispatch* pDisp, HRESULT scode) +{ + if (NULL == einfo || pDisp == NULL) { + return FALSE; + } + ISupportErrorInfo *pSEI; + HRESULT hr; + Py_BEGIN_ALLOW_THREADS + hr = pDisp->QueryInterface(IID_ISupportErrorInfo, (void **)&pSEI); + if (SUCCEEDED(hr)) { + hr = pSEI->InterfaceSupportsErrorInfo(IID_IDispatch); + pSEI->Release(); // Finished with this object + } + Py_END_ALLOW_THREADS + + // InterfaceSupportsErrorInfo returning S_FALSE means we should ignore it. + if (FAILED(hr) || hr == S_FALSE) { + return FALSE; + } + + // ErrorInfo via IErrorInfo hence transform to EXCEPINFO + IErrorInfo *pEI; + Py_BEGIN_ALLOW_THREADS + hr=GetErrorInfo(0, &pEI); + Py_END_ALLOW_THREADS + + if (hr!=S_OK) { + return FALSE; + } + // These strings will be freed when PyCom_CleanupExcepInfo is called + // by our caller. + BSTR desc = NULL; + BSTR source = NULL; + BSTR helpfile = NULL; + + Py_BEGIN_ALLOW_THREADS + hr=pEI->GetDescription(&desc); + if (hr==S_OK) { + einfo->bstrDescription = desc; + } + hr=pEI->GetSource(&source); + if (hr==S_OK) { + einfo->bstrSource = source; + } + hr=pEI->GetHelpFile(&helpfile); + if (hr==S_OK) { + einfo->bstrHelpFile = helpfile; + } + DWORD helpContext = 0; + hr = pEI->GetHelpContext(&helpContext); + if (hr==S_OK) { + einfo->dwHelpContext = helpContext; + } + einfo->wCode = 0; + einfo->scode = scode; + Py_END_ALLOW_THREADS + PYCOM_RELEASE(pEI); + return TRUE; +} + +static BOOL HandledDispatchFailure(HRESULT hr, EXCEPINFO *einfo, UINT nArgErr, UINT cArgs, IDispatch *pDisp) { if ( hr == DISP_E_EXCEPTION ) { @@ -23,7 +85,13 @@ nArgErr =(UINT)-1; else nArgErr = cArgs - nArgErr; /* convert to usable index */ - PyCom_BuildPyExceptionFromEXCEPINFO(hr, NULL, nArgErr); + // See if we can fill the EXCEPINFO via IErrorInfo. + if(ExcepInfoFromIErrorInfo(einfo, pDisp, hr)) { + PyCom_BuildPyExceptionFromEXCEPINFO(hr, einfo, nArgErr); + } else { + PyCom_BuildPyExceptionFromEXCEPINFO(hr, NULL, nArgErr); + } + return TRUE; } return FALSE; @@ -270,7 +338,7 @@ PY_INTERFACE_POSTCALL; if (!PyCom_FinishUntypedDISPPARAMS(&dispparams, helpers) || - HandledDispatchFailure(hr, &excepInfo, nArgErr, dispparams.cArgs) ) { + HandledDispatchFailure(hr, &excepInfo, nArgErr, dispparams.cArgs, pMyDispatch) ) { if ( pVarResultUse ) VariantClear(pVarResultUse); return NULL; @@ -425,7 +493,7 @@ PY_INTERFACE_POSTCALL; } - if ( !HandledDispatchFailure(hr, &excepInfo, nArgErr, dispparams.cArgs) ) + if ( !HandledDispatchFailure(hr, &excepInfo, nArgErr, dispparams.cArgs, pMyDispatch) ) { // Now get fancy with the args. Any args specified as BYREF get returned // to Python. @@ -657,7 +725,7 @@ PY_INTERFACE_POSTCALL; if (!PyCom_FinishUntypedDISPPARAMS(&dispparams, helpers) || - HandledDispatchFailure(hr, &excepInfo, (UINT)-1, dispparams.cArgs) ) { + HandledDispatchFailure(hr, &excepInfo, (UINT)-1, dispparams.cArgs, pMyDispatch) ) { if ( pVarResultUse ) VariantClear(pVarResultUse); return NULL; |
From: <pyw...@li...> - 2016-02-27 05:54:41
|
changeset 27792ff20dbe in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=27792ff20dbe summary: Add mapi exchange module PyIExchangeManageStoreEx::CreateStoreEntryID2 changeset d932f03be686 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=d932f03be686 summary: Add PyIMAPIAdviseSink, PyIMsgStore::Advise, PyIMsgStore::Unadvise, HrAllocAdviseSink, HrThisThreadAdviseSink, and HrDispatchNotifications changeset 40baafca4b98 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=40baafca4b98 summary: Add support for PT_MV_CLSID and PT_MV_I8 in FromSPropValue() changeset fd1a36d09647 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=fd1a36d09647 summary: Fixes PyIExchangeManageStore::CreateStoreEntryID for public folders and py3 changeset e0bd94265138 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=e0bd94265138 summary: Add MAPI SPropProblemArray support for SetProps, DeleteProps, CopyProps,and CopyTo changeset ce6ef8c690c7 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=ce6ef8c690c7 summary: removed unused variable to avoid compiler warning changeset e32aa302e540 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=e32aa302e540 summary: Add MAPI_UNICODE flag option to GetLastError changeset cc08f2559b15 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=cc08f2559b15 summary: Change mapi string handling to be influenced by the the MAPI_UNICODE flag setting. diffstat: CHANGES.txt | 4 + com/win32comext/mapi/mapitags.py | 4 + com/win32comext/mapi/src/PyIAttach.i | 34 +- com/win32comext/mapi/src/PyIExchangeManageStore.i | 27 +- com/win32comext/mapi/src/PyIExchangeManageStoreEx.i | 102 ++++++ com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp | 140 ++++++++- com/win32comext/mapi/src/PyIMAPIAdviseSink.h | 32 + com/win32comext/mapi/src/PyIMAPIFolder.i | 98 +++++- com/win32comext/mapi/src/PyIMAPIProp.i | 123 ++++++- com/win32comext/mapi/src/PyIMAPISession.i | 34 ++- com/win32comext/mapi/src/PyIMAPITable.i | 33 +- com/win32comext/mapi/src/PyIMsgServiceAdmin.i | 85 ++++- com/win32comext/mapi/src/PyIMsgStore.i | 110 +++++- com/win32comext/mapi/src/PyIProfAdmin.i | 325 +++++++++++++++++-- com/win32comext/mapi/src/PyIProviderAdmin.i | 34 +- com/win32comext/mapi/src/PyMAPIUtil.h | 6 + com/win32comext/mapi/src/exchange.i | 5 + com/win32comext/mapi/src/mapi.i | 134 +++++++- com/win32comext/mapi/src/mapiutil.cpp | 104 ++++- setup.py | 3 + 20 files changed, 1294 insertions(+), 143 deletions(-) diffs (truncated from 1895 to 300 lines): diff -r 8c70bcb663b9 -r cc08f2559b15 CHANGES.txt --- a/CHANGES.txt Sat Feb 27 13:13:05 2016 +1100 +++ b/CHANGES.txt Thu Oct 22 08:54:40 2015 -0700 @@ -8,6 +8,10 @@ ---------------- * A null SPropTagArray will now return None instead of crashing. +* New mapi/exchange interfaces PyIExchangeManageStoreEx, PyIMAPIAdviseSink, + PyIMsgStore::Advise, PyIMsgStore::Unadvise, HrAllocAdviseSink, + HrThisThreadAdviseSink, and HrDispatchNotifications (Nick Czeczulin) + Since build 219: ---------------- * win32com - sys.argv[0] may be set to a bytes object instead of a string on diff -r 8c70bcb663b9 -r cc08f2559b15 com/win32comext/mapi/mapitags.py --- a/com/win32comext/mapi/mapitags.py Sat Feb 27 13:13:05 2016 +1100 +++ b/com/win32comext/mapi/mapitags.py Thu Oct 22 08:54:40 2015 -0700 @@ -1001,3 +1001,7 @@ PR_MESSAGE_SIZE_EXTENDED = PROP_TAG(PT_I8, PROP_ID(PR_MESSAGE_SIZE)) PR_USERFIELDS = PROP_TAG(PT_BINARY, 0x36e3) + +# IExchangeManageStoreEx::CreateStoreEntryID2 +PR_FORCE_USE_ENTRYID_SERVER = PROP_TAG(PT_BOOLEAN, 0x7CFE) +PR_PROFILE_MDB_DN = PROP_TAG(PT_STRING8, 0x7CFF) diff -r 8c70bcb663b9 -r cc08f2559b15 com/win32comext/mapi/src/PyIAttach.i --- a/com/win32comext/mapi/src/PyIAttach.i Sat Feb 27 13:13:05 2016 +1100 +++ b/com/win32comext/mapi/src/PyIAttach.i Thu Oct 22 08:54:40 2015 -0700 @@ -30,7 +30,35 @@ %} +%native(GetLastError) GetLastError; +%{ +// @pyswig <o MAPIERROR>|GetLastError|Returns the last error code for the object. +PyObject *PyIAttach::GetLastError(PyObject *self, PyObject *args) +{ + HRESULT hr, hRes; + ULONG flags = 0; + MAPIERROR *me = NULL; + + IAttach *_swig_self; + if ((_swig_self=GetI(self))==NULL) return NULL; + + 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; + + Py_BEGIN_ALLOW_THREADS + hRes = _swig_self->GetLastError(hr, flags, &me); + Py_END_ALLOW_THREADS -// GetLastError|Returns a MAPIERROR structure containing information about the previous error on the table. -HRESULT GetLastError(HRESULT hr, unsigned long flags, MAPIERROR **OUTPUT); - + if (FAILED(hRes)) + return OleSetOleError(hRes); + + if (me == NULL) + { + Py_INCREF(Py_None); + return Py_None; + } + return PyObject_FromMAPIERROR(me, flags & MAPI_UNICODE, TRUE); +} +%} diff -r 8c70bcb663b9 -r cc08f2559b15 com/win32comext/mapi/src/PyIExchangeManageStore.i --- a/com/win32comext/mapi/src/PyIExchangeManageStore.i Sat Feb 27 13:13:05 2016 +1100 +++ b/com/win32comext/mapi/src/PyIExchangeManageStore.i Thu Oct 22 08:54:40 2015 -0700 @@ -59,8 +59,10 @@ PyObject *PyIExchangeManageStore::CreateStoreEntryID(PyObject *self, PyObject *args) { HRESULT hRes; - char *serverDN; - char *userDN; + PyObject *obServerDN; + PyObject *obUserDN; + char *serverDN = NULL; + char *userDN = NULL; unsigned long flags = 0; SBinary sbEID = {0, NULL}; PyObject *result = NULL; @@ -68,9 +70,17 @@ IExchangeManageStore *_swig_self; if ((_swig_self=GetI(self))==NULL) return NULL; - if (!PyArg_ParseTuple(args, "ss|l:CreateStoreEntryID", &serverDN, &userDN, &flags)) + if (!PyArg_ParseTuple(args, "OO|l:CreateStoreEntryID", + &obServerDN, + &obUserDN, + &flags)) return NULL; + if (!PyWinObject_AsString(obServerDN, &serverDN, FALSE)) + goto done; + if (!PyWinObject_AsString(obUserDN, &userDN, TRUE)) + goto done; + Py_BEGIN_ALLOW_THREADS hRes = _swig_self->CreateStoreEntryID(serverDN, userDN, flags, &sbEID.cb, (LPENTRYID *) &sbEID.lpb); Py_END_ALLOW_THREADS @@ -78,9 +88,18 @@ if (FAILED(hRes)) result = OleSetOleError(hRes); else - result = Py_BuildValue("s#", sbEID.lpb, sbEID.cb); + result = Py_BuildValue( +#if PY_MAJOR_VERSION >= 3 + "y#", +#else + "s#", +#endif + sbEID.lpb, sbEID.cb); +done: MAPIFreeBuffer((LPENTRYID)sbEID.lpb); + PyWinObject_FreeString(serverDN); + PyWinObject_FreeString(userDN); return result; } diff -r 8c70bcb663b9 -r cc08f2559b15 com/win32comext/mapi/src/PyIExchangeManageStoreEx.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/com/win32comext/mapi/src/PyIExchangeManageStoreEx.i Thu Oct 22 08:54:40 2015 -0700 @@ -0,0 +1,102 @@ +/* File : PyIExchangeManageStoreEx.i */ + +%module IExchangeManageStoreEx + +%include "typemaps.i" +%include "pywin32.i" +%include "pythoncom.i" +%include "mapilib.i" + +%typemap(python,ignore) IExchangeManageStoreEx **OUTPUT(IExchangeManageStoreEx *temp) +{ + $target = &temp; +} +%typemap(python,argout) IExchangeManageStoreEx **OUTPUT { + MAKE_OUTPUT_INTERFACE($source, $target, IID_IExchangeManageStoreEx) +} +%typemap(python,freearg) IExchangeManageStoreEx *INPUT, + IExchangeManageStoreEx *INPUT_NULLOK +{ + if ($source) $source->Release(); +} + +%typemap(python,in) IExchangeManageStoreEx *INPUT { + if (!PyCom_InterfaceFromPyInstanceOrObject($source, IID_IExchangeManageStoreEx, (void **)&$target, 0)) + return NULL; +} +%typemap(python,in) IExchangeManageStoreEx *INPUT_NULLOK { + if (!PyCom_InterfaceFromPyInstanceOrObject($source, IID_IExchangeManageStoreEx, (void **)&$target, 1)) + return NULL; +} + +%{ +#include <initguid.h> +#include "IExchangeManageStoreEx.h" +#include "PyIExchangeManageStoreEx.h" + +PyIExchangeManageStoreEx::PyIExchangeManageStoreEx(IUnknown *pDisp) : + PyIUnknown(pDisp) +{ + ob_type = &type; +} + +IExchangeManageStoreEx *PyIExchangeManageStoreEx::GetI(PyObject *self) +{ + return (IExchangeManageStoreEx *)PyIUnknown::GetI(self); +} + +PyIExchangeManageStoreEx::~PyIExchangeManageStoreEx() {} +%} + +/* +** See http://blogs.msdn.com/b/dvespa/archive/2014/01/15/new-mapi-interface-ignore-home-server.aspx +*/ + +%native(CreateStoreEntryID2) CreateStoreEntryID2; +%{ +PyObject *PyIExchangeManageStoreEx::CreateStoreEntryID2(PyObject *self, PyObject *args) +{ + PyObject *result = NULL; + HRESULT hRes; + PyObject *obs = NULL; + ULONG flags = 0; + SPropValue *pPV; + ULONG seqLen; + SBinary sbEID = {0, NULL}; + + IExchangeManageStoreEx *_swig_self; + if ((_swig_self=GetI(self))==NULL) return NULL; + + if (!PyArg_ParseTuple(args, "O|l:CreateStoreEntryID2", &obs, &flags)) + return NULL; + + if (!PySequence_Check(obs)) + { + PyErr_SetString(PyExc_TypeError, "Properties must be a sequence of tuples"); + return NULL; + } + + if (!PyMAPIObject_AsSPropValueArray(obs, &pPV, &seqLen)) + return NULL; + + Py_BEGIN_ALLOW_THREADS + hRes = _swig_self->CreateStoreEntryID2(seqLen, pPV, flags, &sbEID.cb, (LPENTRYID *) &sbEID.lpb); + Py_END_ALLOW_THREADS + + if (FAILED(hRes)) + result = OleSetOleError(hRes); + else + result = Py_BuildValue( +#if PY_MAJOR_VERSION >= 3 + "y#", +#else + "s#", +#endif + sbEID.lpb, sbEID.cb); + + MAPIFreeBuffer((LPENTRYID)sbEID.lpb); + MAPIFreeBuffer(pPV); + + return result; +} +%} diff -r 8c70bcb663b9 -r cc08f2559b15 com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp --- a/com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp Sat Feb 27 13:13:05 2016 +1100 +++ b/com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp Thu Oct 22 08:54:40 2015 -0700 @@ -17,7 +17,12 @@ switch (n->ulEventType) { case fnevCriticalError: { ERROR_NOTIFICATION &err = n->info.err; - ret = Py_BuildValue("k(s#iiN)", + ret = Py_BuildValue( +#if PY_MAJOR_VERSION >= 3 + "k(y#iiN)", +#else + "k(s#iiN)", +#endif n->ulEventType, err.lpEntryID, err.cbEntryID, err.scode, @@ -27,7 +32,13 @@ } case fnevExtended: { EXTENDED_NOTIFICATION &ext = n->info.ext; - ret = Py_BuildValue("k(ks#)", n->ulEventType, ext.ulEvent, + ret = Py_BuildValue( +#if PY_MAJOR_VERSION >= 3 + "k(ky#)", +#else + "k(ks#)", +#endif + n->ulEventType, ext.ulEvent, ext.pbEventParameters, ext.cb); break; } @@ -38,7 +49,12 @@ PyString_FromString((const char *)newmail.lpszMessageClass); if (!msg_class) return NULL; - ret = Py_BuildValue("k(s#s#kNk)", + ret = Py_BuildValue( +#if PY_MAJOR_VERSION >= 3 + "k(y#y#kNk)", +#else + "k(s#s#kNk)", +#endif n->ulEventType, newmail.lpEntryID, newmail.cbEntryID, newmail.lpParentID, newmail.cbParentID, @@ -57,7 +73,12 @@ PyObject *obArray = PyMAPIObject_FromSPropTagArray(obj.lpPropTagArray); if (!obArray) return NULL; - ret = Py_BuildValue("k(s#is#s#s#N)", + ret = Py_BuildValue( +#if PY_MAJOR_VERSION >= 3 + "k(y#iy#y#y#N)", +#else + "k(s#is#s#s#N)", +#endif n->ulEventType, obj.lpEntryID, obj.cbEntryID, obj.ulObjType, @@ -80,7 +101,12 @@ } case fnevStatusObjectModified: { STATUS_OBJECT_NOTIFICATION &statobj = n->info.statobj; - ret = Py_BuildValue("k(s#N)", + ret = Py_BuildValue( +#if PY_MAJOR_VERSION >= 3 + "k(y#N)", +#else + "k(s#N)", +#endif n->ulEventType, |
From: <pyw...@li...> - 2016-02-27 02:14:39
|
changeset 741805c2ed90 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=741805c2ed90 summary: increment build number changeset 8c70bcb663b9 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=8c70bcb663b9 summary: A null SPropTagArray will now return None instead of crashing. diffstat: CHANGES.txt | 4 ++++ com/win32comext/mapi/src/mapiutil.cpp | 4 ++++ setup.py | 2 +- 3 files changed, 9 insertions(+), 1 deletions(-) diffs (37 lines): diff -r 77206efaed5e -r 8c70bcb663b9 CHANGES.txt --- a/CHANGES.txt Tue Jan 12 10:36:02 2016 +1100 +++ b/CHANGES.txt Sat Feb 27 13:13:05 2016 +1100 @@ -4,6 +4,10 @@ hg log -rb2xx: > log.out However contributors are encouraged to add their own entries for their work. +Since build 220: +---------------- +* A null SPropTagArray will now return None instead of crashing. + Since build 219: ---------------- * win32com - sys.argv[0] may be set to a bytes object instead of a string on diff -r 77206efaed5e -r 8c70bcb663b9 com/win32comext/mapi/src/mapiutil.cpp --- a/com/win32comext/mapi/src/mapiutil.cpp Tue Jan 12 10:36:02 2016 +1100 +++ b/com/win32comext/mapi/src/mapiutil.cpp Sat Feb 27 13:13:05 2016 +1100 @@ -752,6 +752,10 @@ PyObject *PyMAPIObject_FromSPropTagArray(SPropTagArray *pta) { + if (!pta) { + Py_INCREF(Py_None); + return Py_None; + } PyObject *ret = PyTuple_New(pta->cValues); for (ULONG i=0;i<pta->cValues;i++) { PyTuple_SET_ITEM(ret, i, PyLong_FromUnsignedLong(pta->aulPropTag[i])); diff -r 77206efaed5e -r 8c70bcb663b9 setup.py --- a/setup.py Tue Jan 12 10:36:02 2016 +1100 +++ b/setup.py Sat Feb 27 13:13:05 2016 +1100 @@ -1,4 +1,4 @@ -build_id="220" # may optionally include a ".{patchno}" suffix. +build_id="220.1" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) __doc__="""This is a distutils setup-script for the pywin32 extensions |
From: <pyw...@li...> - 2016-01-11 23:36:18
|
changeset 6d095bc9788e in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=6d095bc9788e summary: add more changes since build 219 changeset 0881d310bb60 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=0881d310bb60 summary: fix issue that caused postinstall log to not be shown and remove outdated MFC warnings changeset 3b52e797727d in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=3b52e797727d summary: more build fixes changeset f30ccd8f8f38 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=f30ccd8f8f38 summary: Build 220 changeset 77206efaed5e in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=77206efaed5e summary: Added tag b220 for changeset f30ccd8f8f38 diffstat: .hgtags | 1 + CHANGES.txt | 17 +++++++++++++++++ make_all.bat | 16 ++++++++++++---- pywin32_postinstall.py | 33 +++++++-------------------------- setup.py | 2 +- 5 files changed, 38 insertions(+), 31 deletions(-) diffs (127 lines): diff -r 06de33e3604d -r 77206efaed5e .hgtags --- a/.hgtags Sun Jan 10 12:34:56 2016 +1100 +++ b/.hgtags Tue Jan 12 10:36:02 2016 +1100 @@ -52,3 +52,4 @@ e97376eb14b6d95e79e01e1bf68ef8427bcbafdc b218.3 2d79b6bd94bc145f7f5a6e1c63d626737fc98e6c 218.5 713ac73c22e54a9d727f2fa4803b8c8939b14966 b219 +f30ccd8f8f38d37a94b3a105dc357f28501f67ba b220 diff -r 06de33e3604d -r 77206efaed5e CHANGES.txt --- a/CHANGES.txt Sun Jan 10 12:34:56 2016 +1100 +++ b/CHANGES.txt Tue Jan 12 10:36:02 2016 +1100 @@ -5,12 +5,29 @@ However contributors are encouraged to add their own entries for their work. Since build 219: +---------------- * win32com - sys.argv[0] may be set to a bytes object instead of a string on Python 3 when implementing an in-process COM object. * Fix that allows a property to be fetched on COM objects to work in more cases (Fredrik Orderud via patch #155) +* Disabled exchange and exchdapi modules on Python 2.5 due to unresolved + build issues. + +* Fix potential crash in SHGetIDListFromObject and SHGetFileInfo issues (rupole) + +* Allow GetShortPathName to handle long paths in unicode mode (ruple) + +* Fix intermittent crash in win32cred.CredRead() (bug #670, rupole) + +* Support PT_MV_BINARY MAPI properties, (patch #37) and many other MAPI + improvements (Nick Czeczulin) + +* Fix username used with EvtOpenSession (bug #688, rupole) + +* Fix OutputDebugString encoding in wide builds (patch #142, rupole) + Since build 218: ---------------- * win32com.mapi diff -r 06de33e3604d -r 77206efaed5e make_all.bat --- a/make_all.bat Sun Jan 10 12:34:56 2016 +1100 +++ b/make_all.bat Tue Jan 12 10:36:02 2016 +1100 @@ -37,11 +37,19 @@ py -3.4-32 setup3.py -q bdist_wininst --target-version=3.4 --skip-build py -3.4-32 setup3.py -q bdist_wininst --target-version=3.4 --skip-build --plat-name=win-amd64 -py -3.5-32 setup3.py -q bdist_wininst --skip-build -py -3.5 setup3.py -q bdist_wininst --skip-build +rem *sob* - for some reason 3.5 and later are failing to remove the bdist temp dir +rem due to the mfc DLLs - but the dir can be removed manually. +rem I've excluded the possibility of anti-virus or the indexer. +rem So manually nuke them before builds. +@if exist build\bdist.win32 rd /s/q build\bdist.win32 & @if exist build\bdist.amd64 rd /s/q build\bdist.amd64 +py -3.5-32 setup3.py -q bdist_wininst --target-version=3.5 --skip-build +@if exist build\bdist.win32 rd /s/q build\bdist.win32 & @if exist build\bdist.amd64 rd /s/q build\bdist.amd64 +py -3.5 setup3.py -q bdist_wininst --target-version=3.5 --skip-build --plat-name=win-amd64 -py -3.6-32 setup3.py -q bdist_wininst --skip-build -py -3.6 setup3.py -q bdist_wininst --skip-build +@if exist build\bdist.win32 rd /s/q build\bdist.win32 & @if exist build\bdist.amd64 rd /s/q build\bdist.amd64 +py -3.6-32 setup3.py -q bdist_wininst --target-version=3.6 --skip-build +@if exist build\bdist.win32 rd /s/q build\bdist.win32 & @if exist build\bdist.amd64 rd /s/q build\bdist.amd64 +py -3.6 setup3.py -q bdist_wininst --target-version=3.6 --skip-build --plat-name=win-amd64 rem And nuke the dirs one more time :) if exist build/bdist.win32/. rm -rf build/bdist.win32 diff -r 06de33e3604d -r 77206efaed5e pywin32_postinstall.py --- a/pywin32_postinstall.py Sun Jan 10 12:34:56 2016 +1100 +++ b/pywin32_postinstall.py Tue Jan 12 10:36:02 2016 +1100 @@ -26,6 +26,13 @@ pass tee_f.flush() +# For some unknown reason, when running under bdist_wininst we will start up +# with sys.stdout as None but stderr is hooked up. This work-around allows +# bdist_wininst to see the output we write and display it at the end of +# the install. +if sys.stdout is None: + sys.stdout = sys.stderr + sys.stderr = Tee(sys.stderr) sys.stdout = Tee(sys.stdout) @@ -448,32 +455,6 @@ except Exception, details: print details - # Check the MFC dll exists - it is doesn't, point them at it - # (I should install it, but its a bit tricky with distutils) - # Unfortunately, this is quite likely on Windows XP and MFC71.dll - if sys.hexversion < 0x2060000: - mfc_dll = "mfc71.dll" - elif sys.hexversion < 0x2070000: - mfc_dll = "mfc90.dll" - elif sys.hexversion < 0x3000000: - mfc_dll = "mfc90u.dll" - else: - mfc_dll = "mfc100u.dll" - try: - # It might be next to pythonwin itself (which is where setup.py - # currently arranges for it to be installed...) - if not os.path.isfile(os.path.join(lib_dir, "pythonwin", mfc_dll)): - win32api.SearchPath(None, mfc_dll) - except win32api.error: - print "*" * 20, "WARNING", "*" * 20 - print "It appears that the MFC DLL '%s' is not installed" % (mfc_dll,) - print "Pythonwin will not work without this DLL, and I haven't had the" - print "time to package it in with the installer." - print - print "You can download this DLL from:" - print "http://starship.python.net/crew/mhammond/win32/" - print "*" * 50 - # importing win32com.client ensures the gen_py dir created - not strictly # necessary to do now, but this makes the installation "complete" try: diff -r 06de33e3604d -r 77206efaed5e setup.py --- a/setup.py Sun Jan 10 12:34:56 2016 +1100 +++ b/setup.py Tue Jan 12 10:36:02 2016 +1100 @@ -1,4 +1,4 @@ -build_id="219.5" # may optionally include a ".{patchno}" suffix. +build_id="220" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) __doc__="""This is a distutils setup-script for the pywin32 extensions |
From: <pyw...@li...> - 2016-01-10 07:46:09
|
changeset f493b5fa45a8 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=f493b5fa45a8 summary: fix tp_compare/tp_as_async slot on py3k changeset 0c31e8c1039c in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=0c31e8c1039c summary: get things building with vs2015 and other changes introduced in 3.5 changeset aeed1c9d4bf9 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=aeed1c9d4bf9 summary: Fix that allows a property to be fetched on COM objects to work in more cases changeset 9eaa93a263fa in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=9eaa93a263fa summary: get pythonwin building with vs2015 changeset 06de33e3604d in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=06de33e3604d summary: more build tweaks (use py.exe in more places; build 3.6) diffstat: AutoDuck/common_top.mak | 2 +- CHANGES.txt | 3 +++ Pythonwin/stdafx.h | 4 ++++ Pythonwin/stdafxdde.h | 2 ++ Pythonwin/stdafxole.h | 2 ++ Pythonwin/stdafxpw.h | 1 + build_all.bat | 4 ++++ com/win32com/client/dynamic.py | 11 ++++++++--- make_all.bat | 11 +++++++---- setup.py | 25 ++++++++++++++++++++----- win32/src/win32wnet/PyNetresource.cpp | 4 ++++ 11 files changed, 56 insertions(+), 13 deletions(-) diffs (213 lines): diff -r 835a071ad7bf -r 06de33e3604d AutoDuck/common_top.mak --- a/AutoDuck/common_top.mak Mon Aug 24 18:56:44 2015 +1000 +++ b/AutoDuck/common_top.mak Sun Jan 10 12:34:56 2016 +1100 @@ -10,5 +10,5 @@ ADTAB = 8 HC = hcw /a /c /e HHC = hhc -PYTHON = python +PYTHON = py -2.7 diff -r 835a071ad7bf -r 06de33e3604d CHANGES.txt --- a/CHANGES.txt Mon Aug 24 18:56:44 2015 +1000 +++ b/CHANGES.txt Sun Jan 10 12:34:56 2016 +1100 @@ -8,6 +8,9 @@ * win32com - sys.argv[0] may be set to a bytes object instead of a string on Python 3 when implementing an in-process COM object. +* Fix that allows a property to be fetched on COM objects to work in more cases + (Fredrik Orderud via patch #155) + Since build 218: ---------------- * win32com.mapi diff -r 835a071ad7bf -r 06de33e3604d Pythonwin/stdafx.h --- a/Pythonwin/stdafx.h Mon Aug 24 18:56:44 2015 +1000 +++ b/Pythonwin/stdafx.h Sun Jan 10 12:34:56 2016 +1100 @@ -11,6 +11,10 @@ #define WINVER 0x0600 #endif +#define _USING_V110_SDK71_ +// MFC support for mbcs is going away, but no need for us to constantly be told... +#define NO_WARN_MBCS_MFC_DEPRECATION + #include <afxwin.h> // MFC core and standard components #if (_MFC_VER < 0x0600) diff -r 835a071ad7bf -r 06de33e3604d Pythonwin/stdafxdde.h --- a/Pythonwin/stdafxdde.h Mon Aug 24 18:56:44 2015 +1000 +++ b/Pythonwin/stdafxdde.h Sun Jan 10 12:34:56 2016 +1100 @@ -1,3 +1,5 @@ +#define _USING_V110_SDK71_ + #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions #include <afxmt.h> // Thread safety! diff -r 835a071ad7bf -r 06de33e3604d Pythonwin/stdafxole.h --- a/Pythonwin/stdafxole.h Mon Aug 24 18:56:44 2015 +1000 +++ b/Pythonwin/stdafxole.h Sun Jan 10 12:34:56 2016 +1100 @@ -5,6 +5,8 @@ #define WIN32_LEAN_AND_MEAN +#define _USING_V110_SDK71_ + #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions #include <afxcmn.h> // common controls. diff -r 835a071ad7bf -r 06de33e3604d Pythonwin/stdafxpw.h --- a/Pythonwin/stdafxpw.h Mon Aug 24 18:56:44 2015 +1000 +++ b/Pythonwin/stdafxpw.h Sun Jan 10 12:34:56 2016 +1100 @@ -4,6 +4,7 @@ // #define HIER_LIST #define WIN32_LEAN_AND_MEAN +#define _USING_V110_SDK71_ #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions diff -r 835a071ad7bf -r 06de33e3604d build_all.bat --- a/build_all.bat Mon Aug 24 18:56:44 2015 +1000 +++ b/build_all.bat Sun Jan 10 12:34:56 2016 +1100 @@ -34,6 +34,10 @@ @if errorlevel 1 goto failed py -3.5 setup3.py -q build @if errorlevel 1 goto failed +py -3.6-32 setup3.py -q build +@if errorlevel 1 goto failed +py -3.6 setup3.py -q build +@if errorlevel 1 goto failed goto xit :failed diff -r 835a071ad7bf -r 06de33e3604d com/win32com/client/dynamic.py --- a/com/win32com/client/dynamic.py Mon Aug 24 18:56:44 2015 +1000 +++ b/com/win32com/client/dynamic.py Sun Jan 10 12:34:56 2016 +1100 @@ -113,9 +113,14 @@ userName = str(userName) return (_GetGoodDispatch(IDispatch, clsctx), userName) -def _GetDescInvokeType(entry, default_invoke_type): - if not entry or not entry.desc: return default_invoke_type - return entry.desc[4] +def _GetDescInvokeType(entry, invoke_type): + # determine the wFlags argument passed as input to IDispatch::Invoke + if not entry or not entry.desc: return invoke_type + varkind = entry.desc[4] # from VARDESC struct returned by ITypeComp::Bind + if varkind == pythoncom.VAR_DISPATCH and invoke_type == pythoncom.INVOKE_PROPERTYGET: + return pythoncom.INVOKE_FUNC | invoke_type # DISPATCH_METHOD & DISPATCH_PROPERTYGET can be combined in IDispatch::Invoke + else: + return invoke_type def Dispatch(IDispatch, userName = None, createClass = None, typeinfo = None, UnicodeToString=None, clsctx = pythoncom.CLSCTX_SERVER): assert UnicodeToString is None, "this is deprecated and will go away" diff -r 835a071ad7bf -r 06de33e3604d make_all.bat --- a/make_all.bat Mon Aug 24 18:56:44 2015 +1000 +++ b/make_all.bat Sun Jan 10 12:34:56 2016 +1100 @@ -2,12 +2,12 @@ @if "%1"=="already_built" goto already_built if exist build\. rm -rf build if exist build\. goto couldnt_rm +:quick +call build_all.bat cd autoduck call make.bat @if errorlevel 1 goto failed cd .. -:quick -call build_all.bat :already_built rem Now the binaries. @@ -37,8 +37,11 @@ py -3.4-32 setup3.py -q bdist_wininst --target-version=3.4 --skip-build py -3.4-32 setup3.py -q bdist_wininst --target-version=3.4 --skip-build --plat-name=win-amd64 -py -3.5-32 setup3.py -q bdist_wininst --target-version=3.5 --skip-build -py -3.5-32 setup3.py -q bdist_wininst --target-version=3.5 --skip-build --plat-name=win-amd64 +py -3.5-32 setup3.py -q bdist_wininst --skip-build +py -3.5 setup3.py -q bdist_wininst --skip-build + +py -3.6-32 setup3.py -q bdist_wininst --skip-build +py -3.6 setup3.py -q bdist_wininst --skip-build rem And nuke the dirs one more time :) if exist build/bdist.win32/. rm -rf build/bdist.win32 diff -r 835a071ad7bf -r 06de33e3604d setup.py --- a/setup.py Mon Aug 24 18:56:44 2015 +1000 +++ b/setup.py Sun Jan 10 12:34:56 2016 +1100 @@ -107,11 +107,18 @@ from distutils.dep_util import newer_group, newer from distutils import dir_util, file_util -from distutils.sysconfig import get_python_lib +from distutils.sysconfig import get_python_lib, get_config_vars from distutils.filelist import FileList from distutils.errors import DistutilsExecError import distutils.util +# prevent the new in 3.5 suffix of "cpXX-win32" from being added. +# (adjusting both .cp35-win_amd64.pyd and .cp35-win32.pyd to .pyd) +try: + get_config_vars()["EXT_SUFFIX"] = re.sub("\\.cp\d\d-win((32)|(_amd64))", "", get_config_vars()["EXT_SUFFIX"]) +except KeyError: + pass # no EXT_SUFFIX in this build. + build_id_patch = build_id if not "." in build_id_patch: build_id_patch = build_id_patch + ".0" @@ -803,8 +810,10 @@ # 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']: + if self.plat_name == 'win-amd64' and ext.name in ['exchdapi', 'exchange']: return "No 64-bit library for utility functions available." + if get_build_version() >=14 and ext.name in ['exchdapi', 'exchange']: + return "Haven't worked out how to make exchange modules build on vs2015" include_dirs = self.compiler.include_dirs + \ os.environ.get("INCLUDE", "").split(os.pathsep) if self.windows_h_version is None: @@ -1037,17 +1046,23 @@ raise RuntimeError("Can't find %r" % (src,)) self.copy_file(src, target_dir) else: - # vs2008 or vs2010 + plat_dir_64 = "x64" + # 2.6, 2.7, 3.0, 3.1 and 3.2 all use(d) vs2008 (compiler version 1500) if sys.hexversion < 0x3030000: product_key = r"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC" plat_dir_64 = "amd64" mfc_dir = "Microsoft.VC90.MFC" mfc_files = "mfc90.dll mfc90u.dll mfcm90.dll mfcm90u.dll Microsoft.VC90.MFC.manifest".split() - else: + # 3.3 and 3.4 use(d) vs2010 (compiler version 1600, crt=10) + elif sys.hexversion < 0x3050000: product_key = r"SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VC" - plat_dir_64 = "x64" mfc_dir = "Microsoft.VC100.MFC" mfc_files = ["mfc100u.dll", "mfcm100u.dll"] + # 3.5 and later on vs2015 (compiler version 1900, crt=14) + else: + product_key = r"SOFTWARE\Microsoft\VisualStudio\14.0\Setup\VC" + mfc_dir = "Microsoft.VC140.MFC" + mfc_files = ["mfc140u.dll", "mfcm140u.dll"] # On a 64bit host, the value we are looking for is actually in # SysWow64Node - but that is only available on xp and later. diff -r 835a071ad7bf -r 06de33e3604d win32/src/win32wnet/PyNetresource.cpp --- a/win32/src/win32wnet/PyNetresource.cpp Mon Aug 24 18:56:44 2015 +1000 +++ b/win32/src/win32wnet/PyNetresource.cpp Sun Jan 10 12:34:56 2016 +1100 @@ -87,7 +87,11 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ +#if (PY_VERSION_HEX >= 0x03000000) + 0, /* tp_as_async */ +#else PyNETRESOURCE::compareFunc, /* tp_compare */ +#endif 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ |
From: Mark H. <mha...@sk...> - 2016-01-10 01:38:15
|
I'm hoping to get a new pywin32 out over the next few days - are there any changes anyone here would like to get in first? Thanks, Mark |
From: <pyw...@li...> - 2015-08-24 09:05:56
|
changeset 055bbedd423c in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=055bbedd423c summary: py3 fixes for mapi.OpenStreamOnFile changeset f04eba3e2adb in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=f04eba3e2adb summary: Add mapi.HrGetOneProp and mapi.HrSetOneProp changeset 508bd990fe01 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=508bd990fe01 summary: Add PyIMAPIFolder::DeleteFolder() changeset 79f05b2f4a2e in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=79f05b2f4a2e summary: Issue 148: add typemap for ULONG_PTR changeset 835a071ad7bf in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=835a071ad7bf summary: Issue 139 - reload comes from the imp module on py3k diffstat: SWIG/swig_lib/python/pywintypes.i | 43 +++++++++ com/win32com/client/gencache.py | 4 + com/win32comext/mapi/src/PyIMAPIFolder.i | 47 ++++++++++ com/win32comext/mapi/src/mapi.i | 138 +++++++++++++++++++++++++++++- win32/src/PyUnicode.cpp | 5 +- 5 files changed, 228 insertions(+), 9 deletions(-) diffs (truncated from 320 to 300 lines): diff -r 575a76a7789b -r 835a071ad7bf SWIG/swig_lib/python/pywintypes.i --- a/SWIG/swig_lib/python/pywintypes.i Wed May 20 17:31:53 2015 +1000 +++ b/SWIG/swig_lib/python/pywintypes.i Mon Aug 24 18:56:44 2015 +1000 @@ -480,6 +480,49 @@ } } +//-------------------------------------------------------------------------- +// +// ULONG_PTR +// +//-------------------------------------------------------------------------- +%typemap(python, in) ULONG_PTR +{ + if (!PyWinLong_AsULONG_PTR($source, &$target)) + return NULL; +} +%typemap(python, in) ULONG_PTR * (ULONG_PTR temp) +{ + $target = &temp; + if (!PyWinLong_AsULONG_PTR($source, $target)) + return NULL; +} +%typemap(python, ignore) ULONG_PTR *OUTPUT(ULONG_PTR temp) +{ + $target = &temp; +} +%typemap(python, out) ULONG_PTR +{ + $target = PyWinObject_FromULONG_PTR($source) +} +%typemap(python,argout) ULONG_PTR *OUTPUT { + PyObject *o; + o = PyWinObject_FromULONG_PTR(*$source); + if (!$target) { + $target = o; + } else if ($target == Py_None) { + Py_DECREF(Py_None); + $target = o; + } else { + if (!PyList_Check($target)) { + PyObject *o2 = $target; + $target = PyList_New(0); + PyList_Append($target,o2); + Py_XDECREF(o2); + } + PyList_Append($target,o); + Py_XDECREF(o); + } +} //--------------------------------------------------------------------------- // diff -r 575a76a7789b -r 835a071ad7bf com/win32com/client/gencache.py --- a/com/win32com/client/gencache.py Wed May 20 17:31:53 2015 +1000 +++ b/com/win32com/client/gencache.py Mon Aug 24 18:56:44 2015 +1000 @@ -27,6 +27,10 @@ import traceback import CLSIDToClass import operator +try: + from imp import reload # exported by the imp module in py3k. +except: + pass # a builtin on py2k. bForDemandDefault = 0 # Default value of bForDemand - toggle this to change the world - see also makepy.py diff -r 575a76a7789b -r 835a071ad7bf com/win32comext/mapi/src/PyIMAPIFolder.i --- a/com/win32comext/mapi/src/PyIMAPIFolder.i Wed May 20 17:31:53 2015 +1000 +++ b/com/win32comext/mapi/src/PyIMAPIFolder.i Mon Aug 24 18:56:44 2015 +1000 @@ -64,6 +64,53 @@ // @flag MESSAGE_DIALOG |Displays a progress indicator as the operation proceeds. // @flag MESSAGE_MOVE|The message or messages are to be moved rather than copied. If MESSAGE_MOVE is not set, the messages are copied. +// @pyswig |DeleteFolder|Deletes a subfolder. +%native(DeleteFolder) DeleteFolder; +%{ +PyObject *PyIMAPIFolder::DeleteFolder(PyObject *self, PyObject *args) +{ + HRESULT hRes; + PyObject *obEntryId, *obUIParam, *obProgress; + ULONG cbEID; + LPENTRYID eid; + ULONG_PTR ulUIParam; + LPMAPIPROGRESS lpProgress; + ULONG flags = 0; + + IMAPIFolder *_swig_self; + if ((_swig_self=GetI(self))==NULL) return NULL; + + 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 <o PyIMAPIProgress>|progress||A progress object, or None + &flags)) + return NULL; + if PyString_Check(obEntryId) { + eid = (LPENTRYID)PyString_AsString(obEntryId); + cbEID = PyString_Size(obEntryId); + } else { + PyErr_SetString(PyExc_TypeError, "EntryID must be a string"); + return NULL; + } + if (!PyWinLong_AsULONG_PTR(obUIParam, &ulUIParam)) + return NULL; + if (!PyCom_InterfaceFromPyInstanceOrObject(obProgress, IID_IMAPIProgress, (void **)&lpProgress, TRUE)) + return NULL; + + PY_INTERFACE_PRECALL; + hRes = (HRESULT)_swig_self->DeleteFolder(cbEID, eid, ulUIParam, lpProgress, flags); + PY_INTERFACE_POSTCALL; + + if (lpProgress) + lpProgress->Release(); + + if (FAILED(hRes)) + return OleSetOleError(hRes); + + return Py_BuildValue("i", hRes); +} +%} // @pyswig |DeleteMessages|Deletes the specified messages. HRESULT DeleteMessages( diff -r 575a76a7789b -r 835a071ad7bf com/win32comext/mapi/src/mapi.i --- a/com/win32comext/mapi/src/mapi.i Wed May 20 17:31:53 2015 +1000 +++ b/com/win32comext/mapi/src/mapi.i Mon Aug 24 18:56:44 2015 +1000 @@ -241,6 +241,13 @@ #define RTF_SYNC_BODY_CHANGED RTF_SYNC_BODY_CHANGED // The plain text version of the message has changed. #define RTF_SYNC_RTF_CHANGED RTF_SYNC_RTF_CHANGED // The RTF version of the message has changed. +#define DEL_FOLDERS DEL_FOLDERS // All subfolders of the subfolder pointed to by lpEntryID should be deleted. +#define DEL_MESSAGES DEL_MESSAGES // All messages in the subfolder pointed to by lpEntryID should be deleted. +#define FOLDER_DIALOG FOLDER_DIALOG // A progress indicator should be displayed while the operation proceeds. +#define MESSAGE_DIALOG MESSAGE_DIALOG // Displays a progress indicator as the operation proceeds. +#define SHOW_SOFT_DELETES ((ULONG) 0x00000002) // Shows items that are currently marked as soft deleted. +#define DELETE_HARD_DELETE ((ULONG) 0x00000010) // Permanently removes all messages, including soft-deleted ones. + #define MAPI_CREATE MAPI_CREATE // The object will be created if necessary. #define MAPI_E_CALL_FAILED MAPI_E_CALL_FAILED #define MAPI_E_NOT_ENOUGH_MEMORY MAPI_E_NOT_ENOUGH_MEMORY @@ -468,6 +475,9 @@ #define CCSF_EMBEDDED_MESSAGE CCSF_EMBEDDED_MESSAGE // sent/unsent information is persisted in X-Unsent #define CCSF_PRESERVE_SOURCE CCSF_PRESERVE_SOURCE // don't modify the source message +// StreamOnFile (SOF) +#define SOF_UNIQUEFILENAME SOF_UNIQUEFILENAME // A temporary file is to be created for the IStream object + // @object MAPIINIT_0|A MAPIINIT_0 is represented as a tuple of: // @tupleitem 0|int|version|This must be MAPI_INIT_VERSION. // @tupleitem 1|int|flags|MAPI initlization flags. @@ -795,32 +805,144 @@ %} %native(RTFStreamToHTML) MyRTFStreamToHTML; - +// @pyswig <o PyIStream>|OpenStreamOnFile|Allocates and initializes an OLE IStream object to access the contents of a file. +%native(OpenStreamOnFile) PyOpenStreamOnFile; %{ PyObject *PyOpenStreamOnFile(PyObject *self, PyObject *args) { HRESULT hRes; unsigned long flags = 0; IStream *pStream; - PyObject *obFilepath; + PyObject *obFileName; + char *filename = NULL; + PyObject *obPrefix = Py_None; + char *prefix = NULL; - if (!PyArg_ParseTuple(args, "O|l:OpenStreamOnFile", &obFilepath, &flags)) + if (!PyArg_ParseTuple(args, "O|lO:OpenStreamOnFile", + &obFileName, // @pyparm string|filename|| + &flags, // @pyparm int|flags|0| + &obPrefix)) // @pyparm string|prefix|None| return NULL; - TCHAR *filepath; - if (!PyWinObject_AsTCHAR(obFilepath, &filepath, FALSE)) - return NULL; + if (!PyWinObject_AsString(obFileName, &filename, TRUE)) + goto done; + + if (!PyWinObject_AsString(obPrefix, &prefix, TRUE)) + goto done; PY_INTERFACE_PRECALL; - hRes = OpenStreamOnFile(MAPIAllocateBuffer, MAPIFreeBuffer, flags, filepath, NULL, &pStream); + // mapiutil.h incorrectly declares OpenStreamOnFile taking type LPTSTR + hRes = OpenStreamOnFile(MAPIAllocateBuffer, MAPIFreeBuffer, flags, (LPTSTR)filename, (LPTSTR)prefix, &pStream); PY_INTERFACE_POSTCALL; + done: + PyWinObject_FreeString(filename); + PyWinObject_FreeString(prefix); + + if (PyErr_Occurred()) + return NULL; + if (FAILED(hRes)) return OleSetOleError(hRes); return PyCom_PyObjectFromIUnknown(pStream, IID_IStream, FALSE); } %} -%native(OpenStreamOnFile) PyOpenStreamOnFile; +// @pyswig item|HrGetOneProp|Retrieves the value of a single property from an IMAPIProp object. +%native(HrGetOneProp) PyHrGetOneProp; +%{ +PyObject *PyHrGetOneProp(PyObject *self, PyObject *args) +{ + HRESULT hRes; + PyObject *obProp; + ULONG propTag; + IMAPIProp *pProp = NULL; + PyObject *ret = NULL; + SPropValue *pPV = NULL; + + if (!PyArg_ParseTuple(args, "Ok:HrGetOneProp", + &obProp, // @pyparm <o PyIMAPIProp>|prop||Object to retrieve property value from. + &propTag))// @pyparm ULONG|propTag||The property tag to open. + return NULL; + + if (!PyCom_InterfaceFromPyObject(obProp, IID_IMAPIProp, (void **)&pProp, FALSE)) + goto done; + + PY_INTERFACE_PRECALL; + hRes = HrGetOneProp(pProp, propTag, &pPV); + PY_INTERFACE_POSTCALL; + if (FAILED(hRes)) + { + OleSetOleError(hRes); + goto done; + } + if ((ret = PyMAPIObject_FromSPropValue(pPV)) == NULL) + goto done; + + // PyMAPIObject_FromSPropValue does not raise an exception for types + // it cannot handle so that GetProps doesn't blow up. Since we are processing + // only a single item, we test for this condition, and raise an exception. + if (PyTuple_GET_ITEM(ret, 1) == Py_None && + PyLong_AsUnsignedLong(PyTuple_GET_ITEM(ret, 0)) != PT_NULL) + { + char buf[128]; + sprintf(buf, "Unsupported MAPI property type 0x%X", PROP_TYPE(pPV->ulPropTag)); + PyErr_SetString(PyExc_TypeError, buf); + Py_DECREF(ret); + ret = NULL; + } +done: + if (pProp) pProp->Release(); + MAPIFreeBuffer(pPV); + + return ret; +} +%} +// @pyswig item|HrSetOneProp|Sets the value of a single property on a IMAPIProp object. +%native(HrSetOneProp) PyHrSetOneProp; +%{ +PyObject *PyHrSetOneProp(PyObject *self, PyObject *args) +{ + HRESULT hRes; + PyObject *obProp; + PyObject *obPropValue; + ULONG propTag; + IMAPIProp *pProp = NULL; + PyObject *ret = NULL; + SPropValue *pPV = NULL; + + if (!PyArg_ParseTuple(args, "OO:HrSetOneProp", + &obProp, // @pyparm <o PyIMAPIProp>|prop||Object to set property value on. + &obPropValue))// @pyparm <o PySPropValue>|propValue||Property value to set. + return NULL; + + if (!PyCom_InterfaceFromPyObject(obProp, IID_IMAPIProp, (void **)&pProp, FALSE)) + goto done; + if (S_OK != (hRes=MAPIAllocateBuffer(sizeof(SPropValue), (void **)&pPV))) + { + OleSetOleError(hRes); + goto done; + } + if (!PyMAPIObject_AsSPropValue(obPropValue, pPV, pPV)) + goto done; + + PY_INTERFACE_PRECALL; + hRes = HrSetOneProp(pProp, pPV); + PY_INTERFACE_POSTCALL; + if (FAILED(hRes)) + { + OleSetOleError(hRes); + goto done; + } + Py_INCREF(Py_None); + ret = Py_None; +done: + if (pProp) pProp->Release(); + MAPIFreeBuffer(pPV); + |
From: <pyw...@li...> - 2015-05-20 07:32:25
|
changeset 575a76a7789b in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=575a76a7789b summary: Remove Python 2.2 compat hack as it cause Python 3.x compat issues! (bug 690) diffstat: com/win32comext/mapi/demos/mapisend.py | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diffs (14 lines): diff -r b06d711ff578 -r 575a76a7789b com/win32comext/mapi/demos/mapisend.py --- a/com/win32comext/mapi/demos/mapisend.py Wed May 20 17:06:03 2015 +1000 +++ b/com/win32comext/mapi/demos/mapisend.py Wed May 20 17:31:53 2015 +1000 @@ -9,10 +9,6 @@ from win32com.mapi import mapi from win32com.mapi import mapitags -# Pre 2.2.1 compat. -try: True, False -except NameError: True = 1==1; False = 1==0 - def SendEMAPIMail(Subject="", Message="", SendTo=None, SendCC=None, SendBCC=None, MAPIProfile=None): """Sends an email to the recipient using the extended MAPI interface Subject and Message are strings |
From: <pyw...@li...> - 2015-05-20 07:30:14
|
changeset 53d839a67e9e in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=53d839a67e9e summary: Ensure argv[0] is a string object in COM objects on py3k changeset b06d711ff578 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=b06d711ff578 summary: Update win32file.ReadFile docs to indicate bytes should be used instead of str on py3k (issue 695) diffstat: CHANGES.txt | 4 ++++ com/win32com/src/dllmain.cpp | 2 +- win32/src/win32file.i | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diffs (38 lines): diff -r b57d0d7444fb -r b06d711ff578 CHANGES.txt --- a/CHANGES.txt Mon Apr 13 12:53:59 2015 -0400 +++ b/CHANGES.txt Wed May 20 17:06:03 2015 +1000 @@ -4,6 +4,10 @@ hg log -rb2xx: > log.out However contributors are encouraged to add their own entries for their work. +Since build 219: +* win32com - sys.argv[0] may be set to a bytes object instead of a string on + Python 3 when implementing an in-process COM object. + Since build 218: ---------------- * win32com.mapi diff -r b57d0d7444fb -r b06d711ff578 com/win32com/src/dllmain.cpp --- a/com/win32com/src/dllmain.cpp Mon Apr 13 12:53:59 2015 -0400 +++ b/com/win32com/src/dllmain.cpp Wed May 20 17:06:03 2015 +1000 @@ -67,7 +67,7 @@ // Make sure we have _something_ as sys.argv. if (PySys_GetObject("argv")==NULL) { PyObject *path = PyList_New(0); - PyObject *str = PyString_FromString(""); + PyObject *str = PyWinCoreString_FromString(""); PyList_Append(path, str); PySys_SetObject("argv", path); Py_XDECREF(path); diff -r b57d0d7444fb -r b06d711ff578 win32/src/win32file.i --- a/win32/src/win32file.i Mon Apr 13 12:53:59 2015 -0400 +++ b/win32/src/win32file.i Wed May 20 17:06:03 2015 +1000 @@ -889,7 +889,7 @@ // @rdesc The result is a tuple of (hr, string/<o PyOVERLAPPEDReadBuffer>), where hr may be // 0, ERROR_MORE_DATA or ERROR_IO_PENDING. // If the overlapped param is not None, then the result is a <o PyOVERLAPPEDReadBuffer>. Once the overlapped IO operation -// has completed, you can convert this to a string (str(object))to obtain the data. +// has completed, you can convert this to a string (str(object)) [py2k] or (bytes(object)) [py3k] to obtain the data. // While the operation is in progress, you can use the slice operations (object[:end]) to // obtain the data read so far. // You must use the OVERLAPPED API functions to determine how much of the data is valid. |
From: <pyw...@li...> - 2015-04-13 16:54:48
|
changeset b57d0d7444fb in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=b57d0d7444fb summary: Release thread lock in transacted operations diffstat: win32/src/win32file.i | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diffs (49 lines): diff -r 4e527a8f8266 -r b57d0d7444fb win32/src/win32file.i --- a/win32/src/win32file.i Mon Apr 13 10:43:40 2015 -0400 +++ b/win32/src/win32file.i Mon Apr 13 12:53:59 2015 -0400 @@ -4542,12 +4542,14 @@ if (!PyWinObject_AsWCHAR(obfilename, &filename, FALSE)) return NULL; + Py_BEGIN_ALLOW_THREADS if (htransaction) hret=(*pfnCreateFileTransacted)(filename, desiredaccess, sharemode, psa, creationdisposition, flags, htemplate, htransaction, pminiversion, extendedparameter); else hret=CreateFileW(filename, desiredaccess, sharemode, psa, creationdisposition, flags, htemplate); + Py_END_ALLOW_THREADS PyWinObject_FreeWCHAR(filename); if (hret==INVALID_HANDLE_VALUE) @@ -4580,10 +4582,13 @@ return NULL; BOOL ret; + Py_BEGIN_ALLOW_THREADS if (htransaction) ret=(*pfnDeleteFileTransacted)(filename, htransaction); else ret=DeleteFileW(filename); + Py_END_ALLOW_THREADS + PyWinObject_FreeWCHAR(filename); if (!ret) return PyWin_SetAPIError("DeleteFileW"); @@ -4698,6 +4703,8 @@ PyErr_Format(PyExc_MemoryError, "Unable to allocate %d bytes", bufsize); goto done; } + + Py_BEGIN_ALLOW_THREADS // MSDN docs say this returns a DWORD containing the attributes, but it actually acts as a boolean if (htrans){ if (bUnicode) @@ -4711,6 +4718,7 @@ else ok=GetFileAttributesExA(cname, lvl, buf); } + Py_END_ALLOW_THREADS if (!ok) PyWin_SetAPIError("GetFileAttributesEx"); |
From: <pyw...@li...> - 2015-04-13 14:45:32
|
changeset c13cc925af27 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=c13cc925af27 summary: Use exception attributes in axscript error handling (patch #141) changeset 4e527a8f8266 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=4e527a8f8266 summary: Don't encode message passed to OutputDebugString (patch #142) diffstat: com/win32comext/axscript/client/error.py | 6 +++--- com/win32comext/axscript/client/framework.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diffs (41 lines): diff -r 36371c35cf59 -r 4e527a8f8266 com/win32comext/axscript/client/error.py --- a/com/win32comext/axscript/client/error.py Fri Apr 10 07:00:52 2015 -0400 +++ b/com/win32comext/axscript/client/error.py Mon Apr 13 10:43:40 2015 -0400 @@ -157,9 +157,9 @@ bits = ['Traceback (most recent call last):\n'] bits.extend(traceback.format_list(format_items)) if exc_type==pythoncom.com_error: - desc = "%s (0x%x)" % (value[1], value[0]) - if value[0]==winerror.DISP_E_EXCEPTION and value[2] and value[2][2]: - desc = value[2][2] + desc = "%s (0x%x)" % (value.strerror, value.hresult) + if value.hresult==winerror.DISP_E_EXCEPTION and value.excepinfo and value.excepinfo[2]: + desc = value.excepinfo[2] bits.append("COM Error: "+desc) else: bits.extend(traceback.format_exception_only(exc_type, value)) diff -r 36371c35cf59 -r 4e527a8f8266 com/win32comext/axscript/client/framework.py --- a/com/win32comext/axscript/client/framework.py Fri Apr 10 07:00:52 2015 -0400 +++ b/com/win32comext/axscript/client/framework.py Mon Apr 13 10:43:40 2015 -0400 @@ -61,7 +61,7 @@ try: self.redir.write(message) except: - win32api.OutputDebugString(message.encode('mbcs')) + win32api.OutputDebugString(message) def flush(self): pass def close(self): @@ -941,10 +941,10 @@ exc_traceback = None raise # It could be an error by another script. - if issubclass(pythoncom.com_error, exc_type) and exc_value[0]==axscript.SCRIPT_E_REPORTED: + if issubclass(pythoncom.com_error, exc_type) and exc_value.hresult==axscript.SCRIPT_E_REPORTED: # Ensure the traceback doesnt cause a cycle. exc_traceback = None - raise Exception(scode=exc_value[0]) + raise Exception(scode=exc_value.hresult) exception = error.AXScriptException(self, \ codeBlock, exc_type, exc_value, exc_traceback) |
From: <pyw...@li...> - 2015-04-10 11:01:00
|
changeset 36371c35cf59 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=36371c35cf59 summary: Fix error handling in debug (patch #140) diffstat: win32/Lib/win32serviceutil.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 955b7db466fe -r 36371c35cf59 win32/Lib/win32serviceutil.py --- a/win32/Lib/win32serviceutil.py Mon Apr 06 01:36:12 2015 -0400 +++ b/win32/Lib/win32serviceutil.py Fri Apr 10 07:00:52 2015 -0400 @@ -619,7 +619,7 @@ try: exeName = LocateSpecificServiceExe(serviceName) except win32api.error, exc: - if exc[0] == winerror.ERROR_FILE_NOT_FOUND: + if exc.winerror == winerror.ERROR_FILE_NOT_FOUND: print "The service does not appear to be installed." print "Please install the service before debugging it." sys.exit(1) |
From: <pyw...@li...> - 2015-04-06 05:37:30
|
changeset 955b7db466fe in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=955b7db466fe summary: Add buffer size parameter for ReadEventLog (patch #143 from cristi fati) diffstat: win32/src/win32evtlog.i | 35 ++++++++++++++++++++++++----------- 1 files changed, 24 insertions(+), 11 deletions(-) diffs (60 lines): diff -r f89c0a9724ca -r 955b7db466fe win32/src/win32evtlog.i --- a/win32/src/win32evtlog.i Sun Apr 05 23:21:50 2015 -0400 +++ b/win32/src/win32evtlog.i Mon Apr 06 01:36:12 2015 -0400 @@ -286,10 +286,9 @@ return ret; } -PyObject *MyReadEventLog( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset) +PyObject *_MyReadEventLog(HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset, DWORD nNumberOfBytesToRead) { - DWORD needed, read; - needed = 1024; + DWORD needed = nNumberOfBytesToRead, read; BYTE *buf; BOOL ok; while (1) { @@ -324,6 +323,27 @@ return ret; } +#define EVTLOG_READ_BUF_LEN_MAX 0x7ffff +#define EVTLOG_READ_BUF_LEN_DEFAULT 0x1000 + +// @pyswig [object,...]|ReadEventLog|Reads some event log records. +// @rdesc If there are no event log records available, then an empty list is returned. +PyObject *MyReadEventLog(PyObject *self, PyObject *args) { + HANDLE hEventLog = INVALID_HANDLE_VALUE; + DWORD dwReadFlags, dwRecordOffset, nNumberOfBytesToRead = EVTLOG_READ_BUF_LEN_DEFAULT; + if (!PyArg_ParseTuple(args, "O&kk|k:ReadEventLog", + PyWinObject_AsHANDLE, &hEventLog, // @pyparm <o Py_HANDLE>|Handle||Handle to a an opened event log (see <om win32evtlog.OpenEventLog>) + &dwReadFlags, // @pyparm int|Flags||Reading flags + &dwRecordOffset, // @pyparm int|Offset||Record offset to read (in SEEK mode). + &nNumberOfBytesToRead)) // @pyparm int|Size|4096|Output buffer size. + return NULL; + if (nNumberOfBytesToRead == 0) + nNumberOfBytesToRead = EVTLOG_READ_BUF_LEN_DEFAULT; + if (nNumberOfBytesToRead > EVTLOG_READ_BUF_LEN_MAX) + nNumberOfBytesToRead = EVTLOG_READ_BUF_LEN_MAX; + return _MyReadEventLog(hEventLog, dwReadFlags, dwRecordOffset, nNumberOfBytesToRead); +} + PyObject * MyReportEvent( HANDLE hEventLog, WORD wType, // event type to log WORD wCategory, // event category @@ -454,14 +474,7 @@ WCHAR *fileName // @pyparm <o PyUnicode>|fileName||The filename to open ); -// @pyswig [object,...]|ReadEventLog|Reads some event log records. -// @rdesc If there are no event log records available, then an empty list is returned. -%name (ReadEventLog) PyObject *MyReadEventLog ( - HANDLE hEventLog, // @pyparm int|handle||The handle of the event log to read. - DWORD dwReadFlags, // @pyparm int|flags||The read flags - DWORD dwRecordOffset // @pyparm int|offset||The offset - ); - +%native (ReadEventLog) MyReadEventLog; // @pyswig |ReportEvent|Reports an event %name (ReportEvent) PyObject *MyReportEvent ( |
From: <pyw...@li...> - 2015-04-06 03:22:25
|
changeset f89c0a9724ca in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=f89c0a9724ca summary: Fix username used with EvtOpenSession (bug #688) diffstat: win32/src/win32evtlog.i | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 4b18a16ce1d7 -r f89c0a9724ca win32/src/win32evtlog.i --- a/win32/src/win32evtlog.i Sun Apr 05 14:00:58 2015 -0400 +++ b/win32/src/win32evtlog.i Sun Apr 05 23:21:50 2015 -0400 @@ -1177,7 +1177,7 @@ return FALSE; } PyObject *observer, *obuser=Py_None, *obdomain=Py_None, *obpassword=Py_None; - if (!PyArg_ParseTuple(ob, "O|OOOk", &observer, *obuser, &obdomain, &obpassword, &erl->Flags)) + if (!PyArg_ParseTuple(ob, "O|OOOk", &observer, &obuser, &obdomain, &obpassword, &erl->Flags)) return FALSE; if (PyWinObject_AsWCHAR(observer, &erl->Server, FALSE) && PyWinObject_AsWCHAR(obuser, &erl->User, TRUE) && |
From: <pyw...@li...> - 2015-04-05 18:02:18
|
changeset 4b18a16ce1d7 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=4b18a16ce1d7 summary: Fix using PIDL with SHGetFileInfo (bug #687); misc type issues diffstat: com/win32comext/shell/src/shell.cpp | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diffs (46 lines): diff -r b81227a0b147 -r 4b18a16ce1d7 com/win32comext/shell/src/shell.cpp --- a/com/win32comext/shell/src/shell.cpp Mon Jan 05 16:19:06 2015 +1100 +++ b/com/win32comext/shell/src/shell.cpp Sun Apr 05 14:00:58 2015 -0400 @@ -852,9 +852,10 @@ Py_INCREF(Py_None); return Py_None; } + PyObject *obhIcon = PyWinLong_FromHANDLE(p->hIcon); PyObject *obDisplayName = PyWinObject_FromTCHAR(p->szDisplayName); PyObject *obTypeName = PyWinObject_FromTCHAR(p->szTypeName); - return Py_BuildValue("iiiNN", p->hIcon, p->iIcon, p->dwAttributes, + return Py_BuildValue("NikNN", obhIcon, p->iIcon, p->dwAttributes, obDisplayName, obTypeName); } @@ -1310,9 +1311,10 @@ TCHAR *name = NULL; LPITEMIDLIST pidl = NULL; TCHAR *pidl_or_name; - int attr, flags, info_attrs=0; + UINT flags; + DWORD attr, info_attrs=0; BOOL ok; - if (!PyArg_ParseTuple(args, "Oii|i", + if (!PyArg_ParseTuple(args, "OkI|k", &obName, // @pyparm string/<o PyIDL>|name||The path and file name. Both absolute // and relative paths are valid. // <nl>If the uFlags parameter includes the SHGFI_PIDL flag, this parameter @@ -1327,7 +1329,7 @@ // in dwFileAttributes. // <nl>This string can use either short (the 8.3 form) or long file names. &attr, // @pyparm int|dwFileAttributes||Combination of one or more file attribute flags (FILE_ATTRIBUTE_ values). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. - &flags, // @pyparm int|uFlags||Flags that specify the file information to retrieve. See MSDN for details + &flags, // @pyparm int|uFlags||Combination of shellcon.SHGFI_* flags that specify the file information to retrieve. See MSDN for details &info_attrs)) // @pyparm int|infoAttrs|0|Flags copied to the SHFILEINFO.dwAttributes member - useful when flags contains SHGFI_ATTR_SPECIFIED return NULL; if (flags & SHGFI_PIDL) { @@ -1343,7 +1345,7 @@ memset(&info, 0, sizeof(info)); info.dwAttributes = info_attrs; PY_INTERFACE_PRECALL; - DWORD_PTR dw = SHGetFileInfo(name, attr, &info, sizeof(info), flags); + DWORD_PTR dw = SHGetFileInfo(pidl_or_name, attr, &info, sizeof(info), flags); PY_INTERFACE_POSTCALL; ret = Py_BuildValue("NN", PyLong_FromUnsignedLongLong(dw), PyObject_FromSHFILEINFO(&info)); if (name) PyWinObject_FreeTCHAR(name); |
From: <pyw...@li...> - 2015-01-05 05:19:22
|
changeset b81227a0b147 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=b81227a0b147 summary: Support PT_MV_BINARY MAPI properties, via patch #37 diffstat: CHANGES.txt | 1 + com/win32comext/mapi/src/mapiutil.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diffs (30 lines): diff -r fcfbe0ff52ca -r b81227a0b147 CHANGES.txt --- a/CHANGES.txt Sat Dec 06 14:56:04 2014 -0500 +++ b/CHANGES.txt Mon Jan 05 16:19:06 2015 +1100 @@ -10,6 +10,7 @@ Addded outlook interface IConverterSession with methods MIMEToMAPI, MAPIToMIMEStm, and SetAdrBook Added method OpenStreamOnFile (Nick Czeczulin) Ignore PT_MV_TSTRING along with PT_TSTRING (Nick Czeczulin) + Bugfix to support PT_MV_BINARY properties (Nick Czeczulin via patch #37) * Conversions from a Python object to a variant now does a better job at deciding what variant type to use, taking into account the size and sign of diff -r fcfbe0ff52ca -r b81227a0b147 com/win32comext/mapi/src/mapiutil.cpp --- a/com/win32comext/mapi/src/mapiutil.cpp Sat Dec 06 14:56:04 2014 -0500 +++ b/com/win32comext/mapi/src/mapiutil.cpp Mon Jan 05 16:19:06 2015 +1100 @@ -305,8 +305,13 @@ for (i=0;!PyErr_Occurred() && i<pv->Value.MVbin.cValues;i++) { PyObject *obmv=PySequence_GetItem(ob,i); if (obmv==NULL) break; - pv->Value.MVbin.lpbin[i].lpb = (unsigned char *)PyString_AsString(ob); - pv->Value.MVbin.lpbin[i].cb = PyString_Size(ob); + if (!PyString_Check(obmv)) { + Py_DECREF(obmv); + PyErr_SetString(PyExc_TypeError, "PT_MV_BINARY elements must be strings"); + break; + } + pv->Value.MVbin.lpbin[i].lpb = (unsigned char *)PyString_AsString(obmv); + pv->Value.MVbin.lpbin[i].cb = PyString_Size(obmv); Py_DECREF(obmv); } break; |
From: <pyw...@li...> - 2014-12-06 19:57:38
|
changeset fcfbe0ff52ca in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=fcfbe0ff52ca summary: Allow blank original filename in win32verstamp diffstat: win32/Lib/win32verstamp.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 5bab1c62bff6 -r fcfbe0ff52ca win32/Lib/win32verstamp.py --- a/win32/Lib/win32verstamp.py Fri Oct 03 11:51:59 2014 -0400 +++ b/win32/Lib/win32verstamp.py Sat Dec 06 14:56:04 2014 -0500 @@ -126,7 +126,7 @@ if not ifn: ifn = os.path.basename(pathname) ofn = options.original_filename - if not ofn: + if ofn is None: ofn = os.path.basename(pathname) sdata = { |
From: <pyw...@li...> - 2014-10-03 15:53:23
|
changeset 5bab1c62bff6 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=5bab1c62bff6 summary: Fix DWORD parameters for UnlockFileEx diffstat: win32/src/win32file.i | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r d03aef67bfec -r 5bab1c62bff6 win32/src/win32file.i --- a/win32/src/win32file.i Fri Oct 03 11:16:45 2014 -0400 +++ b/win32/src/win32file.i Fri Oct 03 11:51:59 2014 -0400 @@ -1099,7 +1099,7 @@ PyObject *obOverlapped = NULL; DWORD nbytesLow, nbytesHigh; - if (!PyArg_ParseTuple(args, "OiiO:UnlockFileEx", + if (!PyArg_ParseTuple(args, "OkkO:UnlockFileEx", &obhFile, // @pyparm <o PyHANDLE>/int|hFile||Handle to the file &nbytesLow, // @pyparm nbytesLow|int||low-order part of number of // bytes to lock |
From: <pyw...@li...> - 2014-10-03 15:17:12
|
changeset d03aef67bfec in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=d03aef67bfec summary: Allow GetShortPathName to handle long paths in unicode mode diffstat: win32/src/win32apimodule.cpp | 34 ++++++++++++++++++++++++++-------- 1 files changed, 26 insertions(+), 8 deletions(-) diffs (58 lines): diff -r e1aebad91463 -r d03aef67bfec win32/src/win32apimodule.cpp --- a/win32/src/win32apimodule.cpp Tue Jun 03 10:54:18 2014 -0400 +++ b/win32/src/win32apimodule.cpp Fri Oct 03 11:16:45 2014 -0400 @@ -2318,7 +2318,6 @@ return NULL; char szOutPath[_MAX_PATH + 1]; - // @pyseeapi GetShortPathName PyW32_BEGIN_ALLOW_THREADS DWORD rc = GetShortPathNameA(path, szOutPath, sizeof(szOutPath)); PyW32_END_ALLOW_THREADS @@ -2330,20 +2329,39 @@ return Py_BuildValue("s", szOutPath); } #endif + PyObject *ret=NULL; WCHAR *path; if (!PyWinObject_AsWCHAR(obPath, &path)) return NULL; - WCHAR szOutPath[_MAX_PATH + 1]; + WCHAR *szOutPath=NULL; + DWORD rc, bufsize; // @pyseeapi GetShortPathName PyW32_BEGIN_ALLOW_THREADS - DWORD rc = GetShortPathNameW(path, szOutPath, sizeof(szOutPath)/sizeof(szOutPath[0])); + rc = GetShortPathNameW(path, NULL, 0); PyW32_END_ALLOW_THREADS + if (rc == 0) + PyWin_SetAPIError("GetShortPathNameW"); + else{ + bufsize = rc; + szOutPath = (WCHAR *)malloc(bufsize * sizeof(WCHAR)); + if (szOutPath == NULL) + PyErr_NoMemory(); + else{ + PyW32_BEGIN_ALLOW_THREADS + rc = GetShortPathNameW(path, szOutPath, bufsize); + PyW32_END_ALLOW_THREADS + if (rc == 0) + PyWin_SetAPIError("GetShortPathNameW"); + else if (rc > bufsize) + ReturnError("Short path name changed between calls", "GetShortPathNameW"); + else + ret = PyWinObject_FromWCHAR(szOutPath, rc); + } + } PyWinObject_FreeWCHAR(path); - if (rc==0) - return ReturnAPIError("GetShortPathNameW"); - if (rc >= sizeof(szOutPath)/sizeof(szOutPath[0])) - return ReturnError("The (unicode) pathname would be too big!!!"); - return Py_BuildValue("u", szOutPath); + if (szOutPath) + free(szOutPath); + return ret; // @comm The short path name is an 8.3 compatible file name. As the input path does // not need to be absolute, the returned name may be longer than the input path. } |
From: <pyw...@li...> - 2014-06-03 14:55:02
|
changeset e1aebad91463 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=e1aebad91463 summary: Fix another potential crash in SHGetIDListFromObject diffstat: com/win32comext/shell/src/shell.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 2c46390ed106 -r e1aebad91463 com/win32comext/shell/src/shell.cpp --- a/com/win32comext/shell/src/shell.cpp Tue Jun 03 10:45:01 2014 -0400 +++ b/com/win32comext/shell/src/shell.cpp Tue Jun 03 10:54:18 2014 -0400 @@ -3277,7 +3277,7 @@ if(!PyArg_ParseTuple(args, "O:SHGetIDListFromObject", &ob)) return NULL; - IUnknown *unk; + IUnknown *unk = NULL; PIDLIST_ABSOLUTE pidl; HRESULT hr; if (!PyCom_InterfaceFromPyInstanceOrObject(ob, IID_IUnknown, (void **)&unk, FALSE/* bNoneOK */)) |
From: <pyw...@li...> - 2014-06-03 14:45:45
|
changeset 2c46390ed106 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=2c46390ed106 summary: Initialize PCREDENTIAL (bug #670) diffstat: win32/src/win32credmodule.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 2e9e6d6bf4a3 -r 2c46390ed106 win32/src/win32credmodule.cpp --- a/win32/src/win32credmodule.cpp Mon May 26 10:21:01 2014 +1000 +++ b/win32/src/win32credmodule.cpp Tue Jun 03 10:45:01 2014 -0400 @@ -639,7 +639,7 @@ PyObject *obtargetname, *ret=NULL; WCHAR *targetname=NULL; DWORD cred_type, flags=0; - PCREDENTIAL cred; + PCREDENTIAL cred = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Ok|k:CredRead", keywords, &obtargetname, // @pyparm <o PyUnicode>|TargetName||The target of the credentials to retrieve &cred_type, // @pyparm int|Type||One of the CRED_TYPE_* constants |