1 #ifndef COMPAT_UNDOC_H 2 #define COMPAT_UNDOC_H 3 4 5 typedef struct _ReactOS_ShimData 6 { 7 DWORD dwReserved1[130]; 8 DWORD dwSize; 9 DWORD dwMagic; 10 DWORD dwReserved2[242]; 11 DWORD dwRosProcessCompatVersion; 12 } ReactOS_ShimData; 13 14 15 #define REACTOS_SHIMDATA_MAGIC 0xAC0DEDAB 16 17 #ifndef WINVER_VISTA 18 #define WINVER_VISTA 0x0600 19 #define WINVER_WIN7 0x0601 20 #define WINVER_WIN8 0x0602 21 #define WINVER_WIN81 0x0603 22 #define WINVER_WIN10 0x0a00 23 #endif 24 25 static 26 inline 27 DWORD RosGetProcessCompatVersion(VOID) 28 { 29 static DWORD g_CompatVersion = 0xffffffff; 30 if (g_CompatVersion == 0xffffffff) 31 { 32 ReactOS_ShimData* pShimData = (ReactOS_ShimData*)NtCurrentPeb()->pShimData; 33 if (pShimData && pShimData->dwMagic == REACTOS_SHIMDATA_MAGIC && 34 pShimData->dwSize == sizeof(ReactOS_ShimData)) 35 { 36 g_CompatVersion = pShimData->dwRosProcessCompatVersion; 37 } 38 } 39 return g_CompatVersion != 0xffffffff ? g_CompatVersion : 0; 40 } 41 42 43 #endif // COMPAT_UNDOC_H 44