VirtualBox

Changeset 9582 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Jun 10, 2008 11:38:18 PM (17 years ago)
Author:
vboxsync
Message:

Query the procedures in the init function.

Location:
trunk/src/VBox/Runtime/r0drv/nt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp

    r9563 r9582  
    5353RTCPUSET g_rtMpNtCpuSet;
    5454
     55/** ExSetTimerResolution, introduced in W2K. */
     56PFNMYEXSETTIMERRESOLUTION g_pfnrtNtExSetTimerResolution;
     57/** KeFlushQueuedDpcs, introduced in XP. */
     58PFNMYKEFLUSHQUEUEDDPCS g_pfnrtNtKeFlushQueuedDpcs;
     59
    5560
    5661int rtR0InitNative(void)
     
    6267    RTCpuSetEmpty(&g_rtMpNtCpuSet);
    6368    RTCpuSetFromU64(&g_rtMpNtCpuSet, ActiveProcessors);
     69
     70    /*
     71     * Initialize the function pointers.
     72     */
     73    UNICODE_STRING RoutineName;
     74    RtlInitUnicodeString(&RoutineName, L"ExSetTimerResolution");
     75    g_pfnrtNtExSetTimerResolution = (PFNMYEXSETTIMERRESOLUTION)MmGetSystemRoutineAddress(&RoutineName);
     76
     77    RtlInitUnicodeString(&RoutineName, L"KeFlushQueuedDpcs");
     78    g_pfnrtNtKeFlushQueuedDpcs = (PFNMYKEFLUSHQUEUEDDPCS)MmGetSystemRoutineAddress(&RoutineName);
     79
    6480
    6581#if 0 /* W2K8 support */
  • trunk/src/VBox/Runtime/r0drv/nt/internal-r0drv-nt.h

    r9563 r9582  
    3636__BEGIN_DECLS
    3737
     38/*******************************************************************************
     39*   Structures and Typedefs                                                    *
     40*******************************************************************************/
     41typedef ULONG (__stdcall *PFNMYEXSETTIMERRESOLUTION)(ULONG, BOOLEAN);
     42typedef VOID (__stdcall *PFNMYKEFLUSHQUEUEDDPCS)(VOID);
     43
    3844
    3945/*******************************************************************************
     
    4147*******************************************************************************/
    4248extern RTCPUSET g_rtMpNtCpuSet;
     49extern PFNMYEXSETTIMERRESOLUTION g_pfnrtNtExSetTimerResolution;
     50extern PFNMYKEFLUSHQUEUEDDPCS g_pfnrtNtKeFlushQueuedDpcs;
    4351
    4452
  • trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp

    r9563 r9582  
    188188
    189189    /* KeFlushQueuedDpcs is not present in Windows 2000; import it dynamically so we can just fail this call. */
    190     UNICODE_STRING  RoutineName;
    191     RtlInitUnicodeString(&RoutineName, L"KeFlushQueuedDpcs");
    192     VOID (*pfnKeFlushQueuedDpcs)(VOID) = (VOID (*)(VOID))MmGetSystemRoutineAddress(&RoutineName);
    193     if (!pfnKeFlushQueuedDpcs)
     190    if (!g_pfnrtNtKeFlushQueuedDpcs)
    194191        return VERR_NOT_SUPPORTED;
    195192
     
    258255
    259256    /* Flush all DPCs and wait for completion. (can take long!) */
    260     pfnKeFlushQueuedDpcs();
     257    g_pfnrtNtKeFlushQueuedDpcs();
    261258
    262259    ExFreePool(pArgs);
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