VirtualBox

Changeset 28535 in vbox


Ignore:
Timestamp:
Apr 20, 2010 8:39:10 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60342
Message:

iprt: add RTSocketFromNative API

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/socket.h

    r27976 r28535  
    8787
    8888/**
     89 * Creates an IPRT socket handle from a native one.
     90 *
     91 * @returns IPRT status code.
     92 * @param   phSocket        Where to store the IPRT socket handle.
     93 * @param   uNative         The native handle.
     94 */
     95RTDECL(int) RTSocketFromNative(PRTSOCKET phSocket, RTHCINTPTR uNative);
     96
     97/**
    8998 * Gets the native socket handle.
    9099 *
  • trunk/src/VBox/Runtime/r3/socket.cpp

    r27791 r28535  
    263263    *ppSocket = pThis;
    264264    return VINF_SUCCESS;
     265}
     266
     267
     268RTDECL(int) RTSocketFromNative(PRTSOCKET phSocket, RTHCINTPTR uNative)
     269{
     270    AssertReturn(uNative != NIL_RTSOCKETNATIVE, VERR_INVALID_PARAMETER);
     271#ifndef RT_OS_WINDOWS
     272    AssertReturn(uNative >= 0, VERR_INVALID_PARAMETER);
     273#endif
     274    AssertPtrReturn(phSocket, VERR_INVALID_POINTER);
     275    return rtSocketCreateForNative(phSocket, uNative);
    265276}
    266277
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