Skip to content

Commit 32fad87

Browse files
authored
[ROSAUTOTEST][SDK] ROS detection for apitests (reactos#7613)
1 parent 4965d6a commit 32fad87

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

modules/rostests/rosautotest/CConfiguration.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include "precomp.h"
9+
#include <versionhelpers.h>
910

1011
#define CONFIGURATION_FILENAMEA "rosautotest.ini"
1112
#define CONFIGURATION_FILENAMEW L"rosautotest.ini"
@@ -32,6 +33,7 @@ CConfiguration::CConfiguration()
3233
FATAL("GetWindowsDirectoryW failed\n");
3334

3435
m_IsReactOS = !_wcsnicmp(&WindowsDirectory[3], L"reactos", 7);
36+
m_IsReactOS = m_IsReactOS || IsReactOS();
3537

3638
if(GetEnvironmentVariableW(L"WINETEST_INTERACTIVE", Interactive, _countof(Interactive)))
3739
m_IsInteractive = _wtoi(Interactive);

sdk/include/psdk/versionhelpers.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,10 @@ IsActiveSessionCountLimited()
145145
}
146146

147147
#ifdef __REACTOS__
148+
#include <mmtypes.h>
148149
VERSIONHELPERAPI
149150
IsReactOS()
150151
{
151-
// FIXME: Find a better method!
152-
WCHAR szWinDir[MAX_PATH];
153-
GetWindowsDirectoryW(szWinDir, _countof(szWinDir));
154-
return (wcsstr(szWinDir, L"ReactOS") != NULL);
152+
return *(UINT*)(MM_SHARED_USER_DATA_VA + PAGE_SIZE - sizeof(ULONG)) == 0x8EAC705;
155153
}
156154
#endif // __REACTOS__

0 commit comments

Comments
 (0)