VirtualBox

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/HostDrivers/VBoxUSB/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp

    r82968 r85121  
    18201820
    18211821
    1822 static VOID CALLBACK usbLibTimerCallback(__in PVOID lpParameter, __in BOOLEAN TimerOrWaitFired)
     1822static VOID CALLBACK usbLibTimerCallback(__in PVOID lpParameter, __in BOOLEAN TimerOrWaitFired) RT_NOTHROW_DEF
    18231823{
    18241824    RT_NOREF2(lpParameter, TimerOrWaitFired);
     
    18861886}
    18871887
    1888 /** @todo r=bird: Use an IPRT thread? */
    1889 static DWORD WINAPI usbLibMsgThreadProc(__in LPVOID lpParameter)
     1888/** @todo r=bird: Use an IPRT thread!! */
     1889static DWORD WINAPI usbLibMsgThreadProc(__in LPVOID lpParameter) RT_NOTHROW_DEF
    18901890{
    18911891    static LPCSTR   s_szVBoxUsbWndClassName = "VBoxUsbLibClass";
     
    20502050                        if (g_VBoxUsbGlobal.hTimerQueue)
    20512051                        {
     2052/** @todo r=bird: Which lunatic used CreateThread here?!?
     2053 *  Only the CRT uses CreateThread. */
    20522054                            g_VBoxUsbGlobal.hThread = CreateThread(
    20532055                              NULL, /*__in_opt   LPSECURITY_ATTRIBUTES lpThreadAttributes, */
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.h

    r82968 r85121  
    6060void vboxUsbDbgPrintUnicodeString(PUNICODE_STRING pUnicodeString);
    6161
    62 typedef DECLCALLBACK(BOOLEAN) FNVBOXUSBMONDEVWALKER(PFILE_OBJECT pHubFile, PDEVICE_OBJECT pHubDo, PVOID pvContext);
     62typedef DECLCALLBACKTYPE(BOOLEAN, FNVBOXUSBMONDEVWALKER,(PFILE_OBJECT pHubFile, PDEVICE_OBJECT pHubDo, PVOID pvContext));
    6363typedef FNVBOXUSBMONDEVWALKER *PFNVBOXUSBMONDEVWALKER;
    6464
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