diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /comm/mailnews/addrbook/src/nsMapiAddressBook.h | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'comm/mailnews/addrbook/src/nsMapiAddressBook.h')
-rw-r--r-- | comm/mailnews/addrbook/src/nsMapiAddressBook.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/comm/mailnews/addrbook/src/nsMapiAddressBook.h b/comm/mailnews/addrbook/src/nsMapiAddressBook.h new file mode 100644 index 0000000000..dd0463dba0 --- /dev/null +++ b/comm/mailnews/addrbook/src/nsMapiAddressBook.h @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef nsMapiAddressBook_h___ +#define nsMapiAddressBook_h___ + +#include "mozilla/Attributes.h" +#include "nsAbWinHelper.h" + +class nsMapiAddressBook : public nsAbWinHelper { + public: + nsMapiAddressBook(void); + virtual ~nsMapiAddressBook(void); + + protected: + // Class members to handle the library/entry points + static HMODULE mLibrary; + static int32_t mLibUsage; + static LPMAPIINITIALIZE mMAPIInitialize; + static LPMAPIUNINITIALIZE mMAPIUninitialize; + static LPMAPIALLOCATEBUFFER mMAPIAllocateBuffer; + static LPMAPIFREEBUFFER mMAPIFreeBuffer; + static LPMAPILOGONEX mMAPILogonEx; + // Shared session and address book used by all instances. + // For reasons best left unknown, MAPI doesn't seem to like + // having different threads playing with supposedly different + // sessions and address books. They ll end up fighting over + // the same resources, with hangups and GPF resulting. Not nice. + // So it seems that if everybody (as long as some client is + // still alive) is using the same sessions and address books, + // MAPI feels better. And who are we to get in the way of MAPI + // happiness? Thus the following class members: + static BOOL mInitialized; + static BOOL mLogonDone; + static LPMAPISESSION mRootSession; + static LPADRBOOK mRootBook; + + // Load the MAPI environment + BOOL Initialize(void); + // Allocation of a buffer for transmission to interfaces + virtual void AllocateBuffer(ULONG aByteCount, LPVOID* aBuffer) override; + // Destruction of a buffer provided by the interfaces + virtual void FreeBuffer(LPVOID aBuffer) override; + // Library management + static BOOL LoadMapiLibrary(void); + static void FreeMapiLibrary(void); + + private: +}; + +#endif // nsMapiAddressBook_h___ |