ntdll: Enable compilation with -D__WINESRC__.

oldstable
André Hentschel 2013-11-05 22:44:42 +01:00 committed by Alexandre Julliard
parent 94d8e3ab68
commit a160a65317
8 changed files with 50 additions and 51 deletions

View File

@ -1,6 +1,5 @@
TESTDLL = ntdll.dll
IMPORTS = user32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \
atom.c \

View File

@ -69,7 +69,7 @@ static void test_ntncdf(void)
OPEN_EXISTING, fflags, NULL);
ok( hdir != INVALID_HANDLE_VALUE, "failed to open directory\n");
hEvent = CreateEvent( NULL, 0, 0, NULL );
hEvent = CreateEventA( NULL, 0, 0, NULL );
r = pNtNotifyChangeDirectoryFile(hdir,NULL,NULL,NULL,&iosb,NULL,0,0,0);
ok(r==STATUS_INVALID_PARAMETER, "should return invalid parameter\n");
@ -197,7 +197,7 @@ static void test_ntncdf_async(void)
OPEN_EXISTING, fflags, NULL);
ok( hdir != INVALID_HANDLE_VALUE, "failed to open directory\n");
hEvent = CreateEvent( NULL, 0, 0, NULL );
hEvent = CreateEventA( NULL, 0, 0, NULL );
filter = FILE_NOTIFY_CHANGE_FILE_NAME;
filter |= FILE_NOTIFY_CHANGE_DIR_NAME;
@ -312,7 +312,7 @@ static void test_ntncdf_async(void)
START_TEST(change)
{
HMODULE hntdll = GetModuleHandle("ntdll");
HMODULE hntdll = GetModuleHandleA("ntdll");
if (!hntdll)
{
win_skip("not running on NT, skipping test\n");

View File

@ -120,11 +120,11 @@ static void tear_down_attribute_test(const char *testdirA)
continue;
sprintf(buf, "%s\\%s", testdirA, testfiles[i].name);
if (testfiles[i].attr & FILE_ATTRIBUTE_DIRECTORY) {
ret = RemoveDirectory(buf);
ret = RemoveDirectoryA(buf);
ok(ret || (GetLastError() == ERROR_PATH_NOT_FOUND),
"Failed to rmdir %s, error %d\n", buf, GetLastError());
} else {
ret = DeleteFile(buf);
ret = DeleteFileA(buf);
ok(ret || (GetLastError() == ERROR_PATH_NOT_FOUND),
"Failed to rm %s, error %d\n", buf, GetLastError());
}

View File

@ -731,7 +731,7 @@ static void test_debugger(void)
{
char cmdline[MAX_PATH];
PROCESS_INFORMATION pi;
STARTUPINFO si = { 0 };
STARTUPINFOA si = { 0 };
DEBUG_EVENT de;
DWORD continuestatus;
PVOID code_mem_address = NULL;
@ -748,7 +748,7 @@ static void test_debugger(void)
}
sprintf(cmdline, "%s %s %s %p", my_argv[0], my_argv[1], "debuggee", &test_stage);
ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi);
ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi);
ok(ret, "could not create child process error: %u\n", GetLastError());
if (!ret)
return;
@ -1473,7 +1473,7 @@ START_TEST(exception)
"NtQueryInformationProcess" );
pNtSetInformationProcess = (void*)GetProcAddress( hntdll,
"NtSetInformationProcess" );
pIsWow64Process = (void *)GetProcAddress(GetModuleHandle("kernel32.dll"), "IsWow64Process");
pIsWow64Process = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsWow64Process");
#ifdef __i386__
if (!pNtCurrentTeb)

View File

@ -89,7 +89,7 @@ static inline BOOL is_signaled( HANDLE obj )
static BOOL create_pipe( HANDLE *read, HANDLE *write, ULONG flags, ULONG size )
{
*read = CreateNamedPipe(PIPENAME, PIPE_ACCESS_INBOUND | flags, PIPE_TYPE_BYTE | PIPE_WAIT,
*read = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_INBOUND | flags, PIPE_TYPE_BYTE | PIPE_WAIT,
1, size, size, NMPWAIT_USE_DEFAULT_WAIT, NULL);
ok(*read != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n");
@ -861,7 +861,7 @@ static void append_file_test(void)
GetTempPathA( MAX_PATH, path );
GetTempFileNameA( path, "foo", 0, buffer );
handle = CreateFile(buffer, FILE_WRITE_DATA, 0, NULL, CREATE_ALWAYS, 0, 0);
handle = CreateFileA(buffer, FILE_WRITE_DATA, 0, NULL, CREATE_ALWAYS, 0, 0);
ok(handle != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError());
U(iosb).Status = -1;
@ -875,7 +875,7 @@ static void append_file_test(void)
/* It is possible to open a file with only FILE_APPEND_DATA access flags.
It matches the O_WRONLY|O_APPEND open() posix behavior */
handle = CreateFile(buffer, FILE_APPEND_DATA, 0, NULL, OPEN_EXISTING, 0, 0);
handle = CreateFileA(buffer, FILE_APPEND_DATA, 0, NULL, OPEN_EXISTING, 0, 0);
ok(handle != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError());
U(iosb).Status = -1;
@ -902,7 +902,7 @@ static void append_file_test(void)
CloseHandle(handle);
handle = CreateFile(buffer, FILE_READ_DATA | FILE_WRITE_DATA | FILE_APPEND_DATA, 0, NULL, OPEN_EXISTING, 0, 0);
handle = CreateFileA(buffer, FILE_READ_DATA | FILE_WRITE_DATA | FILE_APPEND_DATA, 0, NULL, OPEN_EXISTING, 0, 0);
ok(handle != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError());
memset(buf, 0, sizeof(buf));
@ -936,7 +936,7 @@ static void append_file_test(void)
ok(memcmp(buf, "barbar", 6) == 0, "wrong file contents: %s\n", buf);
CloseHandle(handle);
DeleteFile(buffer);
DeleteFileA(buffer);
}
static void nt_mailslot_test(void)

View File

@ -55,7 +55,7 @@ static DWORD one_before_last_pid = 0;
static BOOL InitFunctionPtrs(void)
{
/* All needed functions are NT based, so using GetModuleHandle is a good check */
HMODULE hntdll = GetModuleHandle("ntdll");
HMODULE hntdll = GetModuleHandleA("ntdll");
if (!hntdll)
{
win_skip("Not running on NT\n");
@ -78,7 +78,7 @@ static BOOL InitFunctionPtrs(void)
/* not present before XP */
pNtGetCurrentProcessorNumber = (void *) GetProcAddress(hntdll, "NtGetCurrentProcessorNumber");
pIsWow64Process = (void *)GetProcAddress(GetModuleHandle("kernel32.dll"), "IsWow64Process");
pIsWow64Process = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsWow64Process");
if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE;
return TRUE;
}
@ -946,14 +946,14 @@ static void test_query_process_debug_port(int argc, char **argv)
DWORD_PTR debug_port = 0xdeadbeef;
char cmdline[MAX_PATH];
PROCESS_INFORMATION pi;
STARTUPINFO si = { 0 };
STARTUPINFOA si = { 0 };
NTSTATUS status;
BOOL ret;
sprintf(cmdline, "%s %s %s", argv[0], argv[1], "debuggee");
si.cb = sizeof(si);
ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi);
ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi);
ok(ret, "CreateProcess failed, last error %#x.\n", GetLastError());
if (!ret) return;
@ -1099,7 +1099,7 @@ static void test_query_process_image_file_name(void)
static void test_query_process_debug_object_handle(int argc, char **argv)
{
char cmdline[MAX_PATH];
STARTUPINFO si = {0};
STARTUPINFOA si = {0};
PROCESS_INFORMATION pi;
BOOL ret;
HANDLE debug_object;
@ -1108,7 +1108,7 @@ static void test_query_process_debug_object_handle(int argc, char **argv)
sprintf(cmdline, "%s %s %s", argv[0], argv[1], "debuggee");
si.cb = sizeof(si);
ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL,
ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL,
NULL, &si, &pi);
ok(ret, "CreateProcess failed with last error %u\n", GetLastError());
if (!ret) return;
@ -1198,14 +1198,14 @@ static void test_query_process_debug_flags(int argc, char **argv)
DWORD debug_flags = 0xdeadbeef;
char cmdline[MAX_PATH];
PROCESS_INFORMATION pi;
STARTUPINFO si = { 0 };
STARTUPINFOA si = { 0 };
NTSTATUS status;
BOOL ret;
sprintf(cmdline, "%s %s %s", argv[0], argv[1], "debuggee");
si.cb = sizeof(si);
ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS, NULL, NULL, &si, &pi);
ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS, NULL, NULL, &si, &pi);
ok(ret, "CreateProcess failed, last error %#x.\n", GetLastError());
if (!ret) return;
@ -1390,7 +1390,7 @@ static void test_queryvirtualmemory(void)
char stackbuf[42];
HMODULE module;
module = GetModuleHandle( "ntdll.dll" );
module = GetModuleHandleA( "ntdll.dll" );
trace("Check flags of the PE header of NTDLL.DLL at %p\n", module);
status = pNtQueryVirtualMemory(NtCurrentProcess(), module, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount);
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
@ -1402,7 +1402,7 @@ static void test_queryvirtualmemory(void)
ok (mbi.Type == MEM_IMAGE, "mbi.Type is 0x%x, expected 0x%x\n", mbi.Type, MEM_IMAGE);
trace("Check flags of a function entry in NTDLL.DLL at %p\n", pNtQueryVirtualMemory);
module = GetModuleHandle( "ntdll.dll" );
module = GetModuleHandleA( "ntdll.dll" );
status = pNtQueryVirtualMemory(NtCurrentProcess(), pNtQueryVirtualMemory, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount);
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
ok( readcount == sizeof(MEMORY_BASIC_INFORMATION), "Expected to read %d bytes, got %ld\n",(int)sizeof(MEMORY_BASIC_INFORMATION),readcount);
@ -1430,7 +1430,7 @@ static void test_queryvirtualmemory(void)
ok (mbi.Protect == PAGE_READWRITE, "mbi.Protect is 0x%x, expected 0x%x\n", mbi.Protect, PAGE_READWRITE);
trace("Check flags of read-only data at %p\n", teststring);
module = GetModuleHandle( NULL );
module = GetModuleHandleA( NULL );
status = pNtQueryVirtualMemory(NtCurrentProcess(), teststring, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount);
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
ok( readcount == sizeof(MEMORY_BASIC_INFORMATION), "Expected to read %d bytes, got %ld\n",(int)sizeof(MEMORY_BASIC_INFORMATION),readcount);
@ -1475,7 +1475,7 @@ static void test_affinity(void)
GetSystemInfo(&si);
status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessBasicInformation, &pbi, sizeof(pbi), NULL );
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
proc_affinity = (DWORD_PTR)pbi.Reserved2[0];
proc_affinity = pbi.AffinityMask;
ok( proc_affinity == (1 << si.dwNumberOfProcessors) - 1, "Unexpected process affinity\n" );
proc_affinity = 1 << si.dwNumberOfProcessors;
status = pNtSetInformationProcess( GetCurrentProcess(), ProcessAffinityMask, &proc_affinity, sizeof(proc_affinity) );
@ -1534,7 +1534,7 @@ static void test_affinity(void)
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessBasicInformation, &pbi, sizeof(pbi), NULL );
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
proc_affinity = (DWORD_PTR)pbi.Reserved2[0];
proc_affinity = pbi.AffinityMask;
ok( proc_affinity == 2, "Unexpected process affinity\n" );
/* Setting the process affinity changes the thread affinity to match */
status = pNtQueryInformationThread( GetCurrentThread(), ThreadBasicInformation, &tbi, sizeof(tbi), NULL );
@ -1578,7 +1578,7 @@ static void test_NtGetCurrentProcessorNumber(void)
trace("dwNumberOfProcessors: %d, current processor: %d\n", si.dwNumberOfProcessors, current_cpu);
status = pNtQueryInformationProcess(GetCurrentProcess(), ProcessBasicInformation, &pbi, sizeof(pbi), NULL);
old_process_mask = (DWORD_PTR)pbi.Reserved2[0];
old_process_mask = pbi.AffinityMask;
ok(status == STATUS_SUCCESS, "got 0x%x (expected STATUS_SUCCESS)\n", status);
status = pNtQueryInformationThread(GetCurrentThread(), ThreadBasicInformation, &tbi, sizeof(tbi), NULL);

View File

@ -77,7 +77,7 @@ static DWORD (WINAPI *pQueueUserAPC)(PAPCFUNC pfnAPC, HANDLE hThread, ULONG_PTR
static BOOL init_func_ptrs(void)
{
HMODULE module = GetModuleHandle("ntdll.dll");
HMODULE module = GetModuleHandleA("ntdll.dll");
#define loadfunc(name) if (!(p##name = (void *)GetProcAddress(module, #name))) { \
trace("GetProcAddress(%s) failed\n", #name); \
@ -91,7 +91,7 @@ static BOOL init_func_ptrs(void)
loadfunc(RtlInitUnicodeString)
/* not fatal */
module = GetModuleHandle("kernel32.dll");
module = GetModuleHandleA("kernel32.dll");
pOpenThread = (void *)GetProcAddress(module, "OpenThread");
pQueueUserAPC = (void *)GetProcAddress(module, "QueueUserAPC");
return TRUE;

View File

@ -160,7 +160,7 @@ static BOOL init_function_ptrs(void)
return FALSE;
}
pIsWow64Process = (void *)GetProcAddress(GetModuleHandle("kernel32.dll"), "IsWow64Process");
pIsWow64Process = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsWow64Process");
if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE;
return TRUE;
}
@ -197,30 +197,30 @@ static void ProcessLpcRequest(HANDLE PortHandle, union lpc_message *LpcMessage)
{
ok(LpcMessage->msg64.MessageType == LPC_REQUEST,
"Expected LPC_REQUEST, got %d\n", LpcMessage->msg64.MessageType);
ok(!lstrcmp((LPSTR)LpcMessage->msg64.Data, REQUEST2),
ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REQUEST2),
"Expected %s, got %s\n", REQUEST2, LpcMessage->msg64.Data);
lstrcpy((LPSTR)LpcMessage->msg64.Data, REPLY);
strcpy((LPSTR)LpcMessage->msg64.Data, REPLY);
status = pNtReplyPort(PortHandle, &LpcMessage->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status);
ok(LpcMessage->msg64.MessageType == LPC_REQUEST,
"Expected LPC_REQUEST, got %d\n", LpcMessage->msg64.MessageType);
ok(!lstrcmp((LPSTR)LpcMessage->msg64.Data, REPLY),
ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REPLY),
"Expected %s, got %s\n", REPLY, LpcMessage->msg64.Data);
}
else
{
ok(LpcMessage->msg.MessageType == LPC_REQUEST,
"Expected LPC_REQUEST, got %d\n", LpcMessage->msg.MessageType);
ok(!lstrcmp((LPSTR)LpcMessage->msg.Data, REQUEST2),
ok(!strcmp((LPSTR)LpcMessage->msg.Data, REQUEST2),
"Expected %s, got %s\n", REQUEST2, LpcMessage->msg.Data);
lstrcpy((LPSTR)LpcMessage->msg.Data, REPLY);
strcpy((LPSTR)LpcMessage->msg.Data, REPLY);
status = pNtReplyPort(PortHandle, &LpcMessage->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status);
ok(LpcMessage->msg.MessageType == LPC_REQUEST,
"Expected LPC_REQUEST, got %d\n", LpcMessage->msg.MessageType);
ok(!lstrcmp((LPSTR)LpcMessage->msg.Data, REPLY),
ok(!strcmp((LPSTR)LpcMessage->msg.Data, REPLY),
"Expected %s, got %s\n", REPLY, LpcMessage->msg.Data);
}
}
@ -251,26 +251,26 @@ static DWORD WINAPI test_ports_client(LPVOID arg)
LpcMessage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
out = HeapAlloc(GetProcessHeap(), 0, size);
LpcMessage->msg64.DataSize = lstrlen(REQUEST1) + 1;
LpcMessage->msg64.DataSize = strlen(REQUEST1) + 1;
LpcMessage->msg64.MessageSize = FIELD_OFFSET(LPC_MESSAGE64, Data[LpcMessage->msg64.DataSize]);
lstrcpy((LPSTR)LpcMessage->msg64.Data, REQUEST1);
strcpy((LPSTR)LpcMessage->msg64.Data, REQUEST1);
status = pNtRequestPort(PortHandle, &LpcMessage->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status);
ok(LpcMessage->msg64.MessageType == 0, "Expected 0, got %d\n", LpcMessage->msg64.MessageType);
ok(!lstrcmp((LPSTR)LpcMessage->msg64.Data, REQUEST1),
ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REQUEST1),
"Expected %s, got %s\n", REQUEST1, LpcMessage->msg64.Data);
/* Fill in the message */
memset(LpcMessage, 0, size);
LpcMessage->msg64.DataSize = lstrlen(REQUEST2) + 1;
LpcMessage->msg64.DataSize = strlen(REQUEST2) + 1;
LpcMessage->msg64.MessageSize = FIELD_OFFSET(LPC_MESSAGE64, Data[LpcMessage->msg64.DataSize]);
lstrcpy((LPSTR)LpcMessage->msg64.Data, REQUEST2);
strcpy((LPSTR)LpcMessage->msg64.Data, REQUEST2);
/* Send the message and wait for the reply */
status = pNtRequestWaitReplyPort(PortHandle, &LpcMessage->msg, &out->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status);
ok(!lstrcmp((LPSTR)out->msg64.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg64.Data);
ok(!strcmp((LPSTR)out->msg64.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg64.Data);
ok(out->msg64.MessageType == LPC_REPLY, "Expected LPC_REPLY, got %d\n", out->msg64.MessageType);
}
else
@ -279,26 +279,26 @@ static DWORD WINAPI test_ports_client(LPVOID arg)
LpcMessage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
out = HeapAlloc(GetProcessHeap(), 0, size);
LpcMessage->msg.DataSize = lstrlen(REQUEST1) + 1;
LpcMessage->msg.DataSize = strlen(REQUEST1) + 1;
LpcMessage->msg.MessageSize = FIELD_OFFSET(LPC_MESSAGE, Data[LpcMessage->msg.DataSize]);
lstrcpy((LPSTR)LpcMessage->msg.Data, REQUEST1);
strcpy((LPSTR)LpcMessage->msg.Data, REQUEST1);
status = pNtRequestPort(PortHandle, &LpcMessage->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status);
ok(LpcMessage->msg.MessageType == 0, "Expected 0, got %d\n", LpcMessage->msg.MessageType);
ok(!lstrcmp((LPSTR)LpcMessage->msg.Data, REQUEST1),
ok(!strcmp((LPSTR)LpcMessage->msg.Data, REQUEST1),
"Expected %s, got %s\n", REQUEST1, LpcMessage->msg.Data);
/* Fill in the message */
memset(LpcMessage, 0, size);
LpcMessage->msg.DataSize = lstrlen(REQUEST2) + 1;
LpcMessage->msg.DataSize = strlen(REQUEST2) + 1;
LpcMessage->msg.MessageSize = FIELD_OFFSET(LPC_MESSAGE, Data[LpcMessage->msg.DataSize]);
lstrcpy((LPSTR)LpcMessage->msg.Data, REQUEST2);
strcpy((LPSTR)LpcMessage->msg.Data, REQUEST2);
/* Send the message and wait for the reply */
status = pNtRequestWaitReplyPort(PortHandle, &LpcMessage->msg, &out->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status);
ok(!lstrcmp((LPSTR)out->msg.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg.Data);
ok(!strcmp((LPSTR)out->msg.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg.Data);
ok(out->msg.MessageType == LPC_REPLY, "Expected LPC_REPLY, got %d\n", out->msg.MessageType);
}
@ -345,10 +345,10 @@ static void test_ports_server( HANDLE PortHandle )
case LPC_DATAGRAM:
if (is_wow64)
ok(!lstrcmp((LPSTR)LpcMessage->msg64.Data, REQUEST1),
ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REQUEST1),
"Expected %s, got %s\n", REQUEST1, LpcMessage->msg64.Data);
else
ok(!lstrcmp((LPSTR)LpcMessage->msg.Data, REQUEST1),
ok(!strcmp((LPSTR)LpcMessage->msg.Data, REQUEST1),
"Expected %s, got %s\n", REQUEST1, LpcMessage->msg.Data);
break;