Changeset 309 for trunk/openjdk/jdk/src/windows
- Timestamp:
- Feb 13, 2012, 10:07:12 PM (14 years ago)
- Location:
- trunk/openjdk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk
- Property svn:mergeinfo changed
/branches/vendor/oracle/openjdk6/b24 (added) merged: 308 /branches/vendor/oracle/openjdk6/current merged: 307
- Property svn:mergeinfo changed
-
trunk/openjdk/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java
r278 r309 27 27 import java.io.IOException; 28 28 import java.io.FileDescriptor; 29 import sun.net.ResourceManager; 29 30 30 31 /** … … 109 110 if (fd != null || fd1 != null) { 110 111 datagramSocketClose(); 112 ResourceManager.afterUdpClose(); 111 113 fd = null; 112 114 fd1 = null; -
trunk/openjdk/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java
r278 r309 1 1 /* 2 * Copyright (c) 2002, 20 07, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 309 309 int numKeysUpdated = 0; 310 310 numKeysUpdated += processFDSet(updateCount, readFds, 311 PollArrayWrapper.POLLIN); 311 PollArrayWrapper.POLLIN, 312 false); 312 313 numKeysUpdated += processFDSet(updateCount, writeFds, 313 314 PollArrayWrapper.POLLCONN | 314 PollArrayWrapper.POLLOUT); 315 PollArrayWrapper.POLLOUT, 316 false); 315 317 numKeysUpdated += processFDSet(updateCount, exceptFds, 316 318 PollArrayWrapper.POLLIN | 317 319 PollArrayWrapper.POLLCONN | 318 PollArrayWrapper.POLLOUT); 320 PollArrayWrapper.POLLOUT, 321 true); 319 322 return numKeysUpdated; 320 323 } … … 328 331 * me.updateCount <= me.clearedCount <= updateCount 329 332 */ 330 private int processFDSet(long updateCount, int[] fds, int rOps) { 333 private int processFDSet(long updateCount, int[] fds, int rOps, 334 boolean isExceptFds) { 331 335 int numKeysUpdated = 0; 332 336 for (int i = 1; i <= fds[0]; i++) { … … 344 348 continue; 345 349 SelectionKeyImpl sk = me.ski; 350 351 // The descriptor may be in the exceptfds set because there is 352 // OOB data queued to the socket. If there is OOB data then it 353 // is discarded and the key is not added to the selected set. 354 if (isExceptFds && 355 (sk.channel() instanceof SocketChannelImpl) && 356 discardUrgentData(desc)) 357 { 358 continue; 359 } 360 346 361 if (selectedKeys.contains(sk)) { // Key in selected set 347 362 if (me.clearedCount != updateCount) { … … 450 465 private native void resetWakeupSocket0(int wakeupSourceFd); 451 466 467 private native boolean discardUrgentData(int fd); 468 452 469 // We increment this counter on each call to updateSelectedKeys() 453 470 // each entry in SubSelector.fdsMap has a memorized value of -
trunk/openjdk/jdk/src/windows/classes/sun/security/provider/NativeSeedGenerator.java
r278 r309 1 1 /* 2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 54 54 private static native boolean nativeGenerateSeed(byte[] result); 55 55 56 @Override 56 57 void getSeedBytes(byte[] result) { 57 58 // fill array as a side effect … … 63 64 } 64 65 65 byte getSeedByte() {66 byte[] b = new byte[1];67 getSeedBytes(b);68 return b[0];69 }70 66 } -
trunk/openjdk/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c
r278 r309 1 1 /* 2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 212 212 } 213 213 } 214 215 JNIEXPORT jboolean JNICALL 216 Java_sun_nio_ch_WindowsSelectorImpl_discardUrgentData(JNIEnv* env, jobject this, 217 jint s) 218 { 219 char data[8]; 220 jboolean discarded = JNI_FALSE; 221 int n; 222 do { 223 n = recv(s, data, sizeof(data), MSG_OOB); 224 if (n > 0) { 225 discarded = JNI_TRUE; 226 } 227 } while (n > 0); 228 return discarded; 229 } 230 -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp
r278 r309 5421 5421 { 5422 5422 sm_suppressFocusAndActivation = TRUE; 5423 5424 if (bEnable && IsTopLevel()) { 5425 // we should not enable blocked toplevels 5426 bEnable = !::IsWindow(AwtWindow::GetModalBlocker(GetHWnd())); 5427 } 5423 5428 ::EnableWindow(GetHWnd(), bEnable); 5429 5424 5430 sm_suppressFocusAndActivation = FALSE; 5425 5431 CriticalSection::Lock l(GetLock()); -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Dialog.cpp
r278 r309 274 274 HWND blocker = AwtWindow::GetModalBlocker(AwtComponent::GetTopLevelParentForWindow(hWnd)); 275 275 HWND topMostBlocker = blocker; 276 HWND prevForegroundWindow = ::GetForegroundWindow(); 277 if (::IsWindow(blocker)) { 278 ::BringWindowToTop(hWnd); 279 } 276 280 while (::IsWindow(blocker)) { 277 281 topMostBlocker = blocker; … … 283 287 // or the dialog is currently inactive 284 288 if ((::WindowFromPoint(mhs->pt) == hWnd) && 285 ( ::GetForegroundWindow()== topMostBlocker))289 (prevForegroundWindow == topMostBlocker)) 286 290 { 287 291 ::MessageBeep(MB_OK); … … 293 297 ::SetForegroundWindow(topMostBlocker); 294 298 } 299 return 1; 295 300 } 296 301 } -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp
r278 r309 246 246 247 247 fileBuffer = new TCHAR[MAX_PATH+1]; 248 memset(fileBuffer, 0, (MAX_PATH+1) * sizeof(TCHAR)); 248 249 249 250 file = (jstring)env->GetObjectField(target, AwtFileDialog::fileID); 250 251 if (file != NULL) { 251 252 LPCTSTR tmp = JNU_GetStringPlatformChars(env, file, NULL); 252 _tcs cpy(fileBuffer, tmp);253 _tcsncpy(fileBuffer, tmp, MAX_PATH-1); // the fileBuffer is double null terminated string 253 254 JNU_ReleaseStringPlatformChars(env, file, tmp); 254 255 } else { -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Window.cpp
r278 r309 189 189 190 190 ::RemoveProp(GetHWnd(), ModalBlockerProp); 191 ::RemoveProp(GetHWnd(), ModalSaveWSEXProp);192 191 193 192 if (m_grabbedWindow == this) { … … 1471 1470 return; 1472 1471 } 1473 DWORD exStyle = ::GetWindowLong(window, GWL_EXSTYLE); 1472 1474 1473 if (::IsWindow(blocker)) { 1475 // save WS_EX_NOACTIVATE and WS_EX_APPWINDOW styles1476 DWORD saveStyle = exStyle & (AWT_WS_EX_NOACTIVATE | WS_EX_APPWINDOW);1477 ::SetProp(window, ModalSaveWSEXProp, reinterpret_cast<HANDLE>(saveStyle));1478 ::SetWindowLong(window, GWL_EXSTYLE, (exStyle | AWT_WS_EX_NOACTIVATE) & ~WS_EX_APPWINDOW);1479 1474 ::SetProp(window, ModalBlockerProp, reinterpret_cast<HANDLE>(blocker)); 1475 ::EnableWindow(window, FALSE); 1480 1476 } else { 1481 // restore WS_EX_NOACTIVATE and WS_EX_APPWINDOW styles1482 DWORD saveStyle = reinterpret_cast<DWORD>(::GetProp(window, ModalSaveWSEXProp));1483 ::SetWindowLong(window, GWL_EXSTYLE,1484 (exStyle & ~(AWT_WS_EX_NOACTIVATE | WS_EX_APPWINDOW)) | saveStyle);1485 ::RemoveProp(window, ModalSaveWSEXProp);1486 1477 ::RemoveProp(window, ModalBlockerProp); 1478 AwtComponent *comp = AwtComponent::GetComponent(window); 1479 // we don't expect to be called with non-java HWNDs 1480 DASSERT(comp && comp->IsTopLevel()); 1481 // we should not unblock disabled toplevels 1482 ::EnableWindow(window, comp->isEnabled()); 1487 1483 } 1488 1484 } -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Window.h
r278 r309 34 34 // property name tagging windows disabled by modality 35 35 static LPCTSTR ModalBlockerProp = TEXT("SunAwtModalBlockerProp"); 36 static LPCTSTR ModalSaveWSEXProp = TEXT("SunAwtModalSaveWSEXProp");37 36 static LPCTSTR ModalDialogPeerProp = TEXT("SunAwtModalDialogPeerProp"); 38 37
Note:
See TracChangeset
for help on using the changeset viewer.