WindowsDllBlocklist.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_windowsdllblocklist_h
  6. #define mozilla_windowsdllblocklist_h
  7. #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
  8. #include <windows.h>
  9. #include "mozilla/GuardObjects.h"
  10. #include "mozilla/Attributes.h"
  11. #define HAS_DLL_BLOCKLIST
  12. MFBT_API void DllBlocklist_Initialize();
  13. MFBT_API void DllBlocklist_SetInXPCOMLoadOnMainThread(bool inXPCOMLoadOnMainThread);
  14. MFBT_API void DllBlocklist_WriteNotes(HANDLE file);
  15. MFBT_API bool DllBlocklist_CheckStatus();
  16. class MOZ_RAII AutoSetXPCOMLoadOnMainThread
  17. {
  18. public:
  19. AutoSetXPCOMLoadOnMainThread(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM) {
  20. MOZ_GUARD_OBJECT_NOTIFIER_INIT;
  21. DllBlocklist_SetInXPCOMLoadOnMainThread(true);
  22. }
  23. ~AutoSetXPCOMLoadOnMainThread() {
  24. DllBlocklist_SetInXPCOMLoadOnMainThread(false);
  25. }
  26. private:
  27. MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
  28. };
  29. #endif // defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
  30. #endif // mozilla_windowsdllblocklist_h