@@ -13,60 +13,63 @@ START_TEST(_wsystem)
1313 int ret ;
1414 WCHAR szCmdExe [MAX_PATH ];
1515
16+ /* ReactOS behaves like Vista here */
17+ DWORD dwOsVer = is_reactos () ? _WIN32_WINNT_VISTA : GetNTVersion ();
18+
1619 GetSystemDirectoryW (szCmdExe , _countof (szCmdExe ));
1720 lstrcatW (szCmdExe , L"\\cmd.exe" );
1821
1922 SetEnvironmentVariableW (L"COMSPEC" , NULL );
2023 errno = 0xDEADBEEF ;
2124 ret = _wsystem (NULL );
2225 ok_int (errno , 0xDEADBEEF );
23- ok_int (ret , (GetNTVersion () >= _WIN32_WINNT_VISTA ) ? 0 : 1 );
26+ ok_int (ret , (dwOsVer >= _WIN32_WINNT_VISTA ) ? 0 : 1 );
2427
2528 SetEnvironmentVariableW (L"COMSPEC" , L"InvalidComSpec" );
2629 errno = 0xDEADBEEF ;
2730 ret = _wsystem (NULL );
2831 ok_int (errno , 0xDEADBEEF );
29- ok_int (ret , (GetNTVersion () >= _WIN32_WINNT_VISTA ) ? 0 : 1 );
32+ ok_int (ret , (dwOsVer >= _WIN32_WINNT_VISTA ) ? 0 : 1 );
3033
3134 SetEnvironmentVariableW (L"COMSPEC" , szCmdExe );
3235 errno = 0xDEADBEEF ;
3336 ret = _wsystem (NULL );
3437 ok_int (errno , 0xDEADBEEF );
35- ok_int (ret , (GetNTVersion () >= _WIN32_WINNT_VISTA ) ? 0 : 1 );
38+ ok_int (ret , (dwOsVer >= _WIN32_WINNT_VISTA ) ? 0 : 1 );
3639
3740 SetEnvironmentVariableW (L"COMSPEC" , NULL );
3841 errno = 0xDEADBEEF ;
3942 ret = _wsystem (L"echo This is a test" );
40- ok_int (errno , (_winver >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
43+ ok_int (errno , (dwOsVer >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
4144 ok_int (ret , 0 );
4245
4346 SetEnvironmentVariableW (L"COMSPEC" , L"InvalidComSpec" );
4447 errno = 0xDEADBEEF ;
4548 ret = _wsystem (L"echo This is a test" );
46- ok_int (errno , (GetNTVersion () >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
49+ ok_int (errno , (dwOsVer >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
4750 ok_int (ret , 0 );
4851
4952 SetEnvironmentVariableW (L"COMSPEC" , szCmdExe );
5053 errno = 0xDEADBEEF ;
5154 ret = _wsystem (L"echo This is a test" );
52- ok_int (errno , (GetNTVersion () >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
55+ ok_int (errno , (dwOsVer >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
5356 ok_int (ret , 0 );
5457
5558 SetEnvironmentVariableW (L"COMSPEC" , NULL );
5659 errno = 0xDEADBEEF ;
5760 ret = _wsystem (L"InvalidCommandLine" );
58- ok_int (errno , (GetNTVersion () >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
61+ ok_int (errno , (dwOsVer >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
5962 ok_int (ret , 1 );
6063
6164 SetEnvironmentVariableW (L"COMSPEC" , L"InvalidComSpec" );
6265 errno = 0xDEADBEEF ;
6366 ret = _wsystem (L"InvalidCommandLine" );
64- ok_int (errno , (GetNTVersion () >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
67+ ok_int (errno , (dwOsVer >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
6568 ok_int (ret , 1 );
6669
6770 SetEnvironmentVariableW (L"COMSPEC" , szCmdExe );
6871 errno = 0xDEADBEEF ;
6972 ret = _wsystem (L"InvalidCommandLine" );
70- ok_int (errno , (GetNTVersion () >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
73+ ok_int (errno , (dwOsVer >= _WIN32_WINNT_VISTA ) ? 0xdeadbeef : 0 );
7174 ok_int (ret , 1 );
7275}
0 commit comments