Skip to content

Commit

Permalink
Add missing Mapi call PyIMsgStore.StoreLogoff (#2196)
Browse files Browse the repository at this point in the history
  • Loading branch information
avivbrg committed Mar 13, 2024
1 parent 1d29e4a commit 2ef6883
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
26 changes: 26 additions & 0 deletions com/win32comext/mapi/src/PyIMsgStore.i
Expand Up @@ -79,6 +79,32 @@ PyObject *PyIMsgStore::OpenEntry(PyObject *self, PyObject *args)

%}

%native(StoreLogoff) StoreLogoff;
%{
// @pyswig <o PyIInterface>|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,"k: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 <o PyIID>, 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.
Expand Down
10 changes: 10 additions & 0 deletions com/win32comext/mapi/src/mapi.i
Expand Up @@ -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

Expand Down

0 comments on commit 2ef6883

Please sign in to comment.