VirtualBox

Ignore:
Timestamp:
May 21, 2019 11:32:08 AM (6 years ago)
Author:
vboxsync
Message:

winnt/vboxsf: Workaround for xpsp2 MmGetSystemRoutineAddress crash. bugref:9172

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.cpp

    r78584 r78628  
    2222#include "vbsf.h"
    2323#include <iprt/initterm.h>
     24#include <iprt/dbg.h>
    2425
    2526
     
    662663    }
    663664
    664     /* Resolve newer kernel APIs we might want to use: */
    665     UNICODE_STRING RoutineName;
    666     RtlInitUnicodeString(&RoutineName, L"CcCoherencyFlushAndPurgeCache");
    667     g_pfnCcCoherencyFlushAndPurgeCache = (PFNCCCOHERENCYFLUSHANDPURGECACHE)MmGetSystemRoutineAddress(&RoutineName);
     665    /*
     666     * Resolve newer kernel APIs we might want to use.
     667     * Note! Because of http://www.osronline.com/article.cfm%5eid=494.htm we cannot
     668     *       use MmGetSystemRoutineAddress here as it will crash on xpsp2.
     669     */
     670    RTDBGKRNLINFO hKrnlInfo;
     671    int rc = RTR0DbgKrnlInfoOpen(&hKrnlInfo, 0/*fFlags*/);
     672    AssertLogRelRC(rc);
     673    if (RT_SUCCESS(rc))
     674    {
     675        g_pfnCcCoherencyFlushAndPurgeCache
     676            = (PFNCCCOHERENCYFLUSHANDPURGECACHE)RTR0DbgKrnlInfoGetSymbol(hKrnlInfo, NULL, "CcCoherencyFlushAndPurgeCache");
     677        RTR0DbgKrnlInfoRelease(hKrnlInfo);
     678    }
    668679
    669680    /* Init the driver object. */
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