mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 13:02:59 +00:00
[LDR][APPHELP] Add a shim that disables manifest compatibility version parsing
This commit is contained in:
parent
e12abf63c5
commit
343442cc3f
4 changed files with 38 additions and 25 deletions
|
@ -13,21 +13,16 @@ typedef struct _ReactOS_ShimData
|
|||
|
||||
|
||||
#define REACTOS_SHIMDATA_MAGIC 0xAC0DEDAB
|
||||
#define REACTOS_COMPATVERSION_UNINITIALIZED 0xfffffffe
|
||||
#define REACTOS_COMPATVERSION_IGNOREMANIFEST 0xffffffff
|
||||
|
||||
#ifndef WINVER_VISTA
|
||||
#define WINVER_VISTA 0x0600
|
||||
#define WINVER_WIN7 0x0601
|
||||
#define WINVER_WIN8 0x0602
|
||||
#define WINVER_WIN81 0x0603
|
||||
#define WINVER_WIN10 0x0a00
|
||||
#endif
|
||||
|
||||
// Returns values in the form of _WIN32_WINNT_VISTA, _WIN32_WINNT_WIN7 etc
|
||||
static
|
||||
inline
|
||||
DWORD RosGetProcessCompatVersion(VOID)
|
||||
{
|
||||
static DWORD g_CompatVersion = 0xffffffff;
|
||||
if (g_CompatVersion == 0xffffffff)
|
||||
static DWORD g_CompatVersion = REACTOS_COMPATVERSION_UNINITIALIZED;
|
||||
if (g_CompatVersion == REACTOS_COMPATVERSION_UNINITIALIZED)
|
||||
{
|
||||
ReactOS_ShimData* pShimData = (ReactOS_ShimData*)NtCurrentPeb()->pShimData;
|
||||
if (pShimData && pShimData->dwMagic == REACTOS_SHIMDATA_MAGIC &&
|
||||
|
@ -36,7 +31,7 @@ DWORD RosGetProcessCompatVersion(VOID)
|
|||
g_CompatVersion = pShimData->dwRosProcessCompatVersion;
|
||||
}
|
||||
}
|
||||
return g_CompatVersion != 0xffffffff ? g_CompatVersion : 0;
|
||||
return g_CompatVersion < REACTOS_COMPATVERSION_UNINITIALIZED ? g_CompatVersion : 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue