https://git.reactos.org/?p=reactos.git;a=commitdiff;h=42d2d5ec9c76588624412f...
commit 42d2d5ec9c76588624412f95114d26f36373959f Author: Timo Kreuzer timo.kreuzer@reactos.org AuthorDate: Thu May 30 17:12:28 2019 +0200 Commit: Timo Kreuzer timo.kreuzer@reactos.org CommitDate: Sun Jan 26 11:50:37 2020 +0100
[ROSTESTS] fix x64 build and fix/disable warnings --- modules/rostests/apitests/CMakeLists.txt | 6 +-- .../rostests/apitests/advapi32/RegQueryValueExW.c | 2 +- modules/rostests/apitests/advapi32/ServiceArgs.c | 2 +- modules/rostests/apitests/advapi32/svchlp.c | 2 +- modules/rostests/apitests/dbghelp/pdb.c | 4 -- .../rostests/apitests/iphlpapi/GetInterfaceName.c | 18 ++++--- .../rostests/apitests/iphlpapi/GetNetworkParams.c | 2 +- .../rostests/apitests/kernel32/GetComputerNameEx.c | 4 +- .../kernel32/SetUnhandledExceptionFilter.c | 38 +++++++++++++- .../rostests/apitests/kernel32/SystemFirmware.c | 6 +-- .../apitests/kernel32/WideCharToMultiByte.c | 8 +-- modules/rostests/apitests/kernel32/lstrcpynW.c | 2 +- modules/rostests/apitests/kernel32/lstrlen.c | 4 +- modules/rostests/apitests/localspl/service.c | 2 +- modules/rostests/apitests/localspl/tests.c | 2 +- modules/rostests/apitests/mspatcha/mspatcha.c | 8 +-- .../apitests/msvcrt/CmdLineUtil/CmdLineUtil.c | 4 +- modules/rostests/apitests/msvcrt/CommandLine.c | 6 +-- modules/rostests/apitests/ntdll/LdrEnumResources.c | 2 +- modules/rostests/apitests/ntdll/NtContinue.c | 30 +++++++++++ .../rostests/apitests/ntdll/NtMapViewOfSection.c | 2 +- modules/rostests/apitests/ntdll/StackOverflow.c | 4 ++ modules/rostests/apitests/psapi/psapi.c | 4 +- .../apitests/setupapi/SetupDiInstallClassExA.c | 4 +- .../SetupInstallServicesFromInfSectionEx.c | 2 +- modules/rostests/apitests/shell32/CIDLData.cpp | 2 +- .../apitests/shell32/SHCreateDataObject.cpp | 2 +- modules/rostests/apitests/shell32/menu.cpp | 2 +- .../apitests/shlwapi/PathUnExpandEnvStrings.c | 10 ++-- .../apitests/spoolss/MarshallDownStructuresArray.c | 2 +- modules/rostests/apitests/win32nt/CMakeLists.txt | 61 +++++++--------------- .../win32nt/ntdd/NtGdiDdQueryDirectDrawObject.c | 24 ++++----- .../apitests/win32nt/ntgdi/NtGdiCreateBitmap.c | 6 +-- .../apitests/win32nt/ntgdi/NtGdiCreateDIBSection.c | 6 +-- .../apitests/win32nt/ntgdi/NtGdiExtTextOutW.c | 2 +- .../apitests/win32nt/ntgdi/NtGdiPolyPolyDraw.c | 4 +- .../apitests/win32nt/ntuser/NtUserProcessConnect.c | 4 +- .../apitests/win32nt/ntuser/NtUserScrollDC.c | 2 +- .../win32nt/ntuser/NtUserSystemParametersInfo.c | 14 ++--- modules/rostests/apitests/ws2_32/WSARecv.c | 2 +- modules/rostests/apitests/ws2_32/getaddrinfo.c | 2 +- modules/rostests/apitests/ws2_32/gethostname.c | 10 ++-- modules/rostests/apitests/ws2_32/helpers.c | 2 +- modules/rostests/kmtests/kmtest/fltsupport.c | 4 +- modules/rostests/kmtests/npfs/NpfsHelpers.c | 2 +- modules/rostests/kmtests/ntos_io/IoFilesystem.c | 4 +- modules/rostests/kmtests/rtl/RtlStrSafe.c | 4 +- .../rostests/rosautotest/CJournaledTestList.cpp | 4 +- modules/rostests/rosautotest/CWebService.cpp | 2 +- modules/rostests/win32/cmd/batch.c | 2 +- modules/rostests/win32/user32/biditext/biditext.c | 14 ++--- modules/rostests/win32/user32/psmtest/psmtest.c | 8 +-- modules/rostests/winetests/CMakeLists.txt | 14 ++++- sdk/include/crt/xmmintrin.h | 4 ++ sdk/include/psdk/shlwapi.h | 6 ++- sdk/lib/atl/atlbase.h | 7 +-- 56 files changed, 229 insertions(+), 171 deletions(-)
diff --git a/modules/rostests/apitests/CMakeLists.txt b/modules/rostests/apitests/CMakeLists.txt index a0418480c27..9f1d6ce225b 100644 --- a/modules/rostests/apitests/CMakeLists.txt +++ b/modules/rostests/apitests/CMakeLists.txt @@ -20,9 +20,7 @@ add_subdirectory(fontext) add_subdirectory(gdi32) add_subdirectory(gditools) add_subdirectory(iphlpapi) -if(NOT ARCH STREQUAL "amd64") - add_subdirectory(kernel32) -endif() +add_subdirectory(kernel32) add_subdirectory(localspl) add_subdirectory(mountmgr) add_subdirectory(msgina) @@ -46,7 +44,7 @@ add_subdirectory(user32) add_subdirectory(user32_dynamic) add_subdirectory(userenv) add_subdirectory(uxtheme) -if(NOT ARCH STREQUAL "amd64" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release") +if(NOT CMAKE_BUILD_TYPE STREQUAL "Release") add_subdirectory(win32u) add_subdirectory(win32nt) endif() diff --git a/modules/rostests/apitests/advapi32/RegQueryValueExW.c b/modules/rostests/apitests/advapi32/RegQueryValueExW.c index 14384570692..dcabb6e34f1 100644 --- a/modules/rostests/apitests/advapi32/RegQueryValueExW.c +++ b/modules/rostests/apitests/advapi32/RegQueryValueExW.c @@ -216,7 +216,7 @@ START_TEST(RegQueryValueExW) { ok(1, "RegSetValueExW failed: %lx, %lx\n", ret, GetLastError()); } - if ((ret = RegSetValueExW(hkey_main, L"LONGSTRING", 0, REG_SZ, (const BYTE *)string22W, (wcslen(string22W)+1) * sizeof(WCHAR))) != ERROR_SUCCESS) + if ((ret = RegSetValueExW(hkey_main, L"LONGSTRING", 0, REG_SZ, (const BYTE *)string22W, (lstrlenW(string22W)+1) * sizeof(WCHAR))) != ERROR_SUCCESS) { ok(1, "RegSetValueExW failed: %lx, %lx\n", ret, GetLastError()); } diff --git a/modules/rostests/apitests/advapi32/ServiceArgs.c b/modules/rostests/apitests/advapi32/ServiceArgs.c index e50ca7bf9fc..46421d110f2 100644 --- a/modules/rostests/apitests/advapi32/ServiceArgs.c +++ b/modules/rostests/apitests/advapi32/ServiceArgs.c @@ -26,7 +26,7 @@ static void send_msg(const char *type, const char *msg) char buf[512];
StringCbPrintfA(buf, sizeof(buf), "%s:%s", type, msg); - WriteFile(pipe_handle, buf, strlen(buf)+1, &written, NULL); + WriteFile(pipe_handle, buf, lstrlenA(buf)+1, &written, NULL); }
#if 0 diff --git a/modules/rostests/apitests/advapi32/svchlp.c b/modules/rostests/apitests/advapi32/svchlp.c index 7a3aca65e78..1d0bf62c59f 100644 --- a/modules/rostests/apitests/advapi32/svchlp.c +++ b/modules/rostests/apitests/advapi32/svchlp.c @@ -30,7 +30,7 @@ void send_msg(const char *type, const char *msg) char buf[512];
StringCbPrintfA(buf, sizeof(buf), "%s:%s", type, msg); - WriteFile(hClientPipe, buf, strlen(buf)+1, &written, NULL); + WriteFile(hClientPipe, buf, lstrlenA(buf)+1, &written, NULL); }
void service_trace(const char *msg, ...) diff --git a/modules/rostests/apitests/dbghelp/pdb.c b/modules/rostests/apitests/dbghelp/pdb.c index dc56ae74b08..68aab4942bb 100644 --- a/modules/rostests/apitests/dbghelp/pdb.c +++ b/modules/rostests/apitests/dbghelp/pdb.c @@ -565,9 +565,7 @@ START_TEST(pdb) { char szDllName[MAX_PATH]; char szDllPath[MAX_PATH], szOldDir[MAX_PATH]; -#ifdef _M_IX86 HMODULE hMod; -#endif DWORD64 BaseAddress; DWORD dwErr, Options;
@@ -608,7 +606,6 @@ START_TEST(pdb) test_SymRegCallback(proc(), szDllName, TRUE); test_SymRegCallback(proc(), szDllName, FALSE);
-#ifdef _M_IX86 hMod = LoadLibraryA(szDllName); if (hMod) { @@ -631,7 +628,6 @@ START_TEST(pdb)
FreeLibrary(hMod); } -#endif
cleanup_msvc_dll(); } diff --git a/modules/rostests/apitests/iphlpapi/GetInterfaceName.c b/modules/rostests/apitests/iphlpapi/GetInterfaceName.c index 76078cc39ff..d49e600d343 100644 --- a/modules/rostests/apitests/iphlpapi/GetInterfaceName.c +++ b/modules/rostests/apitests/iphlpapi/GetInterfaceName.c @@ -27,6 +27,7 @@ test_NhGetInterfaceNameFromGuid(GUID AdapterGUID, DWORD par1, DWORD par2) ULONG ulOutBufLen; WCHAR Name[MAX_INTERFACE_NAME_LEN + 4]; GUID UniqueGUID = MY_TEST_GUID; + SIZE_T Length;
// Test NULL GUID SetLastError(0xbeeffeed); @@ -104,11 +105,11 @@ test_NhGetInterfaceNameFromGuid(GUID AdapterGUID, DWORD par1, DWORD par2) ok(ulOutBufLen > 0, "ulOutBufLen is %ld, expected > 0\n", ulOutBufLen); - Error = wcslen(Name); - ok(Error > 0, + Length = wcslen(Name); + ok(Length > 0, "wcslen(Name) is %ld, expected > 0\n", - Error); - if (Error > 0) + Length); + if (Length > 0) trace("Adapter name: "%S"\n", Name);
// Test correct values, but with new unique GUID @@ -159,6 +160,7 @@ test_NhGetInterfaceNameFromDeviceGuid(GUID AdapterGUID, DWORD par1, DWORD par2) ULONG ulOutBufLen; WCHAR Name[MAX_INTERFACE_NAME_LEN]; GUID UniqueGUID = MY_TEST_GUID; + SIZE_T Length;
// Test NULL GUID // Windows XP: NhGetInterfaceNameFromDeviceGuid throws exception here @@ -241,11 +243,11 @@ test_NhGetInterfaceNameFromDeviceGuid(GUID AdapterGUID, DWORD par1, DWORD par2) ok(ulOutBufLen > 0, "ulOutBufLen is %ld, expected > 0\n", ulOutBufLen); - Error = wcslen(Name); - ok(Error > 0, + Length = wcslen(Name); + ok(Length > 0, "wcslen(Name) is %ld, expected > 0\n", - Error); - if (Error > 0) + Length); + if (Length > 0) trace("Adapter name: "%S"\n", Name);
// Test correct values, but with new unique GUID diff --git a/modules/rostests/apitests/iphlpapi/GetNetworkParams.c b/modules/rostests/apitests/iphlpapi/GetNetworkParams.c index 697e66004e4..ef0bd6a768e 100644 --- a/modules/rostests/apitests/iphlpapi/GetNetworkParams.c +++ b/modules/rostests/apitests/iphlpapi/GetNetworkParams.c @@ -76,7 +76,7 @@ WriteRegistryValue(PCHAR ValueName, PCHAR Value) 0, REG_SZ, (LPBYTE)Value, - strlen(Value) + 1); + lstrlenA(Value) + 1);
/* Close the key */ RegCloseKey(ParametersKey); diff --git a/modules/rostests/apitests/kernel32/GetComputerNameEx.c b/modules/rostests/apitests/kernel32/GetComputerNameEx.c index 3e93165821b..2fbcbf6c61b 100644 --- a/modules/rostests/apitests/kernel32/GetComputerNameEx.c +++ b/modules/rostests/apitests/kernel32/GetComputerNameEx.c @@ -30,7 +30,7 @@ TestGetComputerNameEx( return; } trace("[%d] Reference is %ls\n", NameType, Reference); - ReferenceLen = wcslen(Reference); + ReferenceLen = lstrlenW(Reference); ok(ReferenceLen < RTL_NUMBER_OF(Reference), "[%d] Unexpected ReferenceLen %lu\n", NameType, ReferenceLen); if (NameType != ComputerNameDnsDomain && NameType != ComputerNamePhysicalDnsDomain) @@ -278,7 +278,7 @@ WriteRegistryValue(PCHAR ValueName, PCHAR Value) 0, REG_SZ, (LPBYTE)Value, - strlen(Value) + 1); + lstrlenA(Value) + 1);
/* Close the key */ RegCloseKey(ParametersKey); diff --git a/modules/rostests/apitests/kernel32/SetUnhandledExceptionFilter.c b/modules/rostests/apitests/kernel32/SetUnhandledExceptionFilter.c index fb7e9f73815..e59d5e1e7d1 100644 --- a/modules/rostests/apitests/kernel32/SetUnhandledExceptionFilter.c +++ b/modules/rostests/apitests/kernel32/SetUnhandledExceptionFilter.c @@ -54,7 +54,13 @@ static LONG WINAPI ExceptionFilterSSESupport(LPEXCEPTION_POINTERS exp)
ok((ctx->ContextFlags & CONTEXT_CONTROL) == CONTEXT_CONTROL, "Context does not contain control register.\n");
+#ifdef _M_IX86 ctx->Eip += 3; +#elif defined(_M_AMD64) + ctx->Rip += 3; +#else +#error Architecture not handled +#endif
return EXCEPTION_CONTINUE_EXECUTION; } @@ -65,12 +71,17 @@ static LONG WINAPI ExceptionFilterSSEException(LPEXCEPTION_POINTERS exp) { PEXCEPTION_RECORD rec = exp->ExceptionRecord; PCONTEXT ctx = exp->ContextRecord; +#ifdef _M_AMD64 + ULONG ExpectedExceptionCode = STATUS_FLOAT_DIVIDE_BY_ZERO; +#else + ULONG ExpectedExceptionCode = STATUS_FLOAT_MULTIPLE_TRAPS; +#endif
trace("Exception raised while dividing by 0.\n");
- ok(rec->ExceptionCode == STATUS_FLOAT_MULTIPLE_TRAPS, "Exception code is 0x%08x.\n", (unsigned int)rec->ExceptionCode); + ok(rec->ExceptionCode == ExpectedExceptionCode, "Exception code is 0x%08x.\n", (unsigned int)rec->ExceptionCode);
- if(rec->ExceptionCode != STATUS_FLOAT_MULTIPLE_TRAPS) + if(rec->ExceptionCode != ExpectedExceptionCode) { trace("Unexpected exception code, terminating!\n"); return EXCEPTION_EXECUTE_HANDLER; @@ -80,7 +91,13 @@ static LONG WINAPI ExceptionFilterSSEException(LPEXCEPTION_POINTERS exp)
ExceptionCaught = TRUE;
+#ifdef _M_IX86 ctx->Eip += 3; +#elif defined(_M_AMD64) + ctx->Rip += 3; +#else +#error Architecture not handled +#endif
return EXCEPTION_CONTINUE_EXECUTION; } @@ -96,11 +113,19 @@ VOID TestSSEExceptions(VOID) p = SetUnhandledExceptionFilter(ExceptionFilterSSESupport); ok(p == NULL, "Previous filter should be NULL\n"); #ifdef _MSC_VER +#if defined(_M_AMD64) + { + __m128 xmm = { { 0 } }; + xmm = _mm_xor_ps(xmm, xmm); + if (!ExceptionCaught) supportsSSE = TRUE; + } +#else __asm { xorps xmm0, xmm0 mov supportsSSE, 0x1 } +#endif #else __asm__( "xorps %%xmm0, %%xmm0\n" @@ -124,6 +149,14 @@ VOID TestSSEExceptions(VOID)
/* We can't use _mm_div_ps, as it masks the exception before performing anything*/ #if defined(_MSC_VER) +#if defined(_M_AMD64) + { + __m128 xmm1 = { { 1., 1. } }, xmm2 = { { 0 } }; + /* Wait, aren't exceptions masked? Yes, but actually no. */ + xmm1 = _mm_div_ps(xmm1, xmm2); + if (!ExceptionCaught) supportsSSE = TRUE; + } +#else __asm { xorps xmm0, xmm0 @@ -140,6 +173,7 @@ VOID TestSSEExceptions(VOID) /* Clean up */ add esp, 16 } +#endif #else __asm__ ( "xorps %%xmm0, %%xmm0\n" diff --git a/modules/rostests/apitests/kernel32/SystemFirmware.c b/modules/rostests/apitests/kernel32/SystemFirmware.c index c052761b458..47ef3a33bac 100644 --- a/modules/rostests/apitests/kernel32/SystemFirmware.c +++ b/modules/rostests/apitests/kernel32/SystemFirmware.c @@ -468,7 +468,7 @@ test_Functions() test_EnumBuffer(Entries[i].Signature, NULL, sizeof(Buffer), NULL, NULL, Entries[i].ErrInsuff, Entries[i].ErrSuccess); // Test with wrong buffer - test_EnumBuffer(Entries[i].Signature, (PVOID *)0xbeeffeed, sizeof(Buffer), NULL, NULL, + test_EnumBuffer(Entries[i].Signature, (PVOID *)(LONG_PTR)0xbeeffeed, sizeof(Buffer), NULL, NULL, Entries[i].ErrInsuff, Entries[i].ErrSuccess); // Test with correct buffer test_EnumBuffer(Entries[i].Signature, &Buffer, sizeof(Buffer), &TableCount[i], &FirstTableID[i], @@ -482,7 +482,7 @@ test_Functions() test_GetBuffer(Entries[i].Signature, 0xbeeffeed, NULL, sizeof(Buffer), TRUE, Entries[i].ErrInsuff, Entries[i].ErrSuccess); // Test with fake ID and wrong buffer - test_GetBuffer(Entries[i].Signature, 0xbeeffeed, (PVOID *)0xbeeffeed, sizeof(Buffer), + test_GetBuffer(Entries[i].Signature, 0xbeeffeed, (PVOID *)(LONG_PTR)0xbeeffeed, sizeof(Buffer), TRUE, Entries[i].ErrInsuff, Entries[i].ErrSuccess); // Test with fake ID and correct buffer test_GetBuffer(Entries[i].Signature, 0xbeeffeed, &Buffer, sizeof(Buffer), @@ -502,7 +502,7 @@ test_Functions() test_GetBuffer(Entries[i].Signature, FirstTableID[i], NULL, sizeof(Buffer), FALSE, Entries[i].ErrInsuff, Entries[i].ErrSuccess); // Test with correct ID and wrong buffer - test_GetBuffer(Entries[i].Signature, FirstTableID[i], (PVOID *)0xbeeffeed, sizeof(Buffer), + test_GetBuffer(Entries[i].Signature, FirstTableID[i], (PVOID *)(LONG_PTR)0xbeeffeed, sizeof(Buffer), FALSE, Entries[i].ErrInsuff, Entries[i].ErrSuccess); // Test with correct ID and correct buffer test_GetBuffer(Entries[i].Signature, FirstTableID[i], &Buffer, sizeof(Buffer), diff --git a/modules/rostests/apitests/kernel32/WideCharToMultiByte.c b/modules/rostests/apitests/kernel32/WideCharToMultiByte.c index 80b56a6a2e9..db3384e7c71 100644 --- a/modules/rostests/apitests/kernel32/WideCharToMultiByte.c +++ b/modules/rostests/apitests/kernel32/WideCharToMultiByte.c @@ -19,8 +19,8 @@ Utf8Convert_( _In_ PCSTR File, _In_ INT Line) { - size_t WideLen; - size_t Utf8Len; + int WideLen; + int Utf8Len; char Buffer[32]; int Ret; ULONG i; @@ -28,8 +28,8 @@ Utf8Convert_( PCSTR ExpectedUtf8;
ExpectedUtf8 = ntv6(1) ? ExpectedUtf8_Vista : ExpectedUtf8_2003; - WideLen = wcslen(WideString); - Utf8Len = strlen(ExpectedUtf8); + WideLen = lstrlenW(WideString); + Utf8Len = lstrlenA(ExpectedUtf8);
/* Get length only */ Ret = WideCharToMultiByte(CP_UTF8, 0, WideString, WideLen, NULL, 0, NULL, NULL); diff --git a/modules/rostests/apitests/kernel32/lstrcpynW.c b/modules/rostests/apitests/kernel32/lstrcpynW.c index 6bc49c63200..e855e314cd9 100644 --- a/modules/rostests/apitests/kernel32/lstrcpynW.c +++ b/modules/rostests/apitests/kernel32/lstrcpynW.c @@ -20,5 +20,5 @@ START_TEST(lstrcpynW) ok(!lstrcmpW(buffer, L"Copy this"), "Copy went wrong.\n");
/* Test some invalid buffer */ - ok(lstrcpynW((LPWSTR)0xbaadf00d, L"Copy this string", 256) == NULL, "lstrncpyW should have returned NULL.\n"); + ok(lstrcpynW((LPWSTR)(LONG_PTR)0xbaadf00d, L"Copy this string", 256) == NULL, "lstrncpyW should have returned NULL.\n"); } diff --git a/modules/rostests/apitests/kernel32/lstrlen.c b/modules/rostests/apitests/kernel32/lstrlen.c index 45dbc582c8c..25d82c5196c 100644 --- a/modules/rostests/apitests/kernel32/lstrlen.c +++ b/modules/rostests/apitests/kernel32/lstrlen.c @@ -47,7 +47,7 @@ RemoveVectoredExceptionHandler(pVEH); * Use Vectored Exception Handling to monitor for first-chance exceptions. */ pVEH = AddVectoredExceptionHandler(1, VEHandler_2); - ok(lstrlenA( (LPSTR)0xbaadf00d) == 0, "lstrlenA should have returned 0.\n"); - ok(lstrlenW((LPWSTR)0xbaadf00d) == 0, "lstrlenW should have returned 0.\n"); + ok(lstrlenA( (LPSTR)(LONG_PTR)0xbaadf00d) == 0, "lstrlenA should have returned 0.\n"); + ok(lstrlenW((LPWSTR)(LONG_PTR)0xbaadf00d) == 0, "lstrlenW should have returned 0.\n"); RemoveVectoredExceptionHandler(pVEH); } diff --git a/modules/rostests/apitests/localspl/service.c b/modules/rostests/apitests/localspl/service.c index e8465f1a297..54ccaad287d 100644 --- a/modules/rostests/apitests/localspl/service.c +++ b/modules/rostests/apitests/localspl/service.c @@ -52,7 +52,7 @@ _DoDLLInjection() }
wcscpy(p, L".dll"); - cbDLLPath = (wcslen(wszFilePath) + 1) * sizeof(WCHAR); + cbDLLPath = (lstrlenW(wszFilePath) + 1) * sizeof(WCHAR);
// Create a snapshot of the currently running processes. hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); diff --git a/modules/rostests/apitests/localspl/tests.c b/modules/rostests/apitests/localspl/tests.c index e5c1cc0e380..c992bcce20b 100644 --- a/modules/rostests/apitests/localspl/tests.c +++ b/modules/rostests/apitests/localspl/tests.c @@ -167,7 +167,7 @@ _RunRemoteTest(const char* szTestName) }
// Send the test name. - if (!WriteFile(hCommandPipe, szTestName, strlen(szTestName) + sizeof(char), &cbWritten, NULL)) + if (!WriteFile(hCommandPipe, szTestName, lstrlenA(szTestName) + sizeof(char), &cbWritten, NULL)) { skip("WriteFile failed with error %lu!\n", GetLastError()); goto Cleanup; diff --git a/modules/rostests/apitests/mspatcha/mspatcha.c b/modules/rostests/apitests/mspatcha/mspatcha.c index 1c01eedd771..c2550e254c7 100644 --- a/modules/rostests/apitests/mspatcha/mspatcha.c +++ b/modules/rostests/apitests/mspatcha/mspatcha.c @@ -142,7 +142,7 @@ BOOL extract2(char* filename, const unsigned char* data, size_t len) return FALSE; }
- bRet = WriteFile(hFile, data, len, &dwWritten, NULL); + bRet = WriteFile(hFile, data, (DWORD)len, &dwWritten, NULL); CloseHandle(hFile); bRet = bRet && (dwWritten == len);
@@ -187,7 +187,7 @@ void compare_file_(char* filename, const unsigned char* data, size_t len, const if (buf) { DWORD dwRead; - if (ReadFile(hFile, buf, size, &dwRead, NULL) && dwRead == size) + if (ReadFile(hFile, buf, (DWORD)size, &dwRead, NULL) && dwRead == size) { ok(!memcmp(buf, data, min(size,len)), "Data mismatch, %s\n", test_name); } @@ -333,10 +333,10 @@ static void validate_patch(patch_data* current) { UINT crc;
- crc = crc32(~0, current->patch.data, current->patch.len); + crc = crc32(~0, current->patch.data, (UINT)current->patch.len); ok(crc == 0, "Invalid patch crc 0x%x for %s\n", crc, current->name);
- crc = crc32(~0, current->patch_header.data, current->patch_header.len); + crc = crc32(~0, current->patch_header.data, (UINT)current->patch_header.len); ok(crc == 0, "Invalid patch_header crc 0x%x for %s\n", crc, current->name); }
diff --git a/modules/rostests/apitests/msvcrt/CmdLineUtil/CmdLineUtil.c b/modules/rostests/apitests/msvcrt/CmdLineUtil/CmdLineUtil.c index e2c4e55cb87..a75cadd25b7 100644 --- a/modules/rostests/apitests/msvcrt/CmdLineUtil/CmdLineUtil.c +++ b/modules/rostests/apitests/msvcrt/CmdLineUtil/CmdLineUtil.c @@ -45,7 +45,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, */
/* 1- Write the WinMain's command line. */ - dwStringSize = (wcslen(lpCmdLine) + 1) * sizeof(WCHAR); + dwStringSize = (lstrlenW(lpCmdLine) + 1) * sizeof(WCHAR);
WriteFile(hFile, &dwStringSize, @@ -60,7 +60,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, NULL);
/* 2- Write the Win32 mode command line. */ - dwStringSize = (wcslen(CmdLine) + 1) * sizeof(WCHAR); + dwStringSize = (lstrlenW(CmdLine) + 1) * sizeof(WCHAR);
WriteFile(hFile, &dwStringSize, diff --git a/modules/rostests/apitests/msvcrt/CommandLine.c b/modules/rostests/apitests/msvcrt/CommandLine.c index 86ac7d3f872..af8588594e6 100644 --- a/modules/rostests/apitests/msvcrt/CommandLine.c +++ b/modules/rostests/apitests/msvcrt/CommandLine.c @@ -264,14 +264,14 @@ static void Test_CommandLine(IN ULONG TestNumber, /* * Now check the results. */ - dwStringSize = min(wcslen(WinMainCmdLine), wcslen(Win32CmdLine)); + dwStringSize = min(lstrlenW(WinMainCmdLine), lstrlenW(Win32CmdLine)); ok(wcslen(WinMainCmdLine) == wcslen(Win32CmdLine), "Test %lu - WinMain and Win32 command lines do not have the same length !\n", TestNumber); ok(wcsncmp(WinMainCmdLine, Win32CmdLine, dwStringSize) == 0, "Test %lu - WinMain and Win32 command lines are different !\n", TestNumber);
- dwStringSize = min(wcslen(WinMainCmdLine), NTCmdLine.Length / sizeof(WCHAR)); + dwStringSize = min(lstrlenW(WinMainCmdLine), NTCmdLine.Length / sizeof(WCHAR)); ok(wcsncmp(WinMainCmdLine, NTCmdLine.Buffer, dwStringSize) == 0, "Test %lu - WinMain and NT command lines are different !\n", TestNumber);
- dwStringSize = min(wcslen(Win32CmdLine), NTCmdLine.Length / sizeof(WCHAR)); + dwStringSize = min(lstrlenW(Win32CmdLine), NTCmdLine.Length / sizeof(WCHAR)); ok(wcsncmp(Win32CmdLine, NTCmdLine.Buffer, dwStringSize) == 0, "Test %lu - Win32 and NT command lines are different !\n", TestNumber); } } diff --git a/modules/rostests/apitests/ntdll/LdrEnumResources.c b/modules/rostests/apitests/ntdll/LdrEnumResources.c index c18aab8e193..7dfd08b5991 100644 --- a/modules/rostests/apitests/ntdll/LdrEnumResources.c +++ b/modules/rostests/apitests/ntdll/LdrEnumResources.c @@ -65,7 +65,7 @@ InitializeNamedEntry( DirEntry->OffsetToData = (PUCHAR)Data - (PUCHAR)Resource; if (DirEntry < Resource->Lang1Entries) DirEntry->DataIsDirectory = 1; - Resource->StringBuffer[Resource->StringIndex] = wcslen(Name); + Resource->StringBuffer[Resource->StringIndex] = (USHORT)wcslen(Name); wcscpy(&Resource->StringBuffer[Resource->StringIndex + 1], Name); Resource->StringIndex += Resource->StringBuffer[Resource->StringIndex] * 2 + 1; } diff --git a/modules/rostests/apitests/ntdll/NtContinue.c b/modules/rostests/apitests/ntdll/NtContinue.c index 0a57bab7cd8..334c85056a2 100644 --- a/modules/rostests/apitests/ntdll/NtContinue.c +++ b/modules/rostests/apitests/ntdll/NtContinue.c @@ -58,6 +58,13 @@ static ULONG randULONG(void) return n; }
+#ifdef _M_AMD64 +static ULONG64 randULONG64(void) +{ + return (ULONG64)randULONG() << 32 | randULONG(); +} +#endif + void check(CONTEXT * pContext) { #ifdef _M_IX86 @@ -159,6 +166,29 @@ START_TEST(NtContinue) continueContext.Eip = (ULONG)((ULONG_PTR)continuePoint & 0xFFFFFFF);
/* Can't do a lot about segments */ +#elif defined(_M_AMD64) + continueContext.ContextFlags = CONTEXT_FULL; + + /* Fill the integer registers with random values */ + continueContext.Rdi = randULONG64(); + continueContext.Rsi = randULONG64(); + continueContext.Rbx = randULONG64(); + continueContext.Rdx = randULONG64(); + continueContext.Rcx = randULONG64(); + continueContext.Rax = randULONG64(); + continueContext.Rbp = randULONG64(); + + /* Randomize all the allowed flags (determined experimentally with WinDbg) */ + continueContext.EFlags = randULONG64() & 0x3C0CD5; + + /* Randomize the stack pointer as much as possible */ + continueContext.Rsp = (((ULONG_PTR)&bogus)) + + sizeof(bogus) - (randULONG() & 0xF) * 4; + + /* continuePoint() is implemented in assembler */ + //continueContext.Rip = ((ULONG_PTR)continuePoint); + skip("NtContinue test does not yet work on x64."); + return; #endif
NtContinue(&continueContext, FALSE); diff --git a/modules/rostests/apitests/ntdll/NtMapViewOfSection.c b/modules/rostests/apitests/ntdll/NtMapViewOfSection.c index 081ddc7b7d7..2df52007c41 100644 --- a/modules/rostests/apitests/ntdll/NtMapViewOfSection.c +++ b/modules/rostests/apitests/ntdll/NtMapViewOfSection.c @@ -1542,7 +1542,7 @@ Test_Truncate(VOID) HANDLE Handle; HANDLE SectionHandle;
- ULONG Length; + SIZE_T Length; BOOL Success; DWORD Written, Error; VOID* BaseAddress; diff --git a/modules/rostests/apitests/ntdll/StackOverflow.c b/modules/rostests/apitests/ntdll/StackOverflow.c index 794e2fe0ffb..175142d01a3 100644 --- a/modules/rostests/apitests/ntdll/StackOverflow.c +++ b/modules/rostests/apitests/ntdll/StackOverflow.c @@ -7,6 +7,10 @@
#include "precomp.h"
+#ifdef _MSC_VER +#pragma warning(disable : 4717) // disable warning about recursive function +#endif + static int iteration = 0; static PVOID StackAllocationBase; static PVOID LastStackAllocation; diff --git a/modules/rostests/apitests/psapi/psapi.c b/modules/rostests/apitests/psapi/psapi.c index 99e700d0876..03be85357a8 100644 --- a/modules/rostests/apitests/psapi/psapi.c +++ b/modules/rostests/apitests/psapi/psapi.c @@ -88,13 +88,13 @@ static BOOLEAN IntGetModuleInformation(LPCSTR Module, BOOLEAN IsDriver, BOOLEAN if (BaseName) { strcpy(Info->Path, Module); - Info->Len = strlen(Info->Path); + Info->Len = lstrlenA(Info->Path); } else { /* Skip disk */ strcpy(Info->Path, System + 2); - Info->Len = strlen(Info->Path); + Info->Len = lstrlenA(Info->Path); }
return TRUE; diff --git a/modules/rostests/apitests/setupapi/SetupDiInstallClassExA.c b/modules/rostests/apitests/setupapi/SetupDiInstallClassExA.c index 73bf2739373..5d00ed90666 100644 --- a/modules/rostests/apitests/setupapi/SetupDiInstallClassExA.c +++ b/modules/rostests/apitests/setupapi/SetupDiInstallClassExA.c @@ -39,7 +39,7 @@ static void create_inf_file(LPCSTR filename, const char *data) HANDLE handle = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); assert(handle != INVALID_HANDLE_VALUE); - ret = WriteFile(handle, data, strlen(data), &res, NULL); + ret = WriteFile(handle, data, lstrlenA(data), &res, NULL); assert(ret != 0); CloseHandle(handle); } @@ -277,7 +277,7 @@ static void test_SetupDiInstallClassExA(void) START_TEST(SetupDiInstallClassExA) { char temp_path[MAX_PATH], prev_path[MAX_PATH]; - DWORD len; + SIZE_T len;
GetCurrentDirectoryA(MAX_PATH, prev_path); GetTempPathA(MAX_PATH, temp_path); diff --git a/modules/rostests/apitests/setupapi/SetupInstallServicesFromInfSectionEx.c b/modules/rostests/apitests/setupapi/SetupInstallServicesFromInfSectionEx.c index 20255faf291..c54df8751ba 100644 --- a/modules/rostests/apitests/setupapi/SetupInstallServicesFromInfSectionEx.c +++ b/modules/rostests/apitests/setupapi/SetupInstallServicesFromInfSectionEx.c @@ -39,7 +39,7 @@ static void create_inf_file(LPCSTR filename, const char *data) HANDLE handle = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); assert(handle != INVALID_HANDLE_VALUE); - ret = WriteFile(handle, data, strlen(data), &res, NULL); + ret = WriteFile(handle, data, lstrlenA(data), &res, NULL); assert(ret != 0); CloseHandle(handle); } diff --git a/modules/rostests/apitests/shell32/CIDLData.cpp b/modules/rostests/apitests/shell32/CIDLData.cpp index f64fb3f7178..502a1b321fa 100644 --- a/modules/rostests/apitests/shell32/CIDLData.cpp +++ b/modules/rostests/apitests/shell32/CIDLData.cpp @@ -111,7 +111,7 @@ static void TestHDROP(PVOID pData, SIZE_T Size, LPCWSTR ExpectRoot, LPCWSTR Expe
LPCWSTR Expected[2] = { ExpectPath1, ExpectPath2 };
- DWORD offset = pDropFiles->pFiles; + SIZE_T offset = pDropFiles->pFiles; UINT Count = 0; for (;;Count++) { diff --git a/modules/rostests/apitests/shell32/SHCreateDataObject.cpp b/modules/rostests/apitests/shell32/SHCreateDataObject.cpp index 9a47e9d603b..927afa28d23 100644 --- a/modules/rostests/apitests/shell32/SHCreateDataObject.cpp +++ b/modules/rostests/apitests/shell32/SHCreateDataObject.cpp @@ -114,7 +114,7 @@ static void TestHDROP(PVOID pData, SIZE_T Size, LPCWSTR ExpectRoot, LPCWSTR Expe
LPCWSTR Expected[2] = { ExpectPath1, ExpectPath2 };
- DWORD offset = pDropFiles->pFiles; + SIZE_T offset = pDropFiles->pFiles; UINT Count = 0; for (;;Count++) { diff --git a/modules/rostests/apitests/shell32/menu.cpp b/modules/rostests/apitests/shell32/menu.cpp index 49efa1e7d08..673d4f457cc 100644 --- a/modules/rostests/apitests/shell32/menu.cpp +++ b/modules/rostests/apitests/shell32/menu.cpp @@ -16,7 +16,7 @@
BOOL CheckWindowClass(HWND hwnd, PCWSTR className) { - ULONG size = (wcslen(className) + 1)* sizeof(WCHAR); + ULONG size = (lstrlenW(className) + 1)* sizeof(WCHAR); PWCHAR buffer = (PWCHAR)malloc(size); if (GetClassNameW(hwnd, buffer, size ) == 0) { diff --git a/modules/rostests/apitests/shlwapi/PathUnExpandEnvStrings.c b/modules/rostests/apitests/shlwapi/PathUnExpandEnvStrings.c index c7da336ee42..daaebb2b50b 100644 --- a/modules/rostests/apitests/shlwapi/PathUnExpandEnvStrings.c +++ b/modules/rostests/apitests/shlwapi/PathUnExpandEnvStrings.c @@ -64,12 +64,12 @@ START_TEST(PathUnExpandEnvStrings) */ ret = GetEnvironmentVariableW(L"SystemRoot", TestStr, _countof(TestStr)); ok(ret, "got %lu\n", ret); - len = wcslen(TestStr); + len = lstrlenW(TestStr); ret = GetEnvironmentVariableW(L"SystemRoot", TestStr + len, _countof(TestStr) - len); ok(ret, "got %lu\n", ret);
StringCchCopyW(ExpStr, _countof(ExpStr), L"%SystemRoot%"); - len = wcslen(ExpStr); + len = lstrlenW(ExpStr); ret = GetEnvironmentVariableW(L"SystemRoot", ExpStr + len, _countof(ExpStr) - len); ok(ret, "got %lu\n", ret); DO_TEST(TRUE, TestStr, ExpStr); @@ -79,7 +79,7 @@ START_TEST(PathUnExpandEnvStrings) * Unexpansion fails. */ StringCchCopyW(TestStr, _countof(TestStr), L"%SystemRoot%\"); - len = wcslen(TestStr); + len = lstrlenW(TestStr); ret = GetEnvironmentVariableW(L"ProgramFiles", TestStr + len, _countof(TestStr) - len); ok(ret, "got %lu\n", ret); DO_TEST(FALSE, TestStr, L"%SystemRoot%\%ProgramFiles%"); @@ -100,7 +100,7 @@ START_TEST(PathUnExpandEnvStrings) ret = GetEnvironmentVariableW(L"SystemRoot", TestStr, _countof(TestStr)); ok(ret, "got %lu\n", ret); StringCchCatW(TestStr, _countof(TestStr), L"\notepad.exe "); - len = wcslen(TestStr); + len = lstrlenW(TestStr); ret = GetEnvironmentVariableW(L"SystemRoot", TestStr + len, _countof(TestStr) - len); ok(ret, "got %lu\n", ret); StringCchCatW(TestStr, _countof(TestStr), L"\file.txt"); @@ -111,7 +111,7 @@ START_TEST(PathUnExpandEnvStrings) * Unexpansion succeeds only on the first path. */ StringCchCopyW(ExpStr, _countof(ExpStr), L"%SystemRoot%\notepad.exe "); - len = wcslen(ExpStr); + len = lstrlenW(ExpStr); ret = GetEnvironmentVariableW(L"SystemRoot", ExpStr + len, _countof(ExpStr) - len); ok(ret, "got %lu\n", ret); StringCchCatW(ExpStr, _countof(ExpStr), L"\file.txt"); diff --git a/modules/rostests/apitests/spoolss/MarshallDownStructuresArray.c b/modules/rostests/apitests/spoolss/MarshallDownStructuresArray.c index 7f37a117096..6f926ec033b 100644 --- a/modules/rostests/apitests/spoolss/MarshallDownStructuresArray.c +++ b/modules/rostests/apitests/spoolss/MarshallDownStructuresArray.c @@ -35,7 +35,7 @@ START_TEST(MarshallDownStructuresArray) PPORT_INFO_2W pPortInfo2Test; PBYTE pPortInfoEnd; PCWSTR pwszStrings[] = { L"PortName", L"MonitorName", L"Description" }; - DWORD cbPortInfo2Size = cElements * (sizeof(PORT_INFO_2W) + (wcslen(pwszStrings[0]) + 1 + wcslen(pwszStrings[1]) + 1 + wcslen(pwszStrings[2]) + 1) * sizeof(WCHAR)); + SIZE_T cbPortInfo2Size = cElements * (sizeof(PORT_INFO_2W) + (wcslen(pwszStrings[0]) + 1 + wcslen(pwszStrings[1]) + 1 + wcslen(pwszStrings[2]) + 1) * sizeof(WCHAR)); DWORD fPortType = 1337; DWORD Reserved = 42;
diff --git a/modules/rostests/apitests/win32nt/CMakeLists.txt b/modules/rostests/apitests/win32nt/CMakeLists.txt index bdda9755197..35cd83eea1f 100644 --- a/modules/rostests/apitests/win32nt/CMakeLists.txt +++ b/modules/rostests/apitests/win32nt/CMakeLists.txt @@ -67,47 +67,22 @@ list(APPEND SOURCE #osver.c win32nt.h)
-add_library(win32knt_static STATIC ${SOURCE} w32knapi.rc) -add_dependencies(win32knt_static xdk) -add_pch(win32knt_static win32nt.h SOURCE) +add_executable(win32knt_apitest + ${SOURCE} + testlist.c + w32knapi.rc)
-set(WIN32KNT_IMPORTLIBS gdi32 user32 shell32 advapi32 msvcrt kernel32 ntdll) - -if(1) # ros - add_executable(win32knt_apitest testlist.c) - target_link_libraries(win32knt_apitest ${PSEH_LIB} win32knt_static gditools) - set_module_type(win32knt_apitest win32cui) - add_importlibs(win32knt_apitest win32u ${WIN32KNT_IMPORTLIBS}) - - add_rostests_file(TARGET win32knt_apitest) -endif() - -if(0) # Specify 1 if you want 2ksp4 version - # See also ../win32u/CMakeLists.txt - add_executable(win32knt_2ksp4_apitest testlist.c) - target_link_libraries(win32knt_2ksp4_apitest ${PSEH_LIB} win32knt_static gditools) - set_module_type(win32knt_2ksp4_apitest win32cui) - add_importlibs(win32knt_2ksp4_apitest win32u_2ksp4 ${WIN32KNT_IMPORTLIBS}) -endif() - -if(1) # xpsp2 - add_executable(win32knt_xpsp2_apitest testlist.c) - target_link_libraries(win32knt_xpsp2_apitest ${PSEH_LIB} win32knt_static gditools) - set_module_type(win32knt_xpsp2_apitest win32cui) - add_importlibs(win32knt_xpsp2_apitest win32u_xpsp2 ${WIN32KNT_IMPORTLIBS}) -endif() - -if(1) # 2k3sp2 - add_executable(win32knt_2k3sp2_apitest testlist.c) - target_link_libraries(win32knt_2k3sp2_apitest ${PSEH_LIB} win32knt_static gditools) - set_module_type(win32knt_2k3sp2_apitest win32cui) - add_importlibs(win32knt_2k3sp2_apitest win32u_2k3sp2 ${WIN32KNT_IMPORTLIBS}) -endif() - -if(0) # Specify 1 if you want vista version - # See also ../win32u/CMakeLists.txt - add_executable(win32knt_vista_apitest testlist.c) - target_link_libraries(win32knt_vista_apitest ${PSEH_LIB} win32knt_static gditools) - set_module_type(win32knt_vista_apitest win32cui) - add_importlibs(win32knt_vista_apitest win32u_vista ${WIN32KNT_IMPORTLIBS}) -endif() +target_link_libraries(win32knt_apitest ${PSEH_LIB} gditools) +set_module_type(win32knt_apitest win32cui) +add_importlibs(win32knt_apitest + gdi32 + user32 + shell32 + advapi32 + msvcrt + kernel32 + ntdll) +add_delay_importlibs(win32knt_apitest win32u) +add_dependencies(win32knt_apitest xdk) +add_pch(win32knt_apitest win32nt.h SOURCE) +add_rostests_file(TARGET win32knt_apitest) diff --git a/modules/rostests/apitests/win32nt/ntdd/NtGdiDdQueryDirectDrawObject.c b/modules/rostests/apitests/win32nt/ntdd/NtGdiDdQueryDirectDrawObject.c index e682b7d25fe..0f9bc623f31 100644 --- a/modules/rostests/apitests/win32nt/ntdd/NtGdiDdQueryDirectDrawObject.c +++ b/modules/rostests/apitests/win32nt/ntdd/NtGdiDdQueryDirectDrawObject.c @@ -196,7 +196,7 @@ START_TEST(NtGdiDdQueryDirectDrawObject) // pHalInfo->vmiData->dwAlphaAlign
/* the primary display address */ - RTEST( ( (DWORD)pHalInfo->vmiData.pvPrimary & (~0x80000000)) != 0 ); + RTEST( ( (DWORD_PTR)pHalInfo->vmiData.pvPrimary & (~0x80000000)) != 0 );
/* test see if we got back the pvmList here * acording msdn vmiData.dwNumHeaps and vmiData.pvmList @@ -231,8 +231,8 @@ START_TEST(NtGdiDdQueryDirectDrawObject) if (pHalInfo->dwFlags != 0) { RTEST( (pHalInfo->dwFlags & (DDHALINFO_GETDRIVERINFOSET | DDHALINFO_GETDRIVERINFO2)) != 0 ); - RTEST( ( (DWORD)pHalInfo->GetDriverInfo & 0x80000000) != 0 ); - ASSERT( ((DWORD)pHalInfo->GetDriverInfo & 0x80000000) != 0 ); + RTEST( ( (DWORD_PTR)pHalInfo->GetDriverInfo & 0x80000000) != 0 ); + ASSERT( ((DWORD_PTR)pHalInfo->GetDriverInfo & 0x80000000) != 0 ); }
/* point to kmode direcly to the graphic drv, the drv is kmode and it is kmode address we getting back*/ @@ -244,9 +244,9 @@ START_TEST(NtGdiDdQueryDirectDrawObject) * * point to kmode direcly to the win32k.sys, win32k.sys is kmode and it is kmode address we getting back */ - RTEST( ( (DWORD)pHalInfo->lpD3DGlobalDriverData & (~0x80000000)) != 0 ); - RTEST( ( (DWORD)pHalInfo->lpD3DHALCallbacks & (~0x80000000)) != 0 ); - RTEST( ( (DWORD)pHalInfo->lpD3DHALCallbacks & (~0x80000000)) != 0 ); + RTEST( ( (DWORD_PTR)pHalInfo->lpD3DGlobalDriverData & (~0x80000000)) != 0 ); + RTEST( ( (DWORD_PTR)pHalInfo->lpD3DHALCallbacks & (~0x80000000)) != 0 ); + RTEST( ( (DWORD_PTR)pHalInfo->lpD3DHALCallbacks & (~0x80000000)) != 0 ); }
/* Backup DD_HALINFO so we do not need resting it */ @@ -504,7 +504,7 @@ START_TEST(NtGdiDdQueryDirectDrawObject) if (puD3dBufferCallbacks->dwFlags & DDHAL_D3DBUFCB32_CANCREATED3DBUF) { /* point to kmode direcly to the graphic drv, the drv is kmode and it is kmode address we getting back*/ - RTEST( ( (DWORD)puD3dBufferCallbacks->CanCreateD3DBuffer & (~0x80000000)) != 0 ); + RTEST( ( (DWORD_PTR)puD3dBufferCallbacks->CanCreateD3DBuffer & (~0x80000000)) != 0 ); } else { @@ -514,7 +514,7 @@ START_TEST(NtGdiDdQueryDirectDrawObject) if (puD3dBufferCallbacks->dwFlags & DDHAL_D3DBUFCB32_CREATED3DBUF) { /* point to kmode direcly to the graphic drv, the drv is kmode and it is kmode address we getting back*/ - RTEST( ( (DWORD)puD3dBufferCallbacks->CreateD3DBuffer & (~0x80000000)) != 0 ); + RTEST( ( (DWORD_PTR)puD3dBufferCallbacks->CreateD3DBuffer & (~0x80000000)) != 0 ); } else { @@ -524,7 +524,7 @@ START_TEST(NtGdiDdQueryDirectDrawObject) if (puD3dBufferCallbacks->dwFlags & DDHAL_D3DBUFCB32_DESTROYD3DBUF) { /* point to kmode direcly to the graphic drv, the drv is kmode and it is kmode address we getting back*/ - RTEST( ( (DWORD)puD3dBufferCallbacks->DestroyD3DBuffer & (~0x80000000)) != 0 ); + RTEST( ( (DWORD_PTR)puD3dBufferCallbacks->DestroyD3DBuffer & (~0x80000000)) != 0 ); } else { @@ -534,7 +534,7 @@ START_TEST(NtGdiDdQueryDirectDrawObject) if (puD3dBufferCallbacks->dwFlags & DDHAL_D3DBUFCB32_LOCKD3DBUF) { /* point to kmode direcly to the graphic drv, the drv is kmode and it is kmode address we getting back*/ - RTEST( ( (DWORD)puD3dBufferCallbacks->LockD3DBuffer & (~0x80000000)) != 0 ); + RTEST( ( (DWORD_PTR)puD3dBufferCallbacks->LockD3DBuffer & (~0x80000000)) != 0 ); } else { @@ -544,7 +544,7 @@ START_TEST(NtGdiDdQueryDirectDrawObject) if (puD3dBufferCallbacks->dwFlags & DDHAL_D3DBUFCB32_UNLOCKD3DBUF) { /* point to kmode direcly to the graphic drv, the drv is kmode and it is kmode address we getting back*/ - RTEST( ( (DWORD)puD3dBufferCallbacks->UnlockD3DBuffer & (~0x80000000)) != 0 ); + RTEST( ( (DWORD_PTR)puD3dBufferCallbacks->UnlockD3DBuffer & (~0x80000000)) != 0 ); } else { @@ -653,7 +653,7 @@ START_TEST(NtGdiDdQueryDirectDrawObject) } RTEST(myDesc->ddsCaps.dwCaps == DDSCAPS_TEXTURE);
- myDesc = (DDSURFACEDESC *) (((DWORD) myDesc) + sizeof(DDSURFACEDESC)); + myDesc = (DDSURFACEDESC *) (((DWORD_PTR) myDesc) + sizeof(DDSURFACEDESC)); } }
diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateBitmap.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateBitmap.c index b6f2afad9ea..fd0bd1601a7 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateBitmap.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateBitmap.c @@ -51,7 +51,7 @@ void Test_NtGdiCreateBitmap_Params(void)
/* Test negative cy and invalid bits */ SetLastError(ERROR_SUCCESS); - ok_ptr(NtGdiCreateBitmap(1, -2, 1, 1, (BYTE*)0x80001234), NULL); + ok_ptr(NtGdiCreateBitmap(1, -2, 1, 1, (BYTE*)(LONG_PTR)0x80001234), NULL); ok_long(GetLastError(), ERROR_SUCCESS);
/* Test huge size */ @@ -66,7 +66,7 @@ void Test_NtGdiCreateBitmap_Params(void)
/* Test huge size and invalid bits */ SetLastError(ERROR_SUCCESS); - ok_ptr(NtGdiCreateBitmap(100000, 100000, 1, 1, (BYTE*)0x80001234), NULL); + ok_ptr(NtGdiCreateBitmap(100000, 100000, 1, 1, (BYTE*)(LONG_PTR)0x80001234), NULL); ok_long(GetLastError(), ERROR_SUCCESS);
/* Test cPlanes == 0 */ @@ -148,7 +148,7 @@ void Test_NtGdiCreateBitmap_Params(void)
/* Test bad pointer */ SetLastError(ERROR_SUCCESS); - ok_ptr(NtGdiCreateBitmap(1, 1, 1, 1, (BYTE*)0x80001234), NULL); + ok_ptr(NtGdiCreateBitmap(1, 1, 1, 1, (BYTE*)(LONG_PTR)0x80001234), NULL); ok_long(GetLastError(), ERROR_SUCCESS);
/* Test pointer alignment */ diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateDIBSection.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateDIBSection.c index 0a69fe41ddf..b6f90e18000 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateDIBSection.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateDIBSection.c @@ -104,7 +104,7 @@ START_TEST(NtGdiCreateDIBSection) /* Test a wrong HDC */ SetLastError(0); pvBits = 0; - hbmp = NtGdiCreateDIBSection((HDC)0xdeadbeef, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits); + hbmp = NtGdiCreateDIBSection((HDC)(LONG_PTR)0xdeadbeef, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits); TEST(pvBits != 0); TEST(hbmp != 0); TEST(GetLastError() == 8); @@ -122,7 +122,7 @@ START_TEST(NtGdiCreateDIBSection) /* Test invalid pbmi */ SetLastError(0); pvBits = (PVOID)-1; - hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, (PVOID)0x80001234, 0, cjHeader, 0, 0, &pvBits); + hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, (PVOID)(LONG_PTR)0x80001234, 0, cjHeader, 0, 0, &pvBits); TEST(pvBits == (PVOID)-1); TEST(hbmp == 0); TEST(GetLastError() == ERROR_INVALID_PARAMETER); @@ -131,7 +131,7 @@ START_TEST(NtGdiCreateDIBSection) /* Test invalid pbmi */ SetLastError(0); pvBits = (PVOID)-1; - hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, (PVOID)1, 0, cjHeader, 0, 0, &pvBits); + hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, (PVOID)(LONG_PTR)1, 0, cjHeader, 0, 0, &pvBits); TEST(pvBits == (PVOID)-1); TEST(hbmp == 0); TEST(GetLastError() == ERROR_INVALID_PARAMETER); diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtTextOutW.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtTextOutW.c index be471ea6500..044a0cde567 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtTextOutW.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtTextOutW.c @@ -40,7 +40,7 @@ START_TEST(NtGdiExtTextOutW) hDC = GetDC(hWnd);
lpstr = L"Hallo"; - len = wcslen(lpstr); + len = lstrlenW(lpstr);
ret = NtGdiExtTextOutW(hDC, 0, 0, 0, &rect, lpstr, len, Dx, 0); ok_int(ret, 1); diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiPolyPolyDraw.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiPolyPolyDraw.c index 4b9ffc4d54d..daf0840abbf 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiPolyPolyDraw.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiPolyPolyDraw.c @@ -128,7 +128,7 @@ Test_Params(void) TEST(GetLastError() == 0);
SetLastError(0); - ret = NtGdiPolyPolyDraw(hDC, Points, (PVOID)0x81000000, 2, 1); + ret = NtGdiPolyPolyDraw(hDC, Points, (PVOID)(LONG_PTR)0x81000000, 2, 1); TEST(ret == 0); TEST(GetLastError() == 0);
@@ -138,7 +138,7 @@ Test_Params(void) TEST(GetLastError() == 0);
SetLastError(0); - ret = NtGdiPolyPolyDraw(hDC, (PVOID)0x81000000, Count1, 2, 1); + ret = NtGdiPolyPolyDraw(hDC, (PVOID)(LONG_PTR)0x81000000, Count1, 2, 1); TEST(ret == 0); TEST(GetLastError() == 0);
diff --git a/modules/rostests/apitests/win32nt/ntuser/NtUserProcessConnect.c b/modules/rostests/apitests/win32nt/ntuser/NtUserProcessConnect.c index ba9542b326f..e89a65b7073 100644 --- a/modules/rostests/apitests/win32nt/ntuser/NtUserProcessConnect.c +++ b/modules/rostests/apitests/win32nt/ntuser/NtUserProcessConnect.c @@ -16,7 +16,7 @@ START_TEST(NtUserProcessConnect) hProcess = GetCurrentProcess();
UserConnect.ulVersion = MAKELONG(0, 5); - Status = NtUserProcessConnect(hProcess, (USERCONNECT*)&UserConnect, sizeof(USERCONNECT)); + Status = NtUserProcessConnect(hProcess, &UserConnect, sizeof(USERCONNECT)); TEST(NT_SUCCESS(Status));
printf("UserConnect.ulVersion = 0x%lx\n", UserConnect.ulVersion); @@ -25,6 +25,6 @@ START_TEST(NtUserProcessConnect) printf("UserConnect.siClient.psi = 0x%p\n", UserConnect.siClient.psi); printf("UserConnect.siClient.aheList = 0x%p\n", UserConnect.siClient.aheList); printf("UserConnect.siClient.pDispInfo = 0x%p\n", UserConnect.siClient.pDispInfo); - printf("UserConnect.siClient.ulSharedDelta = 0x%lx\n", UserConnect.siClient.ulSharedDelta); + printf("UserConnect.siClient.ulSharedDelta = 0x%Ix\n", UserConnect.siClient.ulSharedDelta);
} diff --git a/modules/rostests/apitests/win32nt/ntuser/NtUserScrollDC.c b/modules/rostests/apitests/win32nt/ntuser/NtUserScrollDC.c index e002aaee0c6..4d9534563d0 100644 --- a/modules/rostests/apitests/win32nt/ntuser/NtUserScrollDC.c +++ b/modules/rostests/apitests/win32nt/ntuser/NtUserScrollDC.c @@ -84,7 +84,7 @@ START_TEST(NtUserScrollDC)
/* Test invalid update rect */ SetLastError(ERROR_SUCCESS); - Result = NtUserScrollDC(hDC, 10, 20, &rcScroll, &rcClip, hRgn, (PVOID)0x80001000); + Result = NtUserScrollDC(hDC, 10, 20, &rcScroll, &rcClip, hRgn, (PVOID)(LONG_PTR)0x80001000); RTEST(Result == 0); RTEST(GetLastError() == ERROR_NOACCESS);
diff --git a/modules/rostests/apitests/win32nt/ntuser/NtUserSystemParametersInfo.c b/modules/rostests/apitests/win32nt/ntuser/NtUserSystemParametersInfo.c index 1f0dfedbc95..518ed8e0e07 100644 --- a/modules/rostests/apitests/win32nt/ntuser/NtUserSystemParametersInfo.c +++ b/modules/rostests/apitests/win32nt/ntuser/NtUserSystemParametersInfo.c @@ -313,7 +313,7 @@ Test_NtUserSystemParametersInfo_Params(void) #endif /* Test invalid pointer */ SetLastError(ERROR_SUCCESS); - TEST(NtUserSystemParametersInfo(SPI_GETFOCUSBORDERHEIGHT, 0, (PVOID)0x80000000, 0) == FALSE); + TEST(NtUserSystemParametersInfo(SPI_GETFOCUSBORDERHEIGHT, 0, (PVOID)(LONG_PTR)0x80000000, 0) == FALSE); TEST(GetLastError() == ERROR_NOACCESS); for(i = 0; i < 1000; i++) data[i] = 0xdeadbeef;
@@ -452,7 +452,7 @@ Test_UserPref(UINT uiGet, UINT uiSet, DWORD dwPrefMask) TEST((dwUserPref & (~dwPrefMask)) == (dwUserPrefOrg & (~dwPrefMask)));
/* Restore original value */ - NtUserSystemParametersInfo(uiSet, 0, (PVOID)bOrig, SPIF_UPDATEINIFILE); + NtUserSystemParametersInfo(uiSet, 0, (PVOID)(ULONG_PTR)bOrig, SPIF_UPDATEINIFILE);
} @@ -744,7 +744,7 @@ Test_SPI_SETNONCLIENTMETRICS(void)
metrics.cbSize = sizeof(NONCLIENTMETRICSW); TEST(NtUserSystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), &metrics, 0) == 1); - TEST(NtUserSystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), (PVOID)0xdeadbeef, 0) == 0); + TEST(NtUserSystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), (PVOID)(LONG_PTR)0xdeadbeef, 0) == 0);
origMetrics = metrics;
@@ -764,7 +764,7 @@ Test_SPI_SETMINIMIZEDMETRICS(void)
metrics.cbSize = sizeof(MINIMIZEDMETRICS); TEST(NtUserSystemParametersInfo(SPI_GETMINIMIZEDMETRICS, sizeof(MINIMIZEDMETRICS), (PVOID)&metrics, 0) == 1); - TEST(NtUserSystemParametersInfo(SPI_GETMINIMIZEDMETRICS, sizeof(MINIMIZEDMETRICS), (PVOID)0xdeadbeef, 0) == 0); + TEST(NtUserSystemParametersInfo(SPI_GETMINIMIZEDMETRICS, sizeof(MINIMIZEDMETRICS), (PVOID)(LONG_PTR)0xdeadbeef, 0) == 0);
origMetrics = metrics;
@@ -784,7 +784,7 @@ Test_SPI_SETICONMETRICS(void)
metrics.cbSize = sizeof(ICONMETRICSW); TEST(NtUserSystemParametersInfo(SPI_GETICONMETRICS, sizeof(ICONMETRICSW), (PVOID)&metrics, 0) == 1); - TEST(NtUserSystemParametersInfo(SPI_GETICONMETRICS, sizeof(ICONMETRICSW), (PVOID)0xdeadbeef, 0) == 0); + TEST(NtUserSystemParametersInfo(SPI_GETICONMETRICS, sizeof(ICONMETRICSW), (PVOID)(LONG_PTR)0xdeadbeef, 0) == 0);
origMetrics = metrics;
@@ -817,7 +817,7 @@ Test_SPI_SETWORKAREA(void) TEST(NtUserSystemParametersInfo(SPI_GETWORKAREA, 1, &rc, 0) == 1); TEST(NtUserSystemParametersInfo(SPI_GETWORKAREA, -1, &rc, 0) == 1); TEST(NtUserSystemParametersInfo(SPI_GETWORKAREA, 0xdeadbeef, &rc, 0) == 1); - TEST(NtUserSystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID)0xdeadbeef, 0) == 0); + TEST(NtUserSystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID)(LONG_PTR)0xdeadbeef, 0) == 0);
/* Test values */ rc = rcOrig; rc.left = -1; @@ -1032,7 +1032,7 @@ Test_SPI_SETMENUANIMATION(void)
/* Restore original values */ - NtUserSystemParametersInfo(SPI_SETMENUANIMATION, 0, (PVOID)bOrig, SPIF_UPDATEINIFILE); + NtUserSystemParametersInfo(SPI_SETMENUANIMATION, 0, (PVOID)(ULONG_PTR)bOrig, SPIF_UPDATEINIFILE); }
// Test_SPI_SETCOMBOBOXANIMATION(); diff --git a/modules/rostests/apitests/ws2_32/WSARecv.c b/modules/rostests/apitests/ws2_32/WSARecv.c index 89f500f7066..c81b775b9ce 100644 --- a/modules/rostests/apitests/ws2_32/WSARecv.c +++ b/modules/rostests/apitests/ws2_32/WSARecv.c @@ -95,7 +95,7 @@ void Test_WSARecv()
/* Send the GET request */ buffers.buf = szGetRequest; - buffers.len = strlen(szGetRequest); + buffers.len = lstrlenA(szGetRequest); dwSent = 0; iResult = WSASend(sck, &buffers, 1, &dwSent, 0, &overlapped, NULL); err = WSAGetLastError(); diff --git a/modules/rostests/apitests/ws2_32/getaddrinfo.c b/modules/rostests/apitests/ws2_32/getaddrinfo.c index 068881a07f5..c06ca268c16 100644 --- a/modules/rostests/apitests/ws2_32/getaddrinfo.c +++ b/modules/rostests/apitests/ws2_32/getaddrinfo.c @@ -13,7 +13,7 @@ ok_dec((ai)->ai_family, family); \ ok_dec((ai)->ai_socktype, socktype); \ ok_dec((ai)->ai_protocol, protocol); \ - ok_dec((ai)->ai_addrlen, addrlen); \ + ok_dec((int)(ai)->ai_addrlen, addrlen); \ } while (0)
#define ok_sockaddr_in(sockaddr, family, port, addr) do \ diff --git a/modules/rostests/apitests/ws2_32/gethostname.c b/modules/rostests/apitests/ws2_32/gethostname.c index 4bfb3c4a3db..c1e87d87c1b 100644 --- a/modules/rostests/apitests/ws2_32/gethostname.c +++ b/modules/rostests/apitests/ws2_32/gethostname.c @@ -57,7 +57,7 @@ GetHostnameFromCommand( goto Cleanup;
/* Delete the expected ending line feed character */ - len = strlen(pszHostnameBuffer); + len = lstrlenA(pszHostnameBuffer); if (pszHostnameBuffer[len-1] == '\r' || pszHostnameBuffer[len-1] == '\n') pszHostnameBuffer[len-1] = ANSI_NULL;
@@ -143,7 +143,7 @@ START_TEST(gethostname) /* Change Hostname in the Registry */ szHostNameNew[0] = ANSI_NULL; strcat(szHostNameNew, "ROSHOSTNAME1"); - cbData = strlen(szHostNameNew) + 1; + cbData = lstrlenA(szHostNameNew) + 1;
Error = RegSetValueExA(hKeyHN, "Hostname", 0, REG_SZ, (LPBYTE)szHostNameNew, cbData); ok(Error == ERROR_SUCCESS, "Error setting new registry value (%ld).\n", GetLastError()); @@ -176,7 +176,7 @@ START_TEST(gethostname) ok(pos == 0, "hostbuffer '%s' should have been szHostNameNew '%s'.\n", hostbuffer, szHostNameNew);
/* Reset the original registry entry */ - cbData = strlen(szHostNameOld) + 1; + cbData = lstrlenA(szHostNameOld) + 1;
Error = RegSetValueExA(hKeyHN, "Hostname", 0, REG_SZ, (LPBYTE)szHostNameOld, cbData); ok(Error == ERROR_SUCCESS, "Error resetting new registry value back (%ld).\n", GetLastError()); @@ -204,7 +204,7 @@ START_TEST(gethostname) /* Change Hostname in the Registry */ szHostNameNew[0] = ANSI_NULL; strcat(szHostNameNew, "ROSHOSTNAME1"); - cbData = strlen(szHostNameNew) + 1; + cbData = lstrlenA(szHostNameNew) + 1;
Error = RegSetValueExA(hKeyHN, "Hostname", 0, REG_SZ, (LPBYTE)szHostNameNew, cbData); ok(Error == ERROR_SUCCESS, "Error setting new registry value (%ld).\n", GetLastError()); @@ -222,7 +222,7 @@ START_TEST(gethostname) ok(pos == 0, "szHostNameNew '%s' should be hostbuffer '%s'.\n", szHostNameNew, hostbuffer);
/* Reset the original registry entry */ - cbData = strlen(szHostNameOld) + 1; + cbData = lstrlenA(szHostNameOld) + 1;
Error = RegSetValueExA(hKeyHN, "Hostname", 0, REG_SZ, (LPBYTE)szHostNameOld, cbData); ok(Error == ERROR_SUCCESS, "Error resetting new registry value back (%ld).\n", GetLastError()); diff --git a/modules/rostests/apitests/ws2_32/helpers.c b/modules/rostests/apitests/ws2_32/helpers.c index 702ac3654a7..0bc985a3fac 100644 --- a/modules/rostests/apitests/ws2_32/helpers.c +++ b/modules/rostests/apitests/ws2_32/helpers.c @@ -49,7 +49,7 @@ int GetRequestAndWait(SOCKET sck) struct fd_set readable;
/* Send the GET request */ - SCKTEST(send(sck, szGetRequest, strlen(szGetRequest), 0)); + SCKTEST(send(sck, szGetRequest, lstrlenA(szGetRequest), 0)); ok(iResult == strlen(szGetRequest), "iResult = %d\n", iResult); #if 0 /* breaks windows too */ /* Shutdown the SEND connection */ diff --git a/modules/rostests/kmtests/kmtest/fltsupport.c b/modules/rostests/kmtests/kmtest/fltsupport.c index 1488a44a183..ae0cb05abb4 100644 --- a/modules/rostests/kmtests/kmtest/fltsupport.c +++ b/modules/rostests/kmtests/kmtest/fltsupport.c @@ -481,7 +481,7 @@ KmtFltAddAltitude( 0, REG_SZ, (LPBYTE)DefaultInstance, - (wcslen(DefaultInstance) + 1) * sizeof(WCHAR)); + (lstrlenW(DefaultInstance) + 1) * sizeof(WCHAR)); if (Error != ERROR_SUCCESS) { goto Quit; @@ -498,7 +498,7 @@ KmtFltAddAltitude( 0, REG_SZ, (LPBYTE)Altitude, - (wcslen(Altitude) + 1) * sizeof(WCHAR)); + (lstrlenW(Altitude) + 1) * sizeof(WCHAR)); if (Error != ERROR_SUCCESS) { goto Quit; diff --git a/modules/rostests/kmtests/npfs/NpfsHelpers.c b/modules/rostests/kmtests/npfs/NpfsHelpers.c index 4ba7271792c..10a9fa58fc4 100644 --- a/modules/rostests/kmtests/npfs/NpfsHelpers.c +++ b/modules/rostests/kmtests/npfs/NpfsHelpers.c @@ -291,7 +291,7 @@ NpWaitPipe( ok_eq_hex(IoStatusBlock.Status, Status); ok_eq_ulongptr(IoStatusBlock.Information, FILE_OPENED);
- NameLength = wcslen(PipeName) * sizeof(WCHAR); + NameLength = (ULONG)(wcslen(PipeName) * sizeof(WCHAR)); BufferSize = FIELD_OFFSET(FILE_PIPE_WAIT_FOR_BUFFER, Name[NameLength / sizeof(WCHAR)]); WaitForBuffer = ExAllocatePoolWithTag(NonPagedPool, BufferSize, 'WPmK'); diff --git a/modules/rostests/kmtests/ntos_io/IoFilesystem.c b/modules/rostests/kmtests/ntos_io/IoFilesystem.c index ff3a502f537..0c3f04db9bb 100644 --- a/modules/rostests/kmtests/ntos_io/IoFilesystem.c +++ b/modules/rostests/kmtests/ntos_io/IoFilesystem.c @@ -242,8 +242,8 @@ Substitute( PWCHAR Dest = Buffer; UNICODE_STRING String;
- SystemDriveLength = wcslen(SystemDriveName) * sizeof(WCHAR); - SystemRootLength = wcslen(SystemRootName) * sizeof(WCHAR); + SystemDriveLength = (ULONG)wcslen(SystemDriveName) * sizeof(WCHAR); + SystemRootLength = (ULONG)wcslen(SystemRootName) * sizeof(WCHAR);
RtlInitUnicodeString(&String, Template); ASSERT(String.Length % sizeof(WCHAR) == 0); diff --git a/modules/rostests/kmtests/rtl/RtlStrSafe.c b/modules/rostests/kmtests/rtl/RtlStrSafe.c index 82c2fe512cc..3bb8d30355a 100644 --- a/modules/rostests/kmtests/rtl/RtlStrSafe.c +++ b/modules/rostests/kmtests/rtl/RtlStrSafe.c @@ -24,7 +24,7 @@ Test_RtlUnicodeStringPrintf() { NTSTATUS Status; PWSTR pBuffer = NULL; - size_t BufferSize; + USHORT BufferSize; size_t EqualBytes; UNICODE_STRING UsString;
@@ -103,7 +103,7 @@ Test_RtlUnicodeStringPrintfEx() { NTSTATUS Status; PWSTR pBuffer = NULL; - size_t BufferSize; + USHORT BufferSize; size_t EqualBytes; UNICODE_STRING RemString; UNICODE_STRING UsString; diff --git a/modules/rostests/rosautotest/CJournaledTestList.cpp b/modules/rostests/rosautotest/CJournaledTestList.cpp index 925a408b71f..ef1787d7e09 100644 --- a/modules/rostests/rosautotest/CJournaledTestList.cpp +++ b/modules/rostests/rosautotest/CJournaledTestList.cpp @@ -90,7 +90,7 @@ void CJournaledTestList::SerializeIntoJournal(const string& String) { DWORD BytesWritten; - WriteFile(m_hJournal, String.c_str(), String.size() + 1, &BytesWritten, NULL); + WriteFile(m_hJournal, String.c_str(), (ULONG)String.size() + 1, &BytesWritten, NULL); FlushFileBuffers(m_hJournal); }
@@ -106,7 +106,7 @@ void CJournaledTestList::SerializeIntoJournal(const wstring& String) { DWORD BytesWritten; - WriteFile(m_hJournal, String.c_str(), (String.size() + 1) * sizeof(WCHAR), &BytesWritten, NULL); + WriteFile(m_hJournal, String.c_str(), ((ULONG)String.size() + 1) * sizeof(WCHAR), &BytesWritten, NULL); FlushFileBuffers(m_hJournal); }
diff --git a/modules/rostests/rosautotest/CWebService.cpp b/modules/rostests/rosautotest/CWebService.cpp index 1a8ae3710d5..9edcebe7433 100644 --- a/modules/rostests/rosautotest/CWebService.cpp +++ b/modules/rostests/rosautotest/CWebService.cpp @@ -77,7 +77,7 @@ CWebService::DoRequest(const string& InputData) Data.reset(new char[InputData.size() + 1]); strcpy(Data, InputData.c_str());
- if(!HttpSendRequestW(m_hHTTPRequest, szHeaders, wcslen(szHeaders), Data, InputData.size())) + if(!HttpSendRequestW(m_hHTTPRequest, szHeaders, lstrlenW(szHeaders), Data, (DWORD)InputData.size())) FATAL("HttpSendRequestW failed\n");
/* Get the response */ diff --git a/modules/rostests/win32/cmd/batch.c b/modules/rostests/win32/cmd/batch.c index e1db7c9ec90..e6a77d95d77 100644 --- a/modules/rostests/win32/cmd/batch.c +++ b/modules/rostests/win32/cmd/batch.c @@ -71,7 +71,7 @@ static const char* convert_input_data(const char *data, DWORD size, DWORD *new_s } *ptr = '\0';
- *new_size = strlen(new_data); + *new_size = lstrlenA(new_data); return new_data; }
diff --git a/modules/rostests/win32/user32/biditext/biditext.c b/modules/rostests/win32/user32/biditext/biditext.c index ee11d56b79b..6d0c263c8c9 100644 --- a/modules/rostests/win32/user32/biditext/biditext.c +++ b/modules/rostests/win32/user32/biditext/biditext.c @@ -190,7 +190,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
const WCHAR szString[] = {ALEF, BET, GIMEL, DALET, HEY, 'A', 'B', 'C', 'D', VAV, ZAYIN, HET, TET, YUD, 0}; const WCHAR szReversedString[] = {HEY, DALET, GIMEL, BET, ALEF, 'A', 'B', 'C', 'D', YUD, TET, HET, ZAYIN, VAV, 0}; - int Len = wcslen(szString); + int Len = lstrlenW(szString); int i, xpos, tempLength; WCHAR tempString[20] = { 0 }; WCHAR Glyphs[100] = { 0 }; @@ -247,15 +247,15 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) for (i = 0, xpos = 10; i < Len; i++, xpos += 30) { StringCchPrintfW(tempString, 20, L"%d", i); - tempLength = wcslen(tempString); + tempLength = lstrlenW(tempString); TextOutW(hdc, xpos, 430, tempString, tempLength);
StringCchPrintfW(tempString, 20, L"%d", lpOrder[i]); - tempLength = wcslen(tempString); + tempLength = lstrlenW(tempString); TextOutW(hdc, xpos, 450, tempString, tempLength);
StringCchPrintfW(tempString, 20, L"%d", lpCaretPos[i]); - tempLength = wcslen(tempString); + tempLength = lstrlenW(tempString); TextOutW(hdc, xpos, 470, tempString, tempLength);
TextOutW(hdc, xpos, 490, &szString[i], 1); @@ -271,15 +271,15 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) for (i = 0, xpos = 10; i < Len; i++, xpos += 30) { StringCchPrintfW(tempString, 20, L"%d", i); - tempLength = wcslen(tempString); + tempLength = lstrlenW(tempString); TextOutW(hdc, xpos, 530, tempString, tempLength);
StringCchPrintfW(tempString, 20, L"%d", lpOrder[i]); - tempLength = wcslen(tempString); + tempLength = lstrlenW(tempString); TextOutW(hdc, xpos, 550, tempString, tempLength);
StringCchPrintfW(tempString, 20, L"%d", lpCaretPos[i]); - tempLength = wcslen(tempString); + tempLength = lstrlenW(tempString); TextOutW(hdc, xpos, 570, tempString, tempLength);
TextOutW(hdc, xpos, 590, &szString[i], 1); diff --git a/modules/rostests/win32/user32/psmtest/psmtest.c b/modules/rostests/win32/user32/psmtest/psmtest.c index 1299bcc21f1..39b5b60003d 100644 --- a/modules/rostests/win32/user32/psmtest/psmtest.c +++ b/modules/rostests/win32/user32/psmtest/psmtest.c @@ -32,15 +32,15 @@ static void DrawTest(HDC hdc, int ypos, LPCWSTR str, DWORD dwFlags, int testtype
if (testtype == LPK) { - ret = LpkPSMTextOut(hdc, 0, ypos, str, (!str) ? 10 : wcslen(str), dwFlags); + ret = LpkPSMTextOut(hdc, 0, ypos, str, (!str) ? 10 : lstrlenW(str), dwFlags); StringCchPrintfW(Result, 100, L"Return Value = %d", ret); - TextOutW(hdc, 200, ypos, Result, wcslen(Result)); + TextOutW(hdc, 200, ypos, Result, lstrlenW(Result)); } else if (testtype == USERLPK) { - ret = UserLpkPSMTextOut(hdc, 400, ypos, str, wcslen(str), dwFlags); + ret = UserLpkPSMTextOut(hdc, 400, ypos, str, lstrlenW(str), dwFlags); StringCchPrintfW(Result, 100, L"Return Value = %d", ret); - TextOutW(hdc, 600, ypos, Result, wcslen(Result)); + TextOutW(hdc, 600, ypos, Result, lstrlenW(Result)); }
} diff --git a/modules/rostests/winetests/CMakeLists.txt b/modules/rostests/winetests/CMakeLists.txt index 3049c7d7860..8bb0f90d9f4 100644 --- a/modules/rostests/winetests/CMakeLists.txt +++ b/modules/rostests/winetests/CMakeLists.txt @@ -1,8 +1,18 @@
add_definitions(-D__ROS_LONG64__)
-if (MSVC AND ARCH STREQUAL "amd64") - add_compile_flags("/wd4312") +if (MSVC) + add_compile_flags("/wd4090") # C4090: 'function': different 'const' qualifiers + add_compile_flags("/wd4133") # C4133: 'function': incompatible types - from '<enum> *' to 'UINT *' + add_compile_flags("/wd4146") # C4146: unary minus operator applied to unsigned type, result still unsigned + add_compile_flags("/wd4189") # C4189: 'x': local variable is initialized but not referenced + add_compile_flags("/wd4267") # C4267: '=': conversion from 'size_t' to 'int', possible loss of data + add_compile_flags("/wd4305") # C4305: '=': truncation from 'double' to 'FLOAT' + if (ARCH STREQUAL "amd64") + add_compile_flags("/wd4101") # C4101: 'x': unreferenced local variable + add_compile_flags("/wd4312") # C4312: 'type cast': conversion from 'unsigned int' to 'char *' of greater size + add_compile_flags("/wd4334") # C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) + endif() endif()
add_subdirectory(advapi32) diff --git a/sdk/include/crt/xmmintrin.h b/sdk/include/crt/xmmintrin.h index 2db9fb0ea2a..59a1732875d 100644 --- a/sdk/include/crt/xmmintrin.h +++ b/sdk/include/crt/xmmintrin.h @@ -31,12 +31,16 @@ extern "C" {
extern __m128 _mm_load_ss(float const*); extern int _mm_cvt_ss2si(__m128); +__m128 _mm_xor_ps(__m128 a, __m128 b); +__m128 _mm_div_ps(__m128 a, __m128 b);
#ifdef _MSC_VER unsigned int _mm_getcsr(void); #pragma intrinsic(_mm_getcsr) void _mm_setcsr(unsigned int); #pragma intrinsic(_mm_setcsr) +#pragma intrinsic(_mm_xor_ps) +#pragma intrinsic(_mm_div_ps) #else
#ifndef __INTRIN_INLINE diff --git a/sdk/include/psdk/shlwapi.h b/sdk/include/psdk/shlwapi.h index 40fefc512b4..65f9db98312 100644 --- a/sdk/include/psdk/shlwapi.h +++ b/sdk/include/psdk/shlwapi.h @@ -2072,7 +2072,11 @@ BOOL WINAPI IsOS(DWORD); typedef struct { const IID *piid; - int dwOffset; +#if defined(__REACTOS__) || (WINVER >= _WIN32_WINNT_WIN10) + DWORD dwOffset; +#else + int dwOffset; +#endif } QITAB, *LPQITAB;
HRESULT diff --git a/sdk/lib/atl/atlbase.h b/sdk/lib/atl/atlbase.h index fc0755c1743..7edacf328e9 100644 --- a/sdk/lib/atl/atlbase.h +++ b/sdk/lib/atl/atlbase.h @@ -1367,15 +1367,16 @@ protected: // get the total size of a multistring static ULONG _GetMultiStringSize(LPCTSTR pszz) { - int count = 0; + size_t count = 0; do { - int len = _tcslen(pszz); + size_t len = _tcslen(pszz); count += len + 1; pszz += len + 1; } while (*pszz != TEXT('\0')); ++count; - return count * sizeof(TCHAR); + ATLASSERT(count * sizeof(TCHAR) <= ULONGMAX); + return (ULONG)count * sizeof(TCHAR); }
// delete key recursively