VirtualBox

Ignore:
Timestamp:
Nov 7, 2024 9:15:48 AM (3 months ago)
Author:
vboxsync
Message:

Windows driver installation: Added vboxWinDrvWinErrToStr() to handle Windows error codes we don't handle in IPRT. bugref:10762

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/installation/VBoxWinDrvInst.cpp

    r106857 r106867  
    3939#include <iprt/cdefs.h>
    4040#include <iprt/dir.h>
    41 #include <iprt/err.h>
    4241#include <iprt/ldr.h>
    4342#include <iprt/list.h>
     
    5251#include "product-generated.h"
    5352
     53#include <VBox/err.h> /* For VERR_PLATFORM_ARCH_NOT_SUPPORTED.*/
    5454#include <VBox/version.h>
    5555
     
    497497
    498498/**
     499 * Returns a winerr.h error as a string.
     500 *
     501 * Needded to get at least a minimally meaningful error string back.
     502 *
     503 * @returns Error as a string, or NULL if not found.
     504 * @param   dwErr               Error code to return as a string.
     505 */
     506DECLINLINE(const char *) vboxWinDrvWinErrToStr(const DWORD dwErr)
     507{
     508    switch (dwErr)
     509    {
     510
     511        RT_CASE_RET_STR(ERROR_BADKEY                            );
     512        default:
     513            break;
     514    }
     515
     516    return NULL;
     517}
     518
     519/**
    499520 * Logs the last Windows error given via GetLastError().
    500521 *
     
    524545    /* Try resolving Setup API errors first (we don't handle those in IPRT). */
    525546    const char *pszErr = vboxWinDrvSetupApiErrToStr(dwErr);
     547    if (!pszErr) /* Also ask for special winerr.h codes we don't handle in IPRT. */
     548        pszErr = vboxWinDrvWinErrToStr(dwErr);
    526549    if (!pszErr)
    527550        rc = RTErrConvertFromWin32(dwErr);
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