ash: Extend launcher first button to include leading inset.
[chromium-blink-merge.git] / sandbox / src / sandbox_utils.h
blob314330fcdbcafcffca4c49442d7bb98ead04b0c5
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SANDBOX_SRC_SANDBOX_UTILS_H__
6 #define SANDBOX_SRC_SANDBOX_UTILS_H__
8 #include <windows.h>
9 #include <string>
11 #include "base/basictypes.h"
12 #include "sandbox/src/nt_internals.h"
14 namespace sandbox {
16 typedef BOOL (WINAPI* GetModuleHandleExFunction)(DWORD flags,
17 LPCWSTR module_name,
18 HMODULE* module);
20 // Windows XP provides a nice function in kernel32.dll called GetModuleHandleEx
21 // This function allows us to verify if a function exported by the module
22 // lies in the module itself.
23 // As we need compatibility with windows 2000, we cannot use this function
24 // by calling it by name. This helper function checks if the GetModuleHandleEx
25 // function is exported by kernel32 and uses it, otherwise, implemets part of
26 // the functionality exposed by GetModuleHandleEx.
27 bool GetModuleHandleHelper(DWORD flags, const wchar_t* module_name,
28 HMODULE* module);
30 // Returns true if the current OS is Windows XP SP2 or later.
31 bool IsXPSP2OrLater();
33 void InitObjectAttribs(const std::wstring& name, ULONG attributes, HANDLE root,
34 OBJECT_ATTRIBUTES* obj_attr, UNICODE_STRING* uni_name);
36 }; // namespace sandbox
38 #endif // SANDBOX_SRC_SANDBOX_UTILS_H__