VirtualBox

Changeset 85121 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Jul 8, 2020 7:33:26 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139061
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/Main/src-client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r85015 r85121  
    17631763}
    17641764
    1765 /* static */
    1766 int Display::i_displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppbData, size_t *pcbData,
    1767                                         uint32_t *pcx, uint32_t *pcy, bool *pfMemFree)
     1765/*static*/ DECLCALLBACK(int)
     1766Display::i_displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppbData, size_t *pcbData,
     1767                                    uint32_t *pcx, uint32_t *pcy, bool *pfMemFree)
    17681768{
    17691769    int rc;
     
    21472147#endif /* VBOX_WITH_RECORDING */
    21482148
    2149 int Display::i_drawToScreenEMT(Display *pDisplay, ULONG aScreenId, BYTE *address,
    2150                               ULONG x, ULONG y, ULONG width, ULONG height)
     2149/*static*/ DECLCALLBACK(int)
     2150Display::i_drawToScreenEMT(Display *pDisplay, ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height)
    21512151{
    21522152    int rc = VINF_SUCCESS;
     
    23122312}
    23132313
    2314 int Display::i_InvalidateAndUpdateEMT(Display *pDisplay, unsigned uId, bool fUpdateAll)
     2314/*static*/ DECLCALLBACK(int) Display::i_InvalidateAndUpdateEMT(Display *pDisplay, unsigned uId, bool fUpdateAll)
    23152315{
    23162316    LogRelFlowFunc(("uId=%d, fUpdateAll %d\n", uId, fUpdateAll));
  • trunk/src/VBox/Main/src-client/HGCMThread.cpp

    r82968 r85121  
    146146        int MsgAlloc(HGCMMsgCore **pMsg, uint32_t u32MsgId, PFNHGCMNEWMSGALLOC pfnNewMessage);
    147147        int MsgGet(HGCMMsgCore **ppMsg);
    148         int MsgPost(HGCMMsgCore *pMsg, PHGCMMSGCALLBACK pfnCallback, bool bWait);
     148        int MsgPost(HGCMMsgCore *pMsg, PFNHGCMMSGCALLBACK pfnCallback, bool bWait);
    149149        int MsgComplete(HGCMMsgCore *pMsg, int32_t result);
    150150};
     
    400400}
    401401
    402 int HGCMThread::MsgPost(HGCMMsgCore *pMsg, PHGCMMSGCALLBACK pfnCallback, bool fWait)
     402int HGCMThread::MsgPost(HGCMMsgCore *pMsg, PFNHGCMMSGCALLBACK pfnCallback, bool fWait)
    403403{
    404404    LogFlow(("HGCMThread::MsgPost: thread = %p, pMsg = %p, pfnCallback = %p\n", this, pMsg, pfnCallback));
     
    694694}
    695695
    696 DECLINLINE(int) hgcmMsgPostInternal(HGCMMsgCore *pMsg, PHGCMMSGCALLBACK pfnCallback, bool fWait)
     696DECLINLINE(int) hgcmMsgPostInternal(HGCMMsgCore *pMsg, PFNHGCMMSGCALLBACK pfnCallback, bool fWait)
    697697{
    698698    LogFlow(("MAIN::hgcmMsgPostInternal: pMsg = %p, pfnCallback = %p, fWait = %d\n", pMsg, pfnCallback, fWait));
     
    709709}
    710710
    711 int hgcmMsgPost(HGCMMsgCore *pMsg, PHGCMMSGCALLBACK pfnCallback)
     711int hgcmMsgPost(HGCMMsgCore *pMsg, PFNHGCMMSGCALLBACK pfnCallback)
    712712{
    713713    int rc = hgcmMsgPostInternal(pMsg, pfnCallback, false);
  • trunk/src/VBox/Main/src-client/UsbCardReader.cpp

    r82968 r85121  
    595595}
    596596
    597 static int drvCardReaderWakeupFunc(PUSBCARDREADER pThis)
     597static DECLCALLBACK(int) drvCardReaderWakeupFunc(PUSBCARDREADER pThis)
    598598{
    599599    NOREF(pThis);
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