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/. */
7 #ifndef ProfileUnlockerWin_h
8 #define ProfileUnlockerWin_h
11 #include <restartmanager.h>
13 #include "nsIProfileUnlocker.h"
15 #include "nsWindowsHelpers.h"
19 class ProfileUnlockerWin final
: public nsIProfileUnlocker
{
22 NS_DECL_NSIPROFILEUNLOCKER
24 explicit ProfileUnlockerWin(const nsAString
& aFileName
);
28 DWORD
StartSession(DWORD
& aHandle
);
29 void EndSession(DWORD aHandle
);
32 ~ProfileUnlockerWin();
33 nsresult
TryToTerminate(RM_UNIQUE_PROCESS
& aProcess
);
36 typedef DWORD(WINAPI
* RMSTARTSESSION
)(DWORD
*, DWORD
, WCHAR
[]);
37 typedef DWORD(WINAPI
* RMREGISTERRESOURCES
)(DWORD
, UINT
, LPCWSTR
[], UINT
,
38 RM_UNIQUE_PROCESS
[], UINT
,
40 typedef DWORD(WINAPI
* RMGETLIST
)(DWORD
, UINT
*, UINT
*, RM_PROCESS_INFO
[],
42 typedef DWORD(WINAPI
* RMENDSESSION
)(DWORD
);
45 nsModuleHandle mRestartMgrModule
;
46 RMSTARTSESSION mRmStartSession
;
47 RMREGISTERRESOURCES mRmRegisterResources
;
49 RMENDSESSION mRmEndSession
;
54 } // namespace mozilla
56 #endif // ProfileUnlockerWin_h