Ignore:
Timestamp:
Feb 13, 2012, 10:07:12 PM (14 years ago)
Author:
dmik
Message:

trunk: Merged in openjdk6 b24 from branches/vendor/oracle.

Location:
trunk/openjdk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk

  • trunk/openjdk/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java

    r278 r309  
    2727import java.io.IOException;
    2828import java.io.FileDescriptor;
     29import sun.net.ResourceManager;
    2930
    3031/**
     
    109110        if (fd != null || fd1 != null) {
    110111            datagramSocketClose();
     112            ResourceManager.afterUdpClose();
    111113            fd = null;
    112114            fd1 = null;
  • trunk/openjdk/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java

    r278 r309  
    11/*
    2  * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    309309            int numKeysUpdated = 0;
    310310            numKeysUpdated += processFDSet(updateCount, readFds,
    311                                            PollArrayWrapper.POLLIN);
     311                                           PollArrayWrapper.POLLIN,
     312                                           false);
    312313            numKeysUpdated += processFDSet(updateCount, writeFds,
    313314                                           PollArrayWrapper.POLLCONN |
    314                                            PollArrayWrapper.POLLOUT);
     315                                           PollArrayWrapper.POLLOUT,
     316                                           false);
    315317            numKeysUpdated += processFDSet(updateCount, exceptFds,
    316318                                           PollArrayWrapper.POLLIN |
    317319                                           PollArrayWrapper.POLLCONN |
    318                                            PollArrayWrapper.POLLOUT);
     320                                           PollArrayWrapper.POLLOUT,
     321                                           true);
    319322            return numKeysUpdated;
    320323        }
     
    328331         * me.updateCount <= me.clearedCount <= updateCount
    329332         */
    330         private int processFDSet(long updateCount, int[] fds, int rOps) {
     333        private int processFDSet(long updateCount, int[] fds, int rOps,
     334                                 boolean isExceptFds) {
    331335            int numKeysUpdated = 0;
    332336            for (int i = 1; i <= fds[0]; i++) {
     
    344348                    continue;
    345349                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
    346361                if (selectedKeys.contains(sk)) { // Key in selected set
    347362                    if (me.clearedCount != updateCount) {
     
    450465    private native void resetWakeupSocket0(int wakeupSourceFd);
    451466
     467    private native boolean discardUrgentData(int fd);
     468
    452469    // We increment this counter on each call to updateSelectedKeys()
    453470    // each entry in  SubSelector.fdsMap has a memorized value of
  • trunk/openjdk/jdk/src/windows/classes/sun/security/provider/NativeSeedGenerator.java

    r278 r309  
    11/*
    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.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    5454    private static native boolean nativeGenerateSeed(byte[] result);
    5555
     56    @Override
    5657    void getSeedBytes(byte[] result) {
    5758        // fill array as a side effect
     
    6364    }
    6465
    65     byte getSeedByte() {
    66         byte[] b = new byte[1];
    67         getSeedBytes(b);
    68         return b[0];
    69     }
    7066}
  • trunk/openjdk/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c

    r278 r309  
    11/*
    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.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    212212    }
    213213}
     214
     215JNIEXPORT jboolean JNICALL
     216Java_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  
    54215421{
    54225422    sm_suppressFocusAndActivation = TRUE;
     5423
     5424    if (bEnable && IsTopLevel()) {
     5425        // we should not enable blocked toplevels
     5426        bEnable = !::IsWindow(AwtWindow::GetModalBlocker(GetHWnd()));
     5427    }
    54235428    ::EnableWindow(GetHWnd(), bEnable);
     5429
    54245430    sm_suppressFocusAndActivation = FALSE;
    54255431    CriticalSection::Lock l(GetLock());
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Dialog.cpp

    r278 r309  
    274274            HWND blocker = AwtWindow::GetModalBlocker(AwtComponent::GetTopLevelParentForWindow(hWnd));
    275275            HWND topMostBlocker = blocker;
     276            HWND prevForegroundWindow = ::GetForegroundWindow();
     277            if (::IsWindow(blocker)) {
     278                ::BringWindowToTop(hWnd);
     279            }
    276280            while (::IsWindow(blocker)) {
    277281                topMostBlocker = blocker;
     
    283287                // or the dialog is currently inactive
    284288                if ((::WindowFromPoint(mhs->pt) == hWnd) &&
    285                     (::GetForegroundWindow() == topMostBlocker))
     289                    (prevForegroundWindow == topMostBlocker))
    286290                {
    287291                    ::MessageBeep(MB_OK);
     
    293297                    ::SetForegroundWindow(topMostBlocker);
    294298                }
     299                return 1;
    295300            }
    296301        }
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp

    r278 r309  
    246246
    247247        fileBuffer = new TCHAR[MAX_PATH+1];
     248        memset(fileBuffer, 0, (MAX_PATH+1) * sizeof(TCHAR));
    248249
    249250        file = (jstring)env->GetObjectField(target, AwtFileDialog::fileID);
    250251        if (file != NULL) {
    251252            LPCTSTR tmp = JNU_GetStringPlatformChars(env, file, NULL);
    252             _tcscpy(fileBuffer, tmp);
     253            _tcsncpy(fileBuffer, tmp, MAX_PATH-1); // the fileBuffer is double null terminated string
    253254            JNU_ReleaseStringPlatformChars(env, file, tmp);
    254255        } else {
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Window.cpp

    r278 r309  
    189189
    190190    ::RemoveProp(GetHWnd(), ModalBlockerProp);
    191     ::RemoveProp(GetHWnd(), ModalSaveWSEXProp);
    192191
    193192    if (m_grabbedWindow == this) {
     
    14711470        return;
    14721471    }
    1473     DWORD exStyle = ::GetWindowLong(window, GWL_EXSTYLE);
     1472
    14741473    if (::IsWindow(blocker)) {
    1475         // save WS_EX_NOACTIVATE and WS_EX_APPWINDOW styles
    1476         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);
    14791474        ::SetProp(window, ModalBlockerProp, reinterpret_cast<HANDLE>(blocker));
     1475        ::EnableWindow(window, FALSE);
    14801476    } else {
    1481         // restore WS_EX_NOACTIVATE and WS_EX_APPWINDOW styles
    1482         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);
    14861477        ::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());
    14871483    }
    14881484}
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Window.h

    r278 r309  
    3434// property name tagging windows disabled by modality
    3535static LPCTSTR ModalBlockerProp = TEXT("SunAwtModalBlockerProp");
    36 static LPCTSTR ModalSaveWSEXProp = TEXT("SunAwtModalSaveWSEXProp");
    3736static LPCTSTR ModalDialogPeerProp = TEXT("SunAwtModalDialogPeerProp");
    3837
Note: See TracChangeset for help on using the changeset viewer.