Changeset 140
- Timestamp:
- Sep 4, 2010, 1:10:40 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk/jdk/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c
r2 r140 51 51 (const char* cmd, const char* arg1, const char* arg2, const char* arg3, const char* pipename); 52 52 53 #ifndef __WIN32OS2__ 53 54 /* OpenProcess with SE_DEBUG_NAME privilege */ 54 55 static HANDLE 55 56 doPrivilegedOpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId); 57 #endif /* __WIN32OS2__ */ 56 58 57 59 /* convert jstring to C string */ … … 91 93 * Code copied to target process 92 94 */ 95 #ifdef _MSC_VER 93 96 #pragma check_stack (off) 97 #endif 94 98 static DWORD WINAPI thread_func(DataBlock *pData) 95 99 { … … 121 125 static void thread_end (void) { 122 126 } 127 #ifdef _MSC_VER 123 128 #pragma check_stack 129 #endif 124 130 125 131 … … 181 187 */ 182 188 hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid); 189 #ifndef __WIN32OS2__ 183 190 if (hProcess == NULL && GetLastError() == ERROR_ACCESS_DENIED) { 184 191 hProcess = doPrivilegedOpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid); 185 192 } 193 #endif /* __WIN32OS2__ */ 186 194 187 195 if (hProcess == NULL) { … … 459 467 } 460 468 469 #ifndef __WIN32OS2__ 470 461 471 /* 462 472 * Attempts to enable the SE_DEBUG_NAME privilege and open the given process. … … 557 567 } 558 568 569 #endif /* __WIN32OS2__ */ 570 559 571 /* convert jstring to C string */ 560 572 static void jstring_to_cstring(JNIEnv* env, jstring jstr, char* cstr, int len) {
Note:
See TracChangeset
for help on using the changeset viewer.