[XDK] Fix x64 version of KeGetCurrentProcessorNumber() and add KeGetCurrentProcessorI...
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 21 Apr 2019 09:28:58 +0000 (11:28 +0200)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 18 Jan 2020 13:56:17 +0000 (14:56 +0100)
sdk/include/xdk/amd64/ke.h
sdk/include/xdk/kefuncs.h
sdk/include/xdk/x86/ke.h

index 90abb70..6421233 100644 (file)
@@ -152,6 +152,15 @@ KeRestoreFloatingPointState(
     return STATUS_SUCCESS;
 }
 
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+FORCEINLINE
+ULONG
+KeGetCurrentProcessorIndex(VOID)
+{
+    return __readgsdword(0x1a4);
+}
+#endif
+
 /* VOID
  * KeFlushIoBuffers(
  *   IN PMDL Mdl,
@@ -320,11 +329,14 @@ KeGetPcr(VOID)
     return (PKPCR)__readgsqword(FIELD_OFFSET(KPCR, Self));
 }
 
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+_CRT_DEPRECATE_TEXT("KeGetCurrentProcessorNumber is deprecated. Use KeGetCurrentProcessorNumberEx or KeGetCurrentProcessorIndex instead.")
+#endif
 FORCEINLINE
 ULONG
 KeGetCurrentProcessorNumber(VOID)
 {
-    return (ULONG)__readgsword(0x184);
+    return __readgsbyte(0x184);
 }
 
 $endif /* _NTDDK_ */
index d33a8a4..c710257 100644 (file)
@@ -44,19 +44,6 @@ KeInvalidateRangeAllCaches(
   _In_ PVOID BaseAddress,
   _In_ ULONG Length);
 $endif (_NTDDK_)
-$if (_NTIFS_)
-
-NTSTATUS
-NTAPI
-KeGetProcessorNumberFromIndex(
-  _In_ ULONG ProcIndex,
-  _Out_ PPROCESSOR_NUMBER ProcNumber);
-
-ULONG
-NTAPI
-KeGetProcessorIndexFromNumber(
-  _In_ PPROCESSOR_NUMBER ProcNumber);
-$endif (_NTIFS_)
 
 #if (NTDDI_VERSION >= NTDDI_WIN2K)
 
index 5578f7f..f7ef92c 100644 (file)
@@ -169,6 +169,16 @@ NTAPI
 KeRestoreFloatingPointState(
   _In_ PKFLOATING_SAVE FloatSave);
 
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+FORCEINLINE
+ULONG
+NTAPI
+KeGetCurrentProcessorIndex(VOID)
+{
+    return __readfsbyte(0x51);
+}
+#endif
+
 /* VOID
  * KeFlushIoBuffers(
  *   IN PMDL Mdl,
@@ -315,6 +325,9 @@ typedef struct _KPCR {
   ULONG HalReserved[16];
 } KPCR, *PKPCR;
 
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+_CRT_DEPRECATE_TEXT("KeGetCurrentProcessorNumber is deprecated. Use KeGetCurrentProcessorNumberEx or KeGetCurrentProcessorIndex instead.")
+#endif
 FORCEINLINE
 ULONG
 KeGetCurrentProcessorNumber(VOID)