VirtualBox

Ignore:
Timestamp:
Jan 30, 2013 3:37:55 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83477
Message:

IPRT: Merging poll-win.cpp and poll-posix.cpp, part 1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/socket.cpp

    r44429 r44469  
    17701770}
    17711771
    1772 #ifdef RT_OS_WINDOWS
    17731772
    17741773/**
     
    17791778 * @param   hSocket             The socket handle.
    17801779 * @param   fEvents             The events we're polling for.
    1781  * @param   ph                  where to put the primary handle.
    1782  */
    1783 int rtSocketPollGetHandle(RTSOCKET hSocket, uint32_t fEvents, PHANDLE ph)
     1780 * @param   phNative            Where to put the primary handle.
     1781 */
     1782int rtSocketPollGetHandle(RTSOCKET hSocket, uint32_t fEvents, PRTHCINTPTR phNative)
    17841783{
    17851784    RTSOCKETINT *pThis = hSocket;
    17861785    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    17871786    AssertReturn(pThis->u32Magic == RTSOCKET_MAGIC, VERR_INVALID_HANDLE);
     1787#ifdef RT_OS_WINDOWS
    17881788    AssertReturn(rtSocketTryLock(pThis), VERR_CONCURRENT_ACCESS);
    17891789
    17901790    int rc = VINF_SUCCESS;
    17911791    if (pThis->hEvent != WSA_INVALID_EVENT)
    1792         *ph = pThis->hEvent;
    1793     else
    1794     {
    1795         *ph = pThis->hEvent = WSACreateEvent();
     1792        *phNative = (RTHCINTPTR)pThis->hEvent;
     1793    else
     1794    {
     1795        pThis->hEvent = WSACreateEvent();
     1796        *phNative = (RTHCINTPTR)pThis->hEvent;
    17961797        if (pThis->hEvent == WSA_INVALID_EVENT)
    17971798            rc = rtSocketError();
     
    18001801    rtSocketUnlock(pThis);
    18011802    return rc;
    1802 }
    1803 
     1803
     1804#else  /* !RT_OS_WINDOWS */
     1805    *phNative = (RTHCUINTPTR)pThis->hNative;
     1806    return VINF_SUCCESS;
     1807#endif /* !RT_OS_WINDOWS */
     1808}
     1809
     1810#ifdef RT_OS_WINDOWS
    18041811
    18051812/**
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette