ReactOS 0.4.16-dev-2293-g4d8327b
compat_undoc.h
Go to the documentation of this file.
1#ifndef COMPAT_UNDOC_H
2#define COMPAT_UNDOC_H
3
4
5typedef struct _ReactOS_ShimData
6{
12
13#ifdef _M_AMD64
15#endif
17
18
19#define REACTOS_SHIMDATA_MAGIC 0xAC0DEDAB
20#define REACTOS_COMPATVERSION_UNINITIALIZED 0xfffffffe
21#define REACTOS_COMPATVERSION_IGNOREMANIFEST 0xffffffff
22
23// Returns values in the form of _WIN32_WINNT_VISTA, _WIN32_WINNT_WIN7 etc
24static
25inline
27{
28 static DWORD g_CompatVersion = REACTOS_COMPATVERSION_UNINITIALIZED;
29 if (g_CompatVersion == REACTOS_COMPATVERSION_UNINITIALIZED)
30 {
31 ReactOS_ShimData* pShimData = (ReactOS_ShimData*)NtCurrentPeb()->pShimData;
32 if (pShimData && pShimData->dwMagic == REACTOS_SHIMDATA_MAGIC &&
33 pShimData->dwSize == sizeof(ReactOS_ShimData))
34 {
35 g_CompatVersion = pShimData->dwRosProcessCompatVersion;
36 }
37 }
38 return g_CompatVersion < REACTOS_COMPATVERSION_UNINITIALIZED ? g_CompatVersion : 0;
39}
40
41static
42inline
44{
45 PPEB peb = NtCurrentPeb();
47 if (shimVer)
48 return shimVer;
49 else
50 return (peb->OSMajorVersion << 8) | (peb->OSMinorVersion);
51}
52
53BOOL
59 _Out_opt_ PULONG pdwReason);
60
61#endif // COMPAT_UNDOC_H
#define NtCurrentPeb()
Definition: FLS.c:22
BOOL WINAPI BaseCheckAppcompatCache(_In_ PCWSTR ApplicationName, _In_ HANDLE FileHandle, _In_opt_ PCWSTR Environment, _Out_opt_ PULONG pdwReason)
Definition: appcache.c:229
static DWORD RosGetProcessCompatVersion(VOID)
Definition: compat_undoc.h:26
#define REACTOS_SHIMDATA_MAGIC
Definition: compat_undoc.h:19
struct _ReactOS_ShimData ReactOS_ShimData
static UINT RosGetProcessEffectiveVersion(VOID)
Definition: compat_undoc.h:43
#define REACTOS_COMPATVERSION_UNINITIALIZED
Definition: compat_undoc.h:20
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1231
PVOID PVOID PWCHAR PVOID Environment
Definition: env.c:47
PVOID PVOID PWCHAR ApplicationName
Definition: env.c:47
static PVOID RtlGetCurrentDirectory_U_RtlpMsysDecoy
Definition: msys2.c:16
unsigned int UINT
Definition: ndis.h:50
#define _Out_opt_
Definition: no_sal2.h:214
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
ULONG OSMinorVersion
Definition: ntddk_ex.h:301
ULONG OSMajorVersion
Definition: ntddk_ex.h:300
DWORD dwReserved2[242]
Definition: compat_undoc.h:10
DWORD dwReserved1[130]
Definition: compat_undoc.h:7
DWORD dwRosProcessCompatVersion
Definition: compat_undoc.h:11
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define WINAPI
Definition: msvc.h:6