[ROSTESTS] fix x64 build and fix/disable warnings

This commit is contained in:
Timo Kreuzer 2019-05-30 17:12:28 +02:00
parent 6a67450893
commit 42d2d5ec9c
56 changed files with 229 additions and 171 deletions

View file

@ -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()

View file

@ -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());
}

View file

@ -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

View file

@ -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, ...)

View file

@ -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();
}

View file

@ -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

View file

@ -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);

View file

@ -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);

View file

@ -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"

View file

@ -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),

View file

@ -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);

View file

@ -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");
}

View file

@ -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);
}

View file

@ -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);

View file

@ -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;

View file

@ -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);
}

View file

@ -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,

View file

@ -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);
}
}

View file

@ -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;
}

View file

@ -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);

View file

@ -1542,7 +1542,7 @@ Test_Truncate(VOID)
HANDLE Handle;
HANDLE SectionHandle;
ULONG Length;
SIZE_T Length;
BOOL Success;
DWORD Written, Error;
VOID* BaseAddress;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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);
}

View file

@ -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++)
{

View file

@ -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++)
{

View file

@ -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)
{

View file

@ -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");

View file

@ -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;

View file

@ -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)

View file

@ -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));
}
}

View file

@ -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 */

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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);

View file

@ -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();

View file

@ -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();

View file

@ -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 \

View file

@ -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());

View file

@ -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 */

View file

@ -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;

View file

@ -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');

View file

@ -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);

View file

@ -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;

View file

@ -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);
}

View file

@ -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 */

View file

@ -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;
}

View file

@ -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);

View file

@ -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));
}
}

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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