OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Utilities for process/threads in Windows. | 5 // Utilities for process/threads in Windows. |
6 | 6 |
7 #ifndef CEEE_COMMON_PROCESS_UTILS_WIN_H_ | 7 #ifndef CEEE_COMMON_PROCESS_UTILS_WIN_H_ |
8 #define CEEE_COMMON_PROCESS_UTILS_WIN_H_ | 8 #define CEEE_COMMON_PROCESS_UTILS_WIN_H_ |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // a separate subsystem (WOW64). Thus, two processes are platform-compatible | 44 // a separate subsystem (WOW64). Thus, two processes are platform-compatible |
45 // when both are 32-bit or both are 64-bit. It is noop on 32-bit systems. | 45 // when both are 32-bit or both are 64-bit. It is noop on 32-bit systems. |
46 // Two processes are security-compatible when their integrity levels permit COM | 46 // Two processes are security-compatible when their integrity levels permit COM |
47 // communication between them. High integrity processes are compatible only with | 47 // communication between them. High integrity processes are compatible only with |
48 // other high integrity processes. A low or a medium integrity process is | 48 // other high integrity processes. A low or a medium integrity process is |
49 // compatible with any process that is either low or medium integrity. | 49 // compatible with any process that is either low or medium integrity. |
50 // Some considerations of security-compatibility are expanded upon in comments | 50 // Some considerations of security-compatibility are expanded upon in comments |
51 // with implementation. | 51 // with implementation. |
52 class ProcessCompatibilityCheck { | 52 class ProcessCompatibilityCheck { |
53 public: | 53 public: |
| 54 static ProcessCompatibilityCheck* GetInstance(); |
| 55 |
54 // Is the process associated with the given window compatible with the | 56 // Is the process associated with the given window compatible with the |
55 // current process. If the call returns an error code, the value of | 57 // current process. If the call returns an error code, the value of |
56 // *is_compatible is undefined. | 58 // *is_compatible is undefined. |
57 static HRESULT IsCompatible(HWND process_window, bool* is_compatible); | 59 static HRESULT IsCompatible(HWND process_window, bool* is_compatible); |
58 | 60 |
59 // Is the process of given ID compatible with the current process. If the | 61 // Is the process of given ID compatible with the current process. If the |
60 // call returns an error code, the value of *is_compatible is undefined. | 62 // call returns an error code, the value of *is_compatible is undefined. |
61 static HRESULT IsCompatible(DWORD process_id, bool* is_compatible); | 63 static HRESULT IsCompatible(DWORD process_id, bool* is_compatible); |
62 | 64 |
63 protected: | 65 protected: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 static IsWOW64ProcessFuncType is_wow64_process_func_; | 115 static IsWOW64ProcessFuncType is_wow64_process_func_; |
114 | 116 |
115 friend struct DefaultSingletonTraits<ProcessCompatibilityCheck>; | 117 friend struct DefaultSingletonTraits<ProcessCompatibilityCheck>; |
116 | 118 |
117 DISALLOW_COPY_AND_ASSIGN(ProcessCompatibilityCheck); | 119 DISALLOW_COPY_AND_ASSIGN(ProcessCompatibilityCheck); |
118 }; | 120 }; |
119 | 121 |
120 } // namespace process_utils_win | 122 } // namespace process_utils_win |
121 | 123 |
122 #endif // CEEE_COMMON_PROCESS_UTILS_WIN_H_ | 124 #endif // CEEE_COMMON_PROCESS_UTILS_WIN_H_ |
OLD | NEW |