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 http://mozilla.org/MPL/2.0/. */
6 
7 #ifndef mozilla_glue_ModuleLoadFrame_h
8 #define mozilla_glue_ModuleLoadFrame_h
9 
10 #include "mozilla/Attributes.h"
11 #include "mozilla/LoaderAPIInterfaces.h"
12 
13 namespace mozilla {
14 namespace glue {
15 
16 class MOZ_RAII ModuleLoadFrame final {
17  public:
18   explicit ModuleLoadFrame(PCUNICODE_STRING aRequestedDllName);
19   ~ModuleLoadFrame();
20 
21   void SetLoadStatus(NTSTATUS aNtStatus, HANDLE aHandle);
22 
23   ModuleLoadFrame(const ModuleLoadFrame&) = delete;
24   ModuleLoadFrame(ModuleLoadFrame&&) = delete;
25   ModuleLoadFrame& operator=(const ModuleLoadFrame&) = delete;
26   ModuleLoadFrame& operator=(ModuleLoadFrame&&) = delete;
27 
28   static void StaticInit(nt::LoaderObserver* aNewObserver,
29                          nt::WinLauncherFunctions* aOutWinLauncherFunctions);
30 
31  private:
32   bool mAlreadyLoaded;
33   void* mContext;
34   NTSTATUS mDllLoadStatus;
35   ModuleLoadInfo mLoadInfo;
36 
37  private:
38   static nt::LoaderAPI* sLoaderAPI;
39 };
40 
41 }  // namespace glue
42 }  // namespace mozilla
43 
44 #endif  // mozilla_glue_ModuleLoadFrame_h
45