ReactOS 0.4.15-dev-7670-g69b08be
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{
13
14
15#define REACTOS_SHIMDATA_MAGIC 0xAC0DEDAB
16#define REACTOS_COMPATVERSION_UNINITIALIZED 0xfffffffe
17#define REACTOS_COMPATVERSION_IGNOREMANIFEST 0xffffffff
18
19// Returns values in the form of _WIN32_WINNT_VISTA, _WIN32_WINNT_WIN7 etc
20static
21inline
23{
24 static DWORD g_CompatVersion = REACTOS_COMPATVERSION_UNINITIALIZED;
25 if (g_CompatVersion == REACTOS_COMPATVERSION_UNINITIALIZED)
26 {
27 ReactOS_ShimData* pShimData = (ReactOS_ShimData*)NtCurrentPeb()->pShimData;
28 if (pShimData && pShimData->dwMagic == REACTOS_SHIMDATA_MAGIC &&
29 pShimData->dwSize == sizeof(ReactOS_ShimData))
30 {
31 g_CompatVersion = pShimData->dwRosProcessCompatVersion;
32 }
33 }
34 return g_CompatVersion < REACTOS_COMPATVERSION_UNINITIALIZED ? g_CompatVersion : 0;
35}
36
37static
38inline
40{
41 PPEB peb = NtCurrentPeb();
43 if (shimVer)
44 return shimVer;
45 else
46 return (peb->OSMajorVersion << 8) | (peb->OSMinorVersion);
47}
48
49BOOL
55 _Out_opt_ PULONG pdwReason);
56
57#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:22
#define REACTOS_SHIMDATA_MAGIC
Definition: compat_undoc.h:15
struct _ReactOS_ShimData ReactOS_ShimData
static UINT RosGetProcessEffectiveVersion(VOID)
Definition: compat_undoc.h:39
#define REACTOS_COMPATVERSION_UNINITIALIZED
Definition: compat_undoc.h:16
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
#define _Out_opt_
Definition: ms_sal.h:346
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
unsigned int UINT
Definition: ndis.h:50
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