VirtualBox

Changeset 17480 in vbox for trunk/src


Ignore:
Timestamp:
Mar 6, 2009 3:19:22 PM (16 years ago)
Author:
vboxsync
Message:

VBoxGuest/win: Added bugcheck callback routine for release log printing. Next step would be printing out some more information about the bugcheck itself.

Location:
trunk/src/VBox/Additions/WINNT/VBoxGuest
Files:
2 edited

Legend:

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

    r17163 r17480  
    6767static NTSTATUS VBoxGuestShutdown(PDEVICE_OBJECT pDevObj, PIRP pIrp);
    6868static NTSTATUS VBoxGuestNotSupportedStub(PDEVICE_OBJECT pDevObj, PIRP pIrp);
     69static VOID     VBoxGuestBugCheckCallback(PVOID pszBuffer, ULONG ulLength);
    6970static VOID     vboxWorkerThread(PVOID context);
    7071static VOID     reserveHypervisorMemory(PVBOXGUESTDEVEXT pDevExt);
     
    241242#endif
    242243
    243     // driver is ready now
     244    /*
     245     * Setup bugcheck callback routine ASAP.
     246     */
     247    RtlZeroMemory (pDevExt->szDriverName, sizeof(pDevExt->szDriverName));
     248    KeInitializeCallbackRecord(&pDevExt->bugcheckRecord);
     249
     250    if (FALSE == KeRegisterBugCheckCallback(&pDevExt->bugcheckRecord,
     251                                            &VBoxGuestBugCheckCallback,
     252                                            pDevExt->pcBugcheckBuffer,
     253                                            sizeof(&pDevExt->szDriverName),
     254                                            pDevExt->szDriverName))
     255    {
     256        dprintf(("VBoxGuest::VBoxGuestAddDevice: Could not register bugcheck callback routine!\n"));
     257    }
     258    else
     259    {
     260        dprintf(("VBoxGuest::VBoxGuestAddDevice: Bugcheck callback registered.\n"));
     261    }
     262
     263    /* Driver is ready now. */
    244264    deviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
    245265
     
    282302
    283303    VBoxCleanupMemBalloon(pDevExt);
     304
     305    /* Unregister bugcheck callback. */
     306    if (FALSE == KeDeregisterBugCheckCallback(&pDevExt->bugcheckRecord))
     307        dprintf(("VBoxGuest::VBoxGuestUnload: Unregistering bugcheck callback routine failed!\n"));
    284308
    285309    /*
     
    295319        RTSpinlockDestroy(pDevExt->SessionSpinlock);
    296320#endif
    297 
    298321    IoDeleteDevice(pDrvObj->DeviceObject);
    299322#endif
     323
    300324    dprintf(("VBoxGuest::VBoxGuestUnload: returning\n"));
    301325}
     
    15101534}
    15111535
     1536VOID VBoxGuestBugCheckCallback(PVOID pszBuffer, ULONG ulLength)
     1537{
     1538    LogRelBackdoor(("Windows bluescreen detected! "));
     1539    if (pszBuffer)
     1540    {
     1541        LogRelBackdoor(("Additional information: %s\n", (char*)pszBuffer));
     1542    }
     1543    else LogRelBackdoor(("No additional information given.\n"));
     1544
     1545    /* @todo Notify the host somehow over DevVMM. */
     1546}
     1547
    15121548/**
    15131549 * Worker thread to do periodic things such as notify other
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest_Internal.h

    r17165 r17480  
    156156/////
    157157
    158 
     158    // the driver name
     159    UCHAR szDriverName[32];
    159160    // our functional driver object
    160161    PDEVICE_OBJECT deviceObject;
     
    215216    VMMDevPowerStateRequest *powerStateRequest;
    216217
     218    /* Record for bugcheck callback routine. */
     219    KBUGCHECK_CALLBACK_RECORD bugcheckRecord;
     220    CHAR* pcBugcheckBuffer;
     221
    217222} VBOXGUESTDEVEXT, *PVBOXGUESTDEVEXT;
    218223
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