[SDK:NDK/XDK] Remove x86 KeGetPcr() definition from the DDK (#6526)

The official MS DDK/WDK does not expose KeGetPcr() for x86, so do
not expose it there as well. Use instead the private NDK definition.

If it were exposed in the DDK/WDK, it would have to be a
multiprocessor-compatible definition.

Note that the broken definition was working only in single-processor
mode, using the PCR static memory pointer value.
The official MS DDK/WDK exposes KeGetPcr() as an alias to such a
PCR value only for IA64, MIPS and PPC, which is of course not great.
This commit is contained in:
Hermès Bélusca-Maïto 2024-02-23 22:53:36 +01:00
parent e6c0081c28
commit bf9cac8a67
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 15 additions and 3 deletions

View file

@ -283,8 +283,6 @@ typedef struct _CONTEXT {
} CONTEXT;
#include "poppack.h"
#define KeGetPcr() PCR
#define PCR_MINOR_VERSION 1
#define PCR_MAJOR_VERSION 1
@ -325,6 +323,18 @@ typedef struct _KPCR {
ULONG HalReserved[16];
} KPCR, *PKPCR;
/* NOTE: This macro is not exposed in the DDK/WDK for _M_IX86.
* If it were, this would be its definition. */
#if 0
// #define KeGetPcr() ((PKPCR)__readfsdword(FIELD_OFFSET(KPCR, SelfPcr)))
FORCEINLINE
PKPCR
KeGetPcr(VOID)
{
return (PKPCR)__readfsdword(FIELD_OFFSET(KPCR, SelfPcr));
}
#endif
#if (NTDDI_VERSION >= NTDDI_WIN7)
_CRT_DEPRECATE_TEXT("KeGetCurrentProcessorNumber is deprecated. Use KeGetCurrentProcessorNumberEx or KeGetCurrentProcessorIndex instead.")
#endif