From 85a3dc81a325a33e9be1167f39a643b71080ec30 Mon Sep 17 00:00:00 2001 From: Aviv Bergman Date: Thu, 7 Mar 2024 14:41:12 +1100 Subject: [PATCH 1/3] Adding PyIMsgStore::StoreLogoff --- com/win32comext/mapi/src/PyIMsgStore.i | 26 ++++++++++++++++++++++++++ com/win32comext/mapi/src/mapi.i | 10 ++++++++++ 2 files changed, 36 insertions(+) diff --git a/com/win32comext/mapi/src/PyIMsgStore.i b/com/win32comext/mapi/src/PyIMsgStore.i index ddb43229af..e000b174fb 100644 --- a/com/win32comext/mapi/src/PyIMsgStore.i +++ b/com/win32comext/mapi/src/PyIMsgStore.i @@ -79,6 +79,32 @@ PyObject *PyIMsgStore::OpenEntry(PyObject *self, PyObject *args) %} +%native(StoreLogoff) StoreLogoff; +%{ +// @pyswig |StoreLogoff|Enables the orderly logoff of the message store. +PyObject *PyIMsgStore::StoreLogoff(PyObject *self, PyObject *args) +{ + HRESULT _result; + unsigned long flags; + + IMsgStore *_swig_self; + if ((_swig_self=GetI(self))==NULL) return NULL; + // @pyparm int|flags||Bitmask of flags that controls how the message store is closed. + if(!PyArg_ParseTuple(args,"l:StoreLogoff", &flags)) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _result = (HRESULT )_swig_self->StoreLogoff(&flags); + Py_END_ALLOW_THREADS + if (FAILED(_result)) { + return OleSetOleError(_result); + } + + return PyLong_FromLong(flags); +} + +%} + %native(GetReceiveFolder) GetReceiveFolder; %{ // @pyswig , string|GetReceiveFolder|Obtains the folder that was established as the destination for incoming messages of a specified message class or the default receive folder for the message store. diff --git a/com/win32comext/mapi/src/mapi.i b/com/win32comext/mapi/src/mapi.i index 6e769b7f47..fae114b43e 100644 --- a/com/win32comext/mapi/src/mapi.i +++ b/com/win32comext/mapi/src/mapi.i @@ -269,6 +269,16 @@ static PyObject *PyMAPIUninitialize(PyObject *self, PyObject *args) #define MAPI_BEST_ACCESS MAPI_BEST_ACCESS #define MAPI_MODIFY MAPI_MODIFY +#define LOGOFF_NO_WAIT LOGOFF_NO_WAIT +#define LOGOFF_ORDERLY LOGOFF_ORDERLY +#define LOGOFF_PURGE LOGOFF_PURGE +#define LOGOFF_ABORT LOGOFF_ABORT +#define LOGOFF_QUIET LOGOFF_QUIET +#define LOGOFF_COMPLETE LOGOFF_COMPLETE +#define LOGOFF_INBOUND LOGOFF_INBOUND +#define LOGOFF_OUTBOUND LOGOFF_OUTBOUND +#define LOGOFF_OUTBOUND_QUEUE LOGOFF_OUTBOUND_QUEUE + #define MAPI_DEFERRED_ERRORS MAPI_DEFERRED_ERRORS // Allows a method to return successfully, possibly before the changes have been fully committed. #define MAPI_INIT_VERSION MAPI_INIT_VERSION From a512381357cbb3750573b1e8ebda5b79c8e37132 Mon Sep 17 00:00:00 2001 From: Aviv Bergman Date: Wed, 13 Mar 2024 17:21:01 +1100 Subject: [PATCH 2/3] fixed tabs & format flag --- com/win32comext/mapi/src/PyIMsgStore.i | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/com/win32comext/mapi/src/PyIMsgStore.i b/com/win32comext/mapi/src/PyIMsgStore.i index e000b174fb..45660ce235 100644 --- a/com/win32comext/mapi/src/PyIMsgStore.i +++ b/com/win32comext/mapi/src/PyIMsgStore.i @@ -84,21 +84,21 @@ PyObject *PyIMsgStore::OpenEntry(PyObject *self, PyObject *args) // @pyswig |StoreLogoff|Enables the orderly logoff of the message store. PyObject *PyIMsgStore::StoreLogoff(PyObject *self, PyObject *args) { - HRESULT _result; - unsigned long flags; + HRESULT _result; + unsigned long flags; IMsgStore *_swig_self; if ((_swig_self=GetI(self))==NULL) return NULL; // @pyparm int|flags||Bitmask of flags that controls how the message store is closed. - if(!PyArg_ParseTuple(args,"l:StoreLogoff", &flags)) - return NULL; + if(!PyArg_ParseTuple(args,"k:StoreLogoff", &flags)) + return NULL; Py_BEGIN_ALLOW_THREADS - _result = (HRESULT )_swig_self->StoreLogoff(&flags); + _result = (HRESULT )_swig_self->StoreLogoff(&flags); Py_END_ALLOW_THREADS - if (FAILED(_result)) { - return OleSetOleError(_result); - } + if (FAILED(_result)) { + return OleSetOleError(_result); + } return PyLong_FromLong(flags); } From 63c80121f57982ff39afdd4c47410bbdd6b8126d Mon Sep 17 00:00:00 2001 From: Aviv Bergman Date: Wed, 13 Mar 2024 17:26:18 +1100 Subject: [PATCH 3/3] tab fix --- com/win32comext/mapi/src/PyIMsgStore.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com/win32comext/mapi/src/PyIMsgStore.i b/com/win32comext/mapi/src/PyIMsgStore.i index 45660ce235..a78fb93802 100644 --- a/com/win32comext/mapi/src/PyIMsgStore.i +++ b/com/win32comext/mapi/src/PyIMsgStore.i @@ -97,7 +97,7 @@ PyObject *PyIMsgStore::StoreLogoff(PyObject *self, PyObject *args) _result = (HRESULT )_swig_self->StoreLogoff(&flags); Py_END_ALLOW_THREADS if (FAILED(_result)) { - return OleSetOleError(_result); + return OleSetOleError(_result); } return PyLong_FromLong(flags);