[WDM]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 12 Mar 2010 17:48:50 +0000 (17:48 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 12 Mar 2010 17:48:50 +0000 (17:48 +0000)
- fix definition of KeTickCount
- Add KeQueryTickCount (note: MS version is very hacky. Someone tell them how to use DECLSPEC_IMPORT)

svn path=/branches/header-work/; revision=46143

include/ddk/wdm.h

index 321b95c..759cd44 100644 (file)
@@ -5194,7 +5194,7 @@ typedef struct _KFLOATING_SAVE {
   ULONG  Spare1;
 } KFLOATING_SAVE, *PKFLOATING_SAVE;
 
-extern volatile KSYSTEM_TIME KeTickCount;
+extern NTKERNELAPI volatile KSYSTEM_TIME KeTickCount;
 
 #define YieldProcessor _mm_pause
 
@@ -5295,6 +5295,21 @@ KeRestoreFloatingPointState(
 /* x86 and x64 performs a 0x2C interrupt */
 #define DbgRaiseAssertionFailure __int2c
 
+FORCEINLINE
+VOID
+_KeQueryTickCount(
+  OUT PLARGE_INTEGER CurrentCount)
+{
+    for (;;)
+    {
+        CurrentCount->HighPart = KeTickCount.High1Time;
+        CurrentCount->LowPart = KeTickCount.LowPart;
+        if (CurrentCount->HighPart == KeTickCount.High2Time) break;
+        YieldProcessor();
+    }
+}
+#define KeQueryTickCount(CurrentCount) _KeQueryTickCount(CurrentCount)
+
 #endif /* _X86_ */