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/. */
6 #ifndef mozilla_windowsdllblocklist_h
7 #define mozilla_windowsdllblocklist_h
9 #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
12 #include "mozilla/GuardObjects.h"
15 #define HAS_DLL_BLOCKLIST
17 NS_IMPORT
void DllBlocklist_Initialize();
18 NS_IMPORT
void DllBlocklist_SetInXPCOMLoadOnMainThread(bool inXPCOMLoadOnMainThread
);
19 NS_IMPORT
void DllBlocklist_WriteNotes(HANDLE file
);
21 class AutoSetXPCOMLoadOnMainThread
24 AutoSetXPCOMLoadOnMainThread(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM
) {
25 MOZ_GUARD_OBJECT_NOTIFIER_INIT
;
26 DllBlocklist_SetInXPCOMLoadOnMainThread(true);
29 ~AutoSetXPCOMLoadOnMainThread() {
30 DllBlocklist_SetInXPCOMLoadOnMainThread(false);
34 MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
37 #endif // defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
38 #endif // mozilla_windowsdllblocklist_h