VirtualBox

Changeset 76098 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Dec 10, 2018 9:07:39 AM (6 years ago)
Author:
vboxsync
Message:

Additions/VBoxTray: Added VBoxTrayShowError() and warn if VBoxHook.dll is not found. Otherwise VBoxTray will fail without any hint whatsoever what went wrong. Annoying.

Location:
trunk/src/VBox/Additions/WINNT/VBoxTray
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSeamless.cpp

    r69500 r76098  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9999        }
    100100        else
     101        {
     102            if (rc == VERR_FILE_NOT_FOUND)
     103                VBoxTrayShowError("VBoxHook.dll not found");
     104
    101105            LogFlowFunc(("Unable to load %s, rc=%Rrc\n", VBOXHOOK_DLL_NAME, rc));
     106        }
    102107    }
    103108
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp

    r75407 r76098  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    585585    }
    586586    else
    587         MessageBoxA(GetDesktopWindow(), ErrInfo.szMsg, "VBoxTray - Logging Error", MB_OK | MB_ICONERROR);
     587        VBoxTrayShowError(ErrInfo.szMsg);
    588588
    589589    return rc;
     
    593593{
    594594    RTLogDestroy(RTLogRelSetDefaultInstance(NULL));
     595}
     596
     597/**
     598 * Displays an error message.
     599 *
     600 * @returns RTEXITCODE_FAILURE.
     601 * @param   pszFormat   The message text.
     602 * @param   ...         Format arguments.
     603 */
     604RTEXITCODE VBoxTrayShowError(const char *pszFormat, ...)
     605{
     606    va_list args;
     607    va_start(args, pszFormat);
     608    char *psz = NULL;
     609    RTStrAPrintfV(&psz, pszFormat, args);
     610    va_end(args);
     611
     612    AssertPtr(psz);
     613    LogRel(("Error: %s", psz));
     614
     615    MessageBox(GetDesktopWindow(), psz, "VBoxTray - Error", MB_OK | MB_ICONERROR);
     616
     617    RTStrFree(psz);
     618
     619    return RTEXITCODE_FAILURE;
    595620}
    596621
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.h

    r69500 r76098  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    188188extern uint32_t     g_fGuestDisplaysChanged;
    189189
     190RTEXITCODE VBoxTrayShowError(const char *pszFormat, ...);
     191
    190192#endif /* !___VBOXTRAY_H */
    191193
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