VirtualBox

Changeset 85121 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Jul 8, 2020 7:33:26 PM (4 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h: Refactored the typedef use of DECLCALLBACK as well as DECLCALLBACKMEMBER to wrap the whole expression, similar to the DECLR?CALLBACKMEMBER macros. This allows adding a throw() at the end when compiling with the VC++ compiler to indicate that the callbacks won't throw anything, so we can stop supressing the C5039 warning about passing functions that can potential throw C++ exceptions to extern C code that can't necessarily cope with such (unwind,++). Introduced a few _EX variations that allows specifying different/no calling convention too, as that's handy when dynamically resolving host APIs. Fixed numerous places missing DECLCALLBACK and such. Left two angry @todos regarding use of CreateThread. bugref:9794

Location:
trunk/src/VBox/Devices/Network
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevINIP.cpp

    r82968 r85121  
    245245 * @param   netif   Interface to configure.
    246246 */
    247 static err_t devINIPInterface(struct netif *netif)
     247static err_t devINIPInterface(struct netif *netif) RT_NOTHROW_DEF
    248248{
    249249    LogFlow(("%s: netif=%p\n", __FUNCTION__, netif));
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r82968 r85121  
    412412 * @thread  NAT
    413413 */
    414 static void drvNATSendWorker(PDRVNAT pThis, PPDMSCATTERGATHER pSgBuf)
     414static DECLCALLBACK(void) drvNATSendWorker(PDRVNAT pThis, PPDMSCATTERGATHER pSgBuf)
    415415{
    416416#if 0 /* Assertion happens often to me after resuming a VM -- no time to investigate this now. */
     
    656656 * @thread "NAT" thread.
    657657 */
    658 static void drvNATNotifyLinkChangedWorker(PDRVNAT pThis, PDMNETWORKLINKSTATE enmLinkState)
     658static DECLCALLBACK(void) drvNATNotifyLinkChangedWorker(PDRVNAT pThis, PDMNETWORKLINKSTATE enmLinkState)
    659659{
    660660    pThis->enmLinkState = pThis->enmLinkStateWant = enmLinkState;
     
    712712}
    713713
    714 static void drvNATNotifyApplyPortForwardCommand(PDRVNAT pThis, bool fRemove,
    715                                                 bool fUdp, const char *pHostIp,
    716                                                 uint16_t u16HostPort, const char *pGuestIp, uint16_t u16GuestPort)
     714static DECLCALLBACK(void) drvNATNotifyApplyPortForwardCommand(PDRVNAT pThis, bool fRemove,
     715                                                              bool fUdp, const char *pHostIp,
     716                                                              uint16_t u16HostPort, const char *pGuestIp, uint16_t u16GuestPort)
    717717{
    718718    struct in_addr guestIp, hostIp;
  • trunk/src/VBox/Devices/Network/lwip-new/vbox/VBoxLwipCore.cpp

    r82968 r85121  
    4646}
    4747
    48 typedef struct {
     48typedef struct LWIPCOREUSERCALLBACK
     49{
    4950    PFNRT1 pfn;
    5051    void *pvUser;
     
    6465
    6566/**
    66  * @note: this function executes on TCPIP thread.
    67  */
    68 static void lwipCoreUserCallback(void *pvArg)
     67 * @note this function executes on TCPIP thread.
     68 */
     69static void lwipCoreUserCallback(void *pvArg) RT_NOTHROW_DEF
    6970{
    7071    LogFlowFunc(("ENTER: pvArg:%p\n", pvArg));
     
    8182
    8283/**
    83  * @note: this function executes on TCPIP thread.
    84  */
    85 static void lwipCoreInitDone(void *pvArg)
     84 * @note this function executes on TCPIP thread.
     85 */
     86static void lwipCoreInitDone(void *pvArg) RT_NOTHROW_DEF
    8687{
    8788    LogFlowFunc(("ENTER: pvArg:%p\n", pvArg));
     
    9596
    9697/**
    97  * @note: this function executes on TCPIP thread.
    98  */
    99 static void lwipCoreFiniDone(void *pvArg)
     98 * @note this function executes on TCPIP thread.
     99 */
     100static void lwipCoreFiniDone(void *pvArg) RT_NOTHROW_DEF
    100101{
    101102    LogFlowFunc(("ENTER: pvArg:%p\n", pvArg));
  • trunk/src/VBox/Devices/Network/lwip-new/vbox/VBoxLwipCore.h

    r82968 r85121  
    2323#endif
    2424
    25 
    26 typedef DECLCALLBACKPTR(void, PFNRT1)(void *);
    27 
    2825/**
    29  * initiliazes LWIP core, and do callback on tcp/ip thread
     26 * Initializes LWIP core, and do callback on tcp/ip thread.
    3027 */
    3128int vboxLwipCoreInitialize(PFNRT1 pfnCallback, void * pfnCallbackArg);
    3229void vboxLwipCoreFinalize(PFNRT1 pfnCallback, void * pfnCallbackArg);
     30
    3331#endif /* !VBOX_INCLUDED_SRC_Network_lwip_new_vbox_VBoxLwipCore_h */
  • trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp

    r83815 r85121  
    7676 * @param   pvUser2     The second user argument.
    7777 */
    78 typedef DECLCALLBACK(void) FNSUPDRVDESTRUCTOR(void *pvObj, void *pvUser1, void *pvUser2);
     78typedef DECLCALLBACKTYPE(void, FNSUPDRVDESTRUCTOR,(void *pvObj, void *pvUser1, void *pvUser2));
    7979/** Pointer to a FNSUPDRVDESTRUCTOR(). */
    8080typedef FNSUPDRVDESTRUCTOR *PFNSUPDRVDESTRUCTOR;
Note: See TracChangeset for help on using the changeset viewer.

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