VirtualBox

Changeset 85121 in vbox for trunk/src/VBox/Frontends


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/Frontends
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp

    r83797 r85121  
    726726 *                          Currently not used.
    727727 */
    728 static DWORD WINAPI autostartSvcWinServiceCtrlHandlerEx(DWORD dwControl, DWORD dwEventType, LPVOID pvEventData, LPVOID pvContext)
     728static DWORD WINAPI
     729autostartSvcWinServiceCtrlHandlerEx(DWORD dwControl, DWORD dwEventType, LPVOID pvEventData, LPVOID pvContext) RT_NOTHROW_DEF
    729730{
    730731    LogFlow(("autostartSvcWinServiceCtrlHandlerEx: dwControl=%#x dwEventType=%#x pvEventData=%p\n",
  • trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp

    r83829 r85121  
    302302 * unnecessary here.
    303303 */
    304 static void signalHandler(int iSignal)
     304static void signalHandler(int iSignal) RT_NOTHROW_DEF
    305305{
    306306    NOREF(iSignal);
     
    707707         */
    708708        signal(SIGINT,   signalHandler);
    709     #ifdef SIGBREAK
     709#ifdef SIGBREAK
    710710        signal(SIGBREAK, signalHandler);
    711     #endif
     711#endif
    712712
    713713        /*
  • trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdogInternal.h

    r83798 r85121  
    138138     * @returns VBox status code.
    139139     */
    140     DECLCALLBACKMEMBER(int, pfnPreInit)(void);
     140    DECLCALLBACKMEMBER(int, pfnPreInit,(void));
    141141
    142142    /**
     
    149149     *                      remaining arguments passed in.
    150150     */
    151     DECLCALLBACKMEMBER(int, pfnOption)(int argc, char *argv[], int *piConsumed);
     151    DECLCALLBACKMEMBER(int, pfnOption,(int argc, char *argv[], int *piConsumed));
    152152
    153153    /**
     
    155155     * @returns VBox status code.
    156156     */
    157     DECLCALLBACKMEMBER(int, pfnInit)(void);
     157    DECLCALLBACKMEMBER(int, pfnInit,(void));
    158158
    159159    /** Called from the watchdog's main function. Non-blocking.
     
    161161     * @returns VBox status code.
    162162     */
    163     DECLCALLBACKMEMBER(int, pfnMain)(void);
     163    DECLCALLBACKMEMBER(int, pfnMain,(void));
    164164
    165165    /**
    166166     * Stop the module.
    167167     */
    168     DECLCALLBACKMEMBER(int, pfnStop)(void);
     168    DECLCALLBACKMEMBER(int, pfnStop,(void));
    169169
    170170    /**
     
    173173     * @remarks This may be called even if pfnInit hasn't been called!
    174174     */
    175     DECLCALLBACKMEMBER(void, pfnTerm)(void);
     175    DECLCALLBACKMEMBER(void, pfnTerm,(void));
    176176
    177177    /** @name  Callbacks.
     
    183183     * @returns VBox status code.
    184184     */
    185     DECLCALLBACKMEMBER(int, pfnOnMachineRegistered)(const Bstr &strUuid);
    186 
    187     /**
    188      *
    189      * @returns VBox status code.
    190      */
    191     DECLCALLBACKMEMBER(int, pfnOnMachineUnregistered)(const Bstr &strUuid);
    192 
    193     /**
    194      *
    195      * @returns VBox status code.
    196      */
    197     DECLCALLBACKMEMBER(int, pfnOnMachineStateChanged)(const Bstr &strUuid, MachineState_T enmState);
    198 
    199     /**
    200      *
    201      * @returns VBox status code.
    202      */
    203     DECLCALLBACKMEMBER(int, pfnOnServiceStateChanged)(bool fAvailable);
     185    DECLCALLBACKMEMBER(int, pfnOnMachineRegistered,(const Bstr &strUuid));
     186
     187    /**
     188     *
     189     * @returns VBox status code.
     190     */
     191    DECLCALLBACKMEMBER(int, pfnOnMachineUnregistered,(const Bstr &strUuid));
     192
     193    /**
     194     *
     195     * @returns VBox status code.
     196     */
     197    DECLCALLBACKMEMBER(int, pfnOnMachineStateChanged,(const Bstr &strUuid, MachineState_T enmState));
     198
     199    /**
     200     *
     201     * @returns VBox status code.
     202     */
     203    DECLCALLBACKMEMBER(int, pfnOnServiceStateChanged,(bool fAvailable));
    204204
    205205    /** @} */
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r84692 r85121  
    188188 * unnecessary here.
    189189 */
    190 static void showProgressSignalHandler(int iSignal)
     190static void showProgressSignalHandler(int iSignal) RT_NOTHROW_DEF
    191191{
    192192    NOREF(iSignal);
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp

    r84570 r85121  
    377377
    378378#ifdef RT_OS_WINDOWS
    379 static BOOL WINAPI gctlSignalHandler(DWORD dwCtrlType)
     379static BOOL WINAPI gctlSignalHandler(DWORD dwCtrlType) RT_NOTHROW_DEF
    380380{
    381381    bool fEventHandled = FALSE;
     
    405405 * unnecessary here.
    406406 */
    407 static void gctlSignalHandler(int iSignal)
     407static void gctlSignalHandler(int iSignal) RT_NOTHROW_DEF
    408408{
    409409    NOREF(iSignal);
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp

    r82968 r85121  
    365365 * @remarks This is called on a new thread.
    366366 */
    367 static BOOL WINAPI ctrlHandler(DWORD dwCtrlType)
     367static BOOL WINAPI ctrlHandler(DWORD dwCtrlType) RT_NOTHROW_DEF
    368368{
    369369    switch (dwCtrlType)
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r82968 r85121  
    168168static void    HandleGuestCapsChanged(void);
    169169static int     HandleHostKey(const SDL_KeyboardEvent *pEv);
    170 static Uint32  StartupTimer(Uint32 interval, void *param);
    171 static Uint32  ResizeTimer(Uint32 interval, void *param);
    172 static Uint32  QuitTimer(Uint32 interval, void *param);
     170static Uint32  StartupTimer(Uint32 interval, void *param) RT_NOTHROW_PROTO;
     171static Uint32  ResizeTimer(Uint32 interval, void *param) RT_NOTHROW_PROTO;
     172static Uint32  QuitTimer(Uint32 interval, void *param) RT_NOTHROW_PROTO;
    173173static int     WaitSDLEvent(SDL_Event *event);
    174174static void    SetFullscreen(bool enable);
     
    50685068 * Timer callback function for startup processing
    50695069 */
    5070 static Uint32 StartupTimer(Uint32 interval, void *param)
     5070static Uint32 StartupTimer(Uint32 interval, void *param) RT_NOTHROW_DEF
    50715071{
    50725072    RT_NOREF(param);
     
    50845084 * Timer callback function to check if resizing is finished
    50855085 */
    5086 static Uint32 ResizeTimer(Uint32 interval, void *param)
     5086static Uint32 ResizeTimer(Uint32 interval, void *param) RT_NOTHROW_DEF
    50875087{
    50885088    RT_NOREF(interval, param);
     
    51005100 * Timer callback function to check if an ACPI power button event was handled by the guest.
    51015101 */
    5102 static Uint32 QuitTimer(Uint32 interval, void *param)
     5102static Uint32 QuitTimer(Uint32 interval, void *param) RT_NOTHROW_DEF
    51035103{
    51045104    RT_NOREF(interval, param);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp

    r84696 r85121  
    7777}
    7878
    79 static BOOL CALLBACK MonitorEnumProcF(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lpClipRect, LPARAM dwData)
     79static BOOL CALLBACK MonitorEnumProcF(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lpClipRect, LPARAM dwData) RT_NOTHROW_DEF
    8080{
    8181    /* These required for clipped screens only: */
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/win/VBoxUtils-win.cpp

    r82968 r85121  
    2424{
    2525    /** Enumerates visible always-on-top (top-most) windows. */
    26     BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam);
     26    BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) RT_NOTHROW_PROTO;
    2727    /** Contains visible top-most-window rectangles. */
    2828    QList<QRect> topMostRects;
    2929}
    3030
    31 BOOL CALLBACK NativeWindowSubsystem::EnumWindowsProc(HWND hWnd, LPARAM)
     31BOOL CALLBACK NativeWindowSubsystem::EnumWindowsProc(HWND hWnd, LPARAM) RT_NOTHROW_DEF
    3232{
    3333    /* Ignore NULL HWNDs: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r83686 r85121  
    12981298
    12991299/* static */
    1300 LRESULT CALLBACK UIKeyboardHandler::winKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
     1300LRESULT CALLBACK UIKeyboardHandler::winKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) RT_NOTHROW_DEF
    13011301{
    13021302    /* All keyboard class events needs to be handled: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.h

    r82968 r85121  
    157157#elif defined(VBOX_WS_WIN)
    158158    /** Win: Performs initial pre-processing of all the native keyboard events. */
    159     static LRESULT CALLBACK winKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam);
     159    static LRESULT CALLBACK winKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) RT_NOTHROW_PROTO;
    160160    /** Win: Performs initial pre-processing of all the native keyboard events. */
    161161    bool winKeyboardEvent(UINT msg, const KBDLLHOOKSTRUCT &event);
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