Mercurial > hg > truffle
annotate src/os/windows/vm/os_windows.hpp @ 14769:141d570b397c
fixed pylint errors
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 26 Mar 2014 17:36:25 +0100 |
parents | bb9356ec5967 |
children | 4ca6dc0799b6 |
rev | line source |
---|---|
0 | 1 /* |
14475
6c9332549827
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
11151
diff
changeset
|
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
470
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
470
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
470
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef OS_WINDOWS_VM_OS_WINDOWS_HPP |
26 #define OS_WINDOWS_VM_OS_WINDOWS_HPP | |
0 | 27 // Win32_OS defines the interface to windows operating systems |
28 | |
14436
b0133e4187d3
8028471: PPC64 (part 215): opto: Extend ImplicitNullCheck optimization.
goetz
parents:
11151
diff
changeset
|
29 // Information about the protection of the page at address '0' on this os. |
b0133e4187d3
8028471: PPC64 (part 215): opto: Extend ImplicitNullCheck optimization.
goetz
parents:
11151
diff
changeset
|
30 static bool zero_page_read_protected() { return true; } |
b0133e4187d3
8028471: PPC64 (part 215): opto: Extend ImplicitNullCheck optimization.
goetz
parents:
11151
diff
changeset
|
31 |
0 | 32 class win32 { |
6080
7432b9db36ff
7165755: OS Information much longer on linux than other platforms
nloodin
parents:
3885
diff
changeset
|
33 friend class os; |
0 | 34 |
35 protected: | |
36 static int _vm_page_size; | |
37 static int _vm_allocation_granularity; | |
38 static int _processor_type; | |
39 static int _processor_level; | |
40 static julong _physical_memory; | |
41 static size_t _default_stack_size; | |
42 static bool _is_nt; | |
389
ee21eaa8ffe1
6660681: Incrementally reserve pages on win server 2003 for better large page affinity
jmasa
parents:
0
diff
changeset
|
43 static bool _is_windows_2003; |
2204
63d374c54045
7014918: Improve core/minidump handling in Hotspot
ctornqvi
parents:
1972
diff
changeset
|
44 static bool _is_windows_server; |
14475
6c9332549827
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
11151
diff
changeset
|
45 static bool _has_performance_count; |
0 | 46 |
6080
7432b9db36ff
7165755: OS Information much longer on linux than other platforms
nloodin
parents:
3885
diff
changeset
|
47 static void print_windows_version(outputStream* st); |
7432b9db36ff
7165755: OS Information much longer on linux than other platforms
nloodin
parents:
3885
diff
changeset
|
48 |
0 | 49 public: |
50 // Windows-specific interface: | |
51 static void initialize_system_info(); | |
52 static void setmode_streams(); | |
53 | |
54 // Processor info as provided by NT | |
55 static int processor_type() { return _processor_type; } | |
56 // Processor level may not be accurate on non-NT systems | |
57 static int processor_level() { | |
58 assert(is_nt(), "use vm_version instead"); | |
59 return _processor_level; | |
60 } | |
61 static julong available_memory(); | |
62 static julong physical_memory() { return _physical_memory; } | |
63 | |
3833
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
64 // load dll from Windows system directory or Windows directory |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
65 static HINSTANCE load_Windows_dll(const char* name, char *ebuf, int ebuflen); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
66 |
14475
6c9332549827
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
11151
diff
changeset
|
67 private: |
6c9332549827
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
11151
diff
changeset
|
68 static void initialize_performance_counter(); |
6c9332549827
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
11151
diff
changeset
|
69 |
0 | 70 public: |
71 // Generic interface: | |
72 | |
73 // Trace number of created threads | |
74 static intx _os_thread_limit; | |
75 static volatile intx _os_thread_count; | |
76 | |
77 // Tells whether the platform is NT or Windown95 | |
78 static bool is_nt() { return _is_nt; } | |
79 | |
2204
63d374c54045
7014918: Improve core/minidump handling in Hotspot
ctornqvi
parents:
1972
diff
changeset
|
80 // Tells whether this is a server version of Windows |
63d374c54045
7014918: Improve core/minidump handling in Hotspot
ctornqvi
parents:
1972
diff
changeset
|
81 static bool is_windows_server() { return _is_windows_server; } |
63d374c54045
7014918: Improve core/minidump handling in Hotspot
ctornqvi
parents:
1972
diff
changeset
|
82 |
389
ee21eaa8ffe1
6660681: Incrementally reserve pages on win server 2003 for better large page affinity
jmasa
parents:
0
diff
changeset
|
83 // Tells whether the platform is Windows 2003 |
ee21eaa8ffe1
6660681: Incrementally reserve pages on win server 2003 for better large page affinity
jmasa
parents:
0
diff
changeset
|
84 static bool is_windows_2003() { return _is_windows_2003; } |
ee21eaa8ffe1
6660681: Incrementally reserve pages on win server 2003 for better large page affinity
jmasa
parents:
0
diff
changeset
|
85 |
0 | 86 // Returns the byte size of a virtual memory page |
87 static int vm_page_size() { return _vm_page_size; } | |
88 | |
89 // Returns the size in bytes of memory blocks which can be allocated. | |
90 static int vm_allocation_granularity() { return _vm_allocation_granularity; } | |
91 | |
92 // Read the headers for the executable that started the current process into | |
93 // the structure passed in (see winnt.h). | |
94 static void read_executable_headers(PIMAGE_NT_HEADERS); | |
95 | |
96 // Default stack size for the current process. | |
97 static size_t default_stack_size() { return _default_stack_size; } | |
98 | |
99 #ifndef _WIN64 | |
100 // A wrapper to install a structured exception handler for fast JNI accesors. | |
101 static address fast_jni_accessor_wrapper(BasicType); | |
102 #endif | |
103 | |
11092
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
6842
diff
changeset
|
104 #ifndef PRODUCT |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
6842
diff
changeset
|
105 static void call_test_func_with_wrapper(void (*funcPtr)(void)); |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
6842
diff
changeset
|
106 #endif |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
6842
diff
changeset
|
107 |
0 | 108 // filter function to ignore faults on serializations page |
109 static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e); | |
110 }; | |
111 | |
11151 | 112 /* |
113 * Crash protection for the watcher thread. Wrap the callback | |
114 * with a __try { call() } | |
115 * To be able to use this - don't take locks, don't rely on destructors, | |
116 * don't make OS library calls, don't allocate memory, don't print, | |
117 * don't call code that could leave the heap / memory in an inconsistent state, | |
118 * or anything else where we are not in control if we suddenly jump out. | |
119 */ | |
120 class WatcherThreadCrashProtection : public StackObj { | |
121 public: | |
122 WatcherThreadCrashProtection(); | |
123 bool call(os::CrashProtectionCallback& cb); | |
124 }; | |
125 | |
6197 | 126 class PlatformEvent : public CHeapObj<mtInternal> { |
0 | 127 private: |
128 double CachePad [4] ; // increase odds that _Event is sole occupant of cache line | |
129 volatile int _Event ; | |
130 HANDLE _ParkHandle ; | |
131 | |
132 public: // TODO-FIXME: make dtor private | |
133 ~PlatformEvent() { guarantee (0, "invariant") ; } | |
134 | |
135 public: | |
136 PlatformEvent() { | |
137 _Event = 0 ; | |
138 _ParkHandle = CreateEvent (NULL, false, false, NULL) ; | |
139 guarantee (_ParkHandle != NULL, "invariant") ; | |
140 } | |
141 | |
142 // Exercise caution using reset() and fired() - they may require MEMBARs | |
143 void reset() { _Event = 0 ; } | |
144 int fired() { return _Event; } | |
145 void park () ; | |
146 void unpark () ; | |
147 int park (jlong millis) ; | |
148 } ; | |
149 | |
150 | |
151 | |
6197 | 152 class PlatformParker : public CHeapObj<mtInternal> { |
0 | 153 protected: |
154 HANDLE _ParkEvent ; | |
155 | |
156 public: | |
157 ~PlatformParker () { guarantee (0, "invariant") ; } | |
158 PlatformParker () { | |
159 _ParkEvent = CreateEvent (NULL, true, false, NULL) ; | |
160 guarantee (_ParkEvent != NULL, "invariant") ; | |
161 } | |
162 | |
163 } ; | |
1972 | 164 |
3833
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
165 // JDK7 requires VS2010 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
166 #if _MSC_VER < 1600 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
167 #define JDK6_OR_EARLIER 1 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
168 #endif |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
169 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
170 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
171 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
172 class WinSock2Dll: AllStatic { |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
173 public: |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
174 static BOOL WSAStartup(WORD, LPWSADATA); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
175 static struct hostent* gethostbyname(const char *name); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
176 static BOOL WinSock2Available(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
177 #ifdef JDK6_OR_EARLIER |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
178 private: |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
179 static int (PASCAL FAR* _WSAStartup)(WORD, LPWSADATA); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
180 static struct hostent *(PASCAL FAR *_gethostbyname)(...); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
181 static BOOL initialized; |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
182 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
183 static void initialize(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
184 #endif |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
185 }; |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
186 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
187 class Kernel32Dll: AllStatic { |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
188 public: |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
189 static BOOL SwitchToThread(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
190 static SIZE_T GetLargePageMinimum(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
191 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
192 static BOOL SwitchToThreadAvailable(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
193 static BOOL GetLargePageMinimumAvailable(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
194 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
195 // Help tools |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
196 static BOOL HelpToolsAvailable(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
197 static HANDLE CreateToolhelp32Snapshot(DWORD,DWORD); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
198 static BOOL Module32First(HANDLE,LPMODULEENTRY32); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
199 static BOOL Module32Next(HANDLE,LPMODULEENTRY32); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
200 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
201 static BOOL GetNativeSystemInfoAvailable(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
202 static void GetNativeSystemInfo(LPSYSTEM_INFO); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
203 |
3885 | 204 // NUMA calls |
205 static BOOL NumaCallsAvailable(); | |
206 static LPVOID VirtualAllocExNuma(HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD); | |
207 static BOOL GetNumaHighestNodeNumber(PULONG); | |
208 static BOOL GetNumaNodeProcessorMask(UCHAR, PULONGLONG); | |
209 | |
6197 | 210 // Stack walking |
211 static USHORT RtlCaptureStackBackTrace(ULONG, ULONG, PVOID*, PULONG); | |
212 | |
3833
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
213 private: |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
214 // GetLargePageMinimum available on Windows Vista/Windows Server 2003 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
215 // and later |
3885 | 216 // NUMA calls available Windows Vista/WS2008 and later |
217 | |
3833
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
218 static SIZE_T (WINAPI *_GetLargePageMinimum)(void); |
3885 | 219 static LPVOID (WINAPI *_VirtualAllocExNuma) (HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD); |
220 static BOOL (WINAPI *_GetNumaHighestNodeNumber) (PULONG); | |
221 static BOOL (WINAPI *_GetNumaNodeProcessorMask) (UCHAR, PULONGLONG); | |
6197 | 222 static USHORT (WINAPI *_RtlCaptureStackBackTrace)(ULONG, ULONG, PVOID*, PULONG); |
3833
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
223 static BOOL initialized; |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
224 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
225 static void initialize(); |
3885 | 226 static void initializeCommon(); |
3833
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
227 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
228 #ifdef JDK6_OR_EARLIER |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
229 private: |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
230 static BOOL (WINAPI *_SwitchToThread)(void); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
231 static HANDLE (WINAPI* _CreateToolhelp32Snapshot)(DWORD,DWORD); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
232 static BOOL (WINAPI* _Module32First)(HANDLE,LPMODULEENTRY32); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
233 static BOOL (WINAPI* _Module32Next)(HANDLE,LPMODULEENTRY32); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
234 static void (WINAPI *_GetNativeSystemInfo)(LPSYSTEM_INFO); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
235 #endif |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
236 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
237 }; |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
238 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
239 class Advapi32Dll: AllStatic { |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
240 public: |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
241 static BOOL AdjustTokenPrivileges(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
242 static BOOL OpenProcessToken(HANDLE, DWORD, PHANDLE); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
243 static BOOL LookupPrivilegeValue(LPCTSTR, LPCTSTR, PLUID); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
244 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
245 static BOOL AdvapiAvailable(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
246 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
247 #ifdef JDK6_OR_EARLIER |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
248 private: |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
249 static BOOL (WINAPI *_AdjustTokenPrivileges)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
250 static BOOL (WINAPI *_OpenProcessToken)(HANDLE, DWORD, PHANDLE); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
251 static BOOL (WINAPI *_LookupPrivilegeValue)(LPCTSTR, LPCTSTR, PLUID); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
252 static BOOL initialized; |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
253 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
254 static void initialize(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
255 #endif |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
256 }; |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
257 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
258 class PSApiDll: AllStatic { |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
259 public: |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
260 static BOOL EnumProcessModules(HANDLE, HMODULE *, DWORD, LPDWORD); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
261 static DWORD GetModuleFileNameEx(HANDLE, HMODULE, LPTSTR, DWORD); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
262 static BOOL GetModuleInformation(HANDLE, HMODULE, LPMODULEINFO, DWORD); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
263 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
264 static BOOL PSApiAvailable(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
265 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
266 #ifdef JDK6_OR_EARLIER |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
267 private: |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
268 static BOOL (WINAPI *_EnumProcessModules)(HANDLE, HMODULE *, DWORD, LPDWORD); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
269 static BOOL (WINAPI *_GetModuleFileNameEx)(HANDLE, HMODULE, LPTSTR, DWORD);; |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
270 static BOOL (WINAPI *_GetModuleInformation)(HANDLE, HMODULE, LPMODULEINFO, DWORD); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
271 static BOOL initialized; |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
272 |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
273 static void initialize(); |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
274 #endif |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
275 }; |
b1cbb0907b36
7016797: Hotspot: securely/restrictive load dlls and new API for loading system dlls
zgu
parents:
2204
diff
changeset
|
276 |
1972 | 277 #endif // OS_WINDOWS_VM_OS_WINDOWS_HPP |