Fix Centurion name.
[0ad.git] / libraries / source / spidermonkey / include-win32-debug / mozilla / LoaderAPIInterfaces.h
blob6374d694e8cd8230f3cd1bfda59fef929e928f31
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_LoaderAPIInterfaces_h
8 #define mozilla_LoaderAPIInterfaces_h
10 #include "mozilla/ModuleLoadInfo.h"
12 namespace mozilla {
13 namespace nt {
15 class NS_NO_VTABLE LoaderObserver {
16 public:
17 /**
18 * Notification that a DLL load has begun.
20 * @param aContext Outparam that allows this observer to store any context
21 * information pertaining to the current load.
22 * @param aRequestedDllName The DLL name requested by whatever invoked the
23 * loader. This name may not match the effective
24 * name of the DLL once the loader has completed
25 * its path search.
27 virtual void OnBeginDllLoad(void** aContext,
28 PCUNICODE_STRING aRequestedDllName) = 0;
30 /**
31 * Query the observer to determine whether the DLL named |aLSPLeafName| needs
32 * to be substituted with another module, and substitute the module handle
33 * when necessary.
35 * @return true when substitution occurs, otherwise false
37 virtual bool SubstituteForLSP(PCUNICODE_STRING aLSPLeafName,
38 PHANDLE aOutHandle) = 0;
40 /**
41 * Notification that a DLL load has ended.
43 * @param aContext The context that was set by the corresponding call to
44 * OnBeginDllLoad
45 * @param aNtStatus The NTSTATUS returned by LdrLoadDll
46 * @param aModuleLoadInfo Telemetry information that was gathered about the
47 * load.
49 virtual void OnEndDllLoad(void* aContext, NTSTATUS aNtStatus,
50 ModuleLoadInfo&& aModuleLoadInfo) = 0;
52 /**
53 * Called to inform the observer that it is no longer active and, if
54 * necessary, call aNext->OnForward() with any accumulated telemetry
55 * information.
57 virtual void Forward(LoaderObserver* aNext) = 0;
59 /**
60 * Receives a vector of module load telemetry from a previous LoaderObserver.
62 virtual void OnForward(ModuleLoadInfoVec&& aInfo) = 0;
65 class NS_NO_VTABLE LoaderAPI {
66 public:
67 /**
68 * Construct a new ModuleLoadInfo structure and notify the LoaderObserver
69 * that a library load is beginning.
71 virtual ModuleLoadInfo ConstructAndNotifyBeginDllLoad(
72 void** aContext, PCUNICODE_STRING aRequestedDllName) = 0;
74 /**
75 * Query to determine whether the DLL named |aLSPLeafName| needs to be
76 * substituted with another module, and substitute the module handle when
77 * necessary.
79 * @return true when substitution occurs, otherwise false
81 virtual bool SubstituteForLSP(PCUNICODE_STRING aLSPLeafName,
82 PHANDLE aOutHandle) = 0;
84 /**
85 * Notification that a DLL load has ended.
87 virtual void NotifyEndDllLoad(void* aContext, NTSTATUS aLoadNtStatus,
88 ModuleLoadInfo&& aModuleLoadInfo) = 0;
90 /**
91 * Given the address of a mapped section, obtain the name of the file that is
92 * backing it.
94 virtual AllocatedUnicodeString GetSectionName(void* aSectionAddr) = 0;
96 using InitDllBlocklistOOPFnPtr = LauncherVoidResultWithLineInfo (*)(
97 const wchar_t*, HANDLE, const IMAGE_THUNK_DATA*);
99 /**
100 * Return a pointer to the cross-process DLL Blocklist Init function.
101 * Used by sandboxBroker::LaunchApp.
103 virtual InitDllBlocklistOOPFnPtr GetDllBlocklistInitFn() = 0;
106 } // namespace nt
107 } // namespace mozilla
109 #endif // mozilla_LoaderAPIInterfaces_h