mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[KMTestSuite]
Update to HEAD svn path=/branches/GSoC_2011/KMTestSuite/; revision=51628
This commit is contained in:
commit
9d307acbbd
35 changed files with 695 additions and 23 deletions
|
@ -5,6 +5,7 @@ add_subdirectory(dciman32)
|
||||||
add_subdirectory(gdi32)
|
add_subdirectory(gdi32)
|
||||||
add_subdirectory(ntdll)
|
add_subdirectory(ntdll)
|
||||||
add_subdirectory(user32)
|
add_subdirectory(user32)
|
||||||
|
add_subdirectory(kernel32)
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
if(ARCH MATCHES i386)
|
if(ARCH MATCHES i386)
|
||||||
|
|
|
@ -21,6 +21,10 @@
|
||||||
<directory name="user32">
|
<directory name="user32">
|
||||||
<xi:include href="user32/user32_apitest.rbuild" />
|
<xi:include href="user32/user32_apitest.rbuild" />
|
||||||
</directory>
|
</directory>
|
||||||
|
|
||||||
|
<directory name="kernel32">
|
||||||
|
<xi:include href="kernel32/kernel32_apitest.rbuild" />
|
||||||
|
</directory>
|
||||||
|
|
||||||
<if property="ARCH" value="i386">
|
<if property="ARCH" value="i386">
|
||||||
<directory name="w32kdll">
|
<directory name="w32kdll">
|
||||||
|
|
12
apitests/kernel32/CMakeLists.txt
Normal file
12
apitests/kernel32/CMakeLists.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
add_definitions(-D_DLL -D__USE_CRTIMP)
|
||||||
|
|
||||||
|
list(APPEND SOURCE
|
||||||
|
GetDriveType.c
|
||||||
|
testlist.c)
|
||||||
|
|
||||||
|
add_executable(kernel32_apitest ${SOURCE})
|
||||||
|
target_link_libraries(kernel32_apitest wine ${PSEH_LIB})
|
||||||
|
set_module_type(kernel32_apitest win32cui)
|
||||||
|
add_importlibs(kernel32_apitest gdi32 user32 msvcrt kernel32 ntdll)
|
||||||
|
add_cab_target(kernel32_apitest 7)
|
71
apitests/kernel32/GetDriveType.c
Normal file
71
apitests/kernel32/GetDriveType.c
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <wine/test.h>
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#define IS_DRIVE_TYPE_VALID(type) ((type) != DRIVE_UNKNOWN && (type) != DRIVE_NO_ROOT_DIR)
|
||||||
|
|
||||||
|
START_TEST(GetDriveType)
|
||||||
|
{
|
||||||
|
UINT Type, Type2, i;
|
||||||
|
WCHAR Path[MAX_PATH];
|
||||||
|
|
||||||
|
/* Note: Successful calls can set last error to at least ERROR_NOT_A_REPARSE_POINT, we don't test it here */
|
||||||
|
SetLastError(0xdeadbeaf);
|
||||||
|
|
||||||
|
Type = GetDriveTypeW(L"");
|
||||||
|
ok(Type == DRIVE_NO_ROOT_DIR, "Expected DRIVE_NO_ROOT_DIR, got %u\n", Type);
|
||||||
|
|
||||||
|
Type = GetDriveTypeW(L"\nC:\\");
|
||||||
|
ok(Type == DRIVE_NO_ROOT_DIR, "Expected DRIVE_NO_ROOT_DIR, got %u\n", Type);
|
||||||
|
|
||||||
|
Type = GetDriveTypeW(L"Z:\\");
|
||||||
|
ok(Type == DRIVE_NO_ROOT_DIR, "Expected DRIVE_NO_ROOT_DIR, got %u\n", Type);
|
||||||
|
|
||||||
|
ok(GetLastError() == 0xdeadbeaf, "Expected no errors, got %lu\n", GetLastError());
|
||||||
|
|
||||||
|
/* Drive root is accepted without ending slash */
|
||||||
|
Type = GetDriveTypeW(L"C:");
|
||||||
|
ok(IS_DRIVE_TYPE_VALID(Type), "Expected valid drive type, got %u\n", Type);
|
||||||
|
|
||||||
|
Type = GetDriveTypeW(L"C:\\");
|
||||||
|
ok(IS_DRIVE_TYPE_VALID(Type), "Expected valid drive type, got %u\n", Type);
|
||||||
|
|
||||||
|
Type = GetDriveTypeW(NULL);
|
||||||
|
ok(IS_DRIVE_TYPE_VALID(Type), "Expected valid drive type, got %u\n", Type);
|
||||||
|
|
||||||
|
i = GetCurrentDirectoryW(sizeof(Path)/sizeof(Path[0]), Path);
|
||||||
|
if (i)
|
||||||
|
{
|
||||||
|
/* Note: there is no backslash at the end of Path */
|
||||||
|
SetLastError(0xdeadbeaf);
|
||||||
|
Type2 = GetDriveTypeW(Path);
|
||||||
|
ok(Type2 == DRIVE_NO_ROOT_DIR, "Expected DRIVE_NO_ROOT_DIR, got %u\n", Type2);
|
||||||
|
ok(GetLastError() == 0xdeadbeaf, "Expected ERROR_NOT_A_REPARSE_POINT, got %lu\n", GetLastError());
|
||||||
|
|
||||||
|
wcscpy(Path+i, L"\\");
|
||||||
|
Type2 = GetDriveTypeW(Path);
|
||||||
|
ok(Type == Type2, "Types are not equal: %u != %u\n", Type, Type2);
|
||||||
|
}
|
||||||
|
|
||||||
|
i = GetSystemDirectoryW(Path, sizeof(Path)/sizeof(Path[0]));
|
||||||
|
if (i)
|
||||||
|
{
|
||||||
|
/* Note: there is no backslash at the end of Path */
|
||||||
|
SetLastError(0xdeadbeaf);
|
||||||
|
Type = GetDriveTypeW(Path);
|
||||||
|
ok(Type == DRIVE_NO_ROOT_DIR, "Expected DRIVE_NO_ROOT_DIR, got %u\n", Type);
|
||||||
|
ok(GetLastError() == 0xdeadbeaf, "Expected no errors, got %lu\n", GetLastError());
|
||||||
|
|
||||||
|
wcscpy(Path+i, L"\\");
|
||||||
|
Type = GetDriveTypeW(Path);
|
||||||
|
ok(IS_DRIVE_TYPE_VALID(Type), "Expected valid drive type, got %u\n", Type);
|
||||||
|
|
||||||
|
wcscpy(Path+i, L"/");
|
||||||
|
Type = GetDriveTypeW(Path);
|
||||||
|
ok(IS_DRIVE_TYPE_VALID(Type), "Expected valid drive type, got %u\n", Type);
|
||||||
|
|
||||||
|
wcscpy(Path+i, L"\\\\");
|
||||||
|
Type = GetDriveTypeW(Path);
|
||||||
|
ok(IS_DRIVE_TYPE_VALID(Type), "Expected valid drive type, got %u\n", Type);
|
||||||
|
}
|
||||||
|
}
|
13
apitests/kernel32/kernel32_apitest.rbuild
Normal file
13
apitests/kernel32/kernel32_apitest.rbuild
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
||||||
|
<group>
|
||||||
|
<module name="kernel32_apitest" type="win32cui" installbase="bin" installname="kernel32_apitest.exe">
|
||||||
|
<include base="kernel32_apitest">.</include>
|
||||||
|
<library>wine</library>
|
||||||
|
<library>ntdll</library>
|
||||||
|
<library>pseh</library>
|
||||||
|
<file>testlist.c</file>
|
||||||
|
|
||||||
|
<file>GetDriveType.c</file>
|
||||||
|
</module>
|
||||||
|
</group>
|
16
apitests/kernel32/testlist.c
Normal file
16
apitests/kernel32/testlist.c
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#define __ROS_LONG64__
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#define STANDALONE
|
||||||
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
extern void func_GetDriveType(void);
|
||||||
|
|
||||||
|
const struct test winetest_testlist[] =
|
||||||
|
{
|
||||||
|
{ "GetDriveType", func_GetDriveType },
|
||||||
|
|
||||||
|
{ 0, 0 }
|
||||||
|
};
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
|
|
||||||
add_definitions(-D_DLL -D__USE_CRTIMP)
|
add_definitions(-D_DLL -D__USE_CRTIMP)
|
||||||
|
|
||||||
|
set_rc_compiler()
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
|
DeferWindowPos.c
|
||||||
|
GetIconInfo.c
|
||||||
|
GetKeyState.c
|
||||||
|
GetPeekMessage.c
|
||||||
|
GetSystemMetrics.c
|
||||||
InitializeLpkHooks.c
|
InitializeLpkHooks.c
|
||||||
RealGetWindowClass.c
|
RealGetWindowClass.c
|
||||||
ScrollDC.c
|
ScrollDC.c
|
||||||
ScrollWindowEx.c
|
ScrollWindowEx.c
|
||||||
GetSystemMetrics.c
|
SetCursorPos.c
|
||||||
GetIconInfo.c
|
|
||||||
GetPeekMessage.c
|
|
||||||
DeferWindowPos.c
|
|
||||||
testlist.c
|
testlist.c
|
||||||
user32_apitest.rc)
|
user32_apitest.rc)
|
||||||
|
|
||||||
|
|
137
apitests/user32/GetKeyState.c
Normal file
137
apitests/user32/GetKeyState.c
Normal file
|
@ -0,0 +1,137 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS api tests
|
||||||
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
|
* PURPOSE: Test for GetKeyState
|
||||||
|
* PROGRAMMERS: Giannis Adamopoulos
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <wine/test.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
HHOOK hKbdHook, hKbdLLHook;
|
||||||
|
|
||||||
|
|
||||||
|
LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
BOOL pressed = !(lParam & (1<<31));
|
||||||
|
BOOL altPressed = lParam & (1<<29);
|
||||||
|
|
||||||
|
if(pressed)
|
||||||
|
{
|
||||||
|
ok(altPressed,"\n");
|
||||||
|
ok((GetKeyState(VK_MENU) & 0x8000), "Alt should not be pressed\n");\
|
||||||
|
ok((GetKeyState(VK_LMENU) & 0x8000), "Left alt should not be pressed\n");\
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ok(!altPressed,"\n");
|
||||||
|
ok(!(GetKeyState(VK_MENU) & 0x8000), "Alt should be pressed\n");
|
||||||
|
ok(!(GetKeyState(VK_LMENU) & 0x8000), "Left alt should be pressed\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return CallNextHookEx(hKbdHook, code, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
PKBDLLHOOKSTRUCT pLLHook = (PKBDLLHOOKSTRUCT)lParam;
|
||||||
|
|
||||||
|
if(wParam == WM_SYSKEYDOWN)
|
||||||
|
{
|
||||||
|
ok(pLLHook->flags & LLKHF_ALTDOWN,"Didn't get LLKHF_ALTDOWN flag\n");
|
||||||
|
ok((GetAsyncKeyState (VK_MENU) & 0x8000), "Alt should not be pressed in global kbd status\n");
|
||||||
|
ok(!(GetKeyState(VK_MENU) & 0x8000), "Alt should not be pressed in queue state\n");
|
||||||
|
ok(!(GetAsyncKeyState (VK_LMENU) & 0x8000), "Left alt should not be pressed in global kbd status\n");
|
||||||
|
ok(!(GetKeyState(VK_LMENU) & 0x8000), "Left alt should not be pressed in queue state\n");
|
||||||
|
}
|
||||||
|
else if(wParam == WM_SYSKEYUP)
|
||||||
|
{
|
||||||
|
ok(!(pLLHook->flags & LLKHF_ALTDOWN),"got LLKHF_ALTDOWN flag\n");
|
||||||
|
ok(!(GetAsyncKeyState (VK_MENU) & 0x8000), "Alt should not be pressed in global kbd status\n");
|
||||||
|
ok((GetKeyState(VK_MENU) & 0x8000), "Alt should be pressed in queue state\n");
|
||||||
|
ok(!(GetAsyncKeyState (VK_LMENU) & 0x8000), "Left alt should not be pressed in global kbd status\n");
|
||||||
|
ok((GetKeyState(VK_LMENU) & 0x8000), "Left alt should be pressed in queue state\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return CallNextHookEx(hKbdLLHook, nCode, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
static LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||||
|
{
|
||||||
|
if(msg == WM_SYSKEYDOWN)
|
||||||
|
{
|
||||||
|
ok(wParam == VK_MENU, "Got wrong wParam in WM_SYSKEYDOWN (%d instead of %d)\n", wParam, VK_MENU );
|
||||||
|
}
|
||||||
|
return DefWindowProcA( hWnd, msg, wParam, lParam );
|
||||||
|
}
|
||||||
|
|
||||||
|
static HWND CreateTestWindow()
|
||||||
|
{
|
||||||
|
MSG msg;
|
||||||
|
WNDCLASSA wclass;
|
||||||
|
HANDLE hInstance = GetModuleHandleA( NULL );
|
||||||
|
HWND hWndTest;
|
||||||
|
|
||||||
|
wclass.lpszClassName = "InputSysKeyTestClass";
|
||||||
|
wclass.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
|
wclass.lpfnWndProc = WndProc;
|
||||||
|
wclass.hInstance = hInstance;
|
||||||
|
wclass.hIcon = LoadIconA( 0, IDI_APPLICATION );
|
||||||
|
wclass.hCursor = LoadCursorA( NULL, IDC_ARROW );
|
||||||
|
wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
|
||||||
|
wclass.lpszMenuName = 0;
|
||||||
|
wclass.cbClsExtra = 0;
|
||||||
|
wclass.cbWndExtra = 0;
|
||||||
|
RegisterClassA( &wclass );
|
||||||
|
/* create the test window that will receive the keystrokes */
|
||||||
|
hWndTest = CreateWindowA( wclass.lpszClassName, "InputSysKeyTest",
|
||||||
|
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, 100, 100,
|
||||||
|
NULL, NULL, hInstance, NULL);
|
||||||
|
assert( hWndTest );
|
||||||
|
ShowWindow( hWndTest, SW_SHOW);
|
||||||
|
SetWindowPos( hWndTest, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE );
|
||||||
|
SetForegroundWindow( hWndTest );
|
||||||
|
UpdateWindow( hWndTest);
|
||||||
|
|
||||||
|
/* flush pending messages */
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
return hWndTest;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Test_GetKeyState()
|
||||||
|
{
|
||||||
|
HWND hwnd;
|
||||||
|
MSG msg;
|
||||||
|
|
||||||
|
hwnd = CreateTestWindow();
|
||||||
|
|
||||||
|
hKbdHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, GetModuleHandleA( NULL ), 0);
|
||||||
|
hKbdLLHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, GetModuleHandleA( NULL ), 0);
|
||||||
|
|
||||||
|
ok(hKbdHook!=NULL," \n");
|
||||||
|
ok(hKbdLLHook!=NULL," \n");
|
||||||
|
|
||||||
|
keybd_event(VK_LMENU, 0, 0,0);
|
||||||
|
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
keybd_event(VK_LMENU, 0, KEYEVENTF_KEYUP,0);
|
||||||
|
|
||||||
|
//fixme this hangs the test
|
||||||
|
//while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
DestroyWindow(hwnd);
|
||||||
|
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
UnhookWindowsHookEx (hKbdHook);
|
||||||
|
UnhookWindowsHookEx (hKbdLLHook);
|
||||||
|
}
|
||||||
|
|
||||||
|
START_TEST(GetKeyState)
|
||||||
|
{
|
||||||
|
Test_GetKeyState();
|
||||||
|
}
|
165
apitests/user32/SetCursorPos.c
Normal file
165
apitests/user32/SetCursorPos.c
Normal file
|
@ -0,0 +1,165 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS api tests
|
||||||
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
|
* PURPOSE: Test for SetCursorPos
|
||||||
|
* PROGRAMMERS: Giannis Adamopoulos
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <wine/test.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
HHOOK hMouseHookLL, hMouseHook;
|
||||||
|
|
||||||
|
struct _test_info
|
||||||
|
{
|
||||||
|
int ll_hook_called;
|
||||||
|
int hook_called;
|
||||||
|
int mouse_move_called;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _test_info info[] = { {0,0,0}, /* SetCursorPos without a window */
|
||||||
|
{1,2,0}, /* mouse_event without a window */
|
||||||
|
{0,1,1}, /* SetCursorPos with a window */
|
||||||
|
{1,1,1}, /* mouse_event with a window */
|
||||||
|
{0,1,1}, /* multiple SetCursorPos with a window with coalescing */
|
||||||
|
{0,2,2}, /* multiple SetCursorPos with a window without coalescing */
|
||||||
|
{2,1,1}, /* multiple mouse_event with a window with coalescing */
|
||||||
|
{2,2,2}, /* multiple mouse_event with a window without coalescing */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _test_info results[8];
|
||||||
|
int test_no = 0;
|
||||||
|
|
||||||
|
|
||||||
|
LRESULT CALLBACK MouseLLHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
results[test_no].ll_hook_called++;
|
||||||
|
return CallNextHookEx(hMouseHookLL, nCode, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
results[test_no].hook_called++;
|
||||||
|
return CallNextHookEx(hMouseHook, nCode, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
static LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||||
|
{
|
||||||
|
if(msg == WM_MOUSEMOVE)
|
||||||
|
results[test_no].mouse_move_called++;
|
||||||
|
|
||||||
|
return DefWindowProcA( hWnd, msg, wParam, lParam );
|
||||||
|
}
|
||||||
|
|
||||||
|
static HWND CreateTestWindow()
|
||||||
|
{
|
||||||
|
MSG msg;
|
||||||
|
WNDCLASSA wclass;
|
||||||
|
HANDLE hInstance = GetModuleHandleA( NULL );
|
||||||
|
HWND hWndTest;
|
||||||
|
|
||||||
|
wclass.lpszClassName = "MouseInputTestClass";
|
||||||
|
wclass.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
|
wclass.lpfnWndProc = WndProc;
|
||||||
|
wclass.hInstance = hInstance;
|
||||||
|
wclass.hIcon = LoadIconA( 0, IDI_APPLICATION );
|
||||||
|
wclass.hCursor = LoadCursorA( NULL, IDC_ARROW );
|
||||||
|
wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
|
||||||
|
wclass.lpszMenuName = 0;
|
||||||
|
wclass.cbClsExtra = 0;
|
||||||
|
wclass.cbWndExtra = 0;
|
||||||
|
RegisterClassA( &wclass );
|
||||||
|
/* create the test window that will receive the keystrokes */
|
||||||
|
hWndTest = CreateWindowA( wclass.lpszClassName, "MouseInputTestTest",
|
||||||
|
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, 100, 100,
|
||||||
|
NULL, NULL, hInstance, NULL);
|
||||||
|
assert( hWndTest );
|
||||||
|
ShowWindow( hWndTest, SW_SHOWMAXIMIZED);
|
||||||
|
SetWindowPos( hWndTest, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE );
|
||||||
|
SetForegroundWindow( hWndTest );
|
||||||
|
UpdateWindow( hWndTest);
|
||||||
|
SetFocus(hWndTest);
|
||||||
|
|
||||||
|
/* flush pending messages */
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
return hWndTest;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Test_SetCursorPos()
|
||||||
|
{
|
||||||
|
HWND hwnd;
|
||||||
|
MSG msg;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
memset(results, sizeof(results), 0);
|
||||||
|
|
||||||
|
hMouseHookLL = SetWindowsHookEx(WH_MOUSE_LL, MouseLLHookProc, GetModuleHandleA( NULL ), 0);
|
||||||
|
hMouseHook = SetWindowsHookEx(WH_MOUSE, MouseHookProc, GetModuleHandleA( NULL ), 0);
|
||||||
|
ok(hMouseHook!=NULL,"failed to set hook\n");
|
||||||
|
ok(hMouseHookLL!=NULL,"failed to set hook\n");
|
||||||
|
|
||||||
|
test_no = 0;
|
||||||
|
SetCursorPos(1,1);
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
test_no = 1;
|
||||||
|
mouse_event(MOUSEEVENTF_MOVE, 2,2, 0,0);
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
hwnd = CreateTestWindow();
|
||||||
|
SetCapture(hwnd);
|
||||||
|
|
||||||
|
test_no = 2;
|
||||||
|
SetCursorPos(50,50);
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
test_no = 3;
|
||||||
|
mouse_event(MOUSEEVENTF_MOVE, 100,100, 0,0);
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
test_no = 4;
|
||||||
|
SetCursorPos(50,50);
|
||||||
|
SetCursorPos(60,60);
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
test_no = 5;
|
||||||
|
SetCursorPos(50,50);
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
SetCursorPos(60,60);
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
test_no = 6;
|
||||||
|
mouse_event(MOUSEEVENTF_MOVE, 50,50, 0,0);
|
||||||
|
mouse_event(MOUSEEVENTF_MOVE, 60,60, 0,0);
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
test_no = 7;
|
||||||
|
mouse_event(MOUSEEVENTF_MOVE, 50,50, 0,0);
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
mouse_event(MOUSEEVENTF_MOVE, 60,60, 0,0);
|
||||||
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
|
||||||
|
|
||||||
|
for(i = 0; i< 8; i++)
|
||||||
|
{
|
||||||
|
#define TEST(s,x,y) ok(y == x, "%d: %s called %d times instead of %d\n",i,s, y,x);
|
||||||
|
TEST("WH_MOUSE_LL", info[i].ll_hook_called, results[i].ll_hook_called);
|
||||||
|
/* WH_MOUSE results vary greatly among windows versions */
|
||||||
|
//TEST("WH_MOUSE", info[i].hook_called, results[i].hook_called);
|
||||||
|
TEST("WM_MOUSEMOVE", info[i].mouse_move_called, results[i].mouse_move_called);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetCapture(NULL);
|
||||||
|
DestroyWindow(hwnd);
|
||||||
|
|
||||||
|
UnhookWindowsHookEx (hMouseHook);
|
||||||
|
UnhookWindowsHookEx (hMouseHookLL);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
START_TEST(SetCursorPos)
|
||||||
|
{
|
||||||
|
Test_SetCursorPos();
|
||||||
|
}
|
|
@ -13,6 +13,8 @@ extern void func_GetSystemMetrics(void);
|
||||||
extern void func_GetIconInfo(void);
|
extern void func_GetIconInfo(void);
|
||||||
extern void func_GetPeekMessage(void);
|
extern void func_GetPeekMessage(void);
|
||||||
extern void func_DeferWindowPos(void);
|
extern void func_DeferWindowPos(void);
|
||||||
|
extern void func_GetKeyState(void);
|
||||||
|
extern void func_SetCursorPos(void);
|
||||||
|
|
||||||
const struct test winetest_testlist[] =
|
const struct test winetest_testlist[] =
|
||||||
{
|
{
|
||||||
|
@ -24,7 +26,8 @@ const struct test winetest_testlist[] =
|
||||||
{ "GetIconInfo", func_GetIconInfo },
|
{ "GetIconInfo", func_GetIconInfo },
|
||||||
{ "GetPeekMessage", func_GetPeekMessage },
|
{ "GetPeekMessage", func_GetPeekMessage },
|
||||||
{ "DeferWindowPos", func_DeferWindowPos },
|
{ "DeferWindowPos", func_DeferWindowPos },
|
||||||
|
{ "GetKeyState", func_GetKeyState },
|
||||||
|
{ "SetCursorPos", func_SetCursorPos },
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<file>testlist.c</file>
|
<file>testlist.c</file>
|
||||||
<file>user32_apitest.rc</file>
|
<file>user32_apitest.rc</file>
|
||||||
|
|
||||||
|
<file>GetKeyState.c</file>
|
||||||
<file>InitializeLpkHooks.c</file>
|
<file>InitializeLpkHooks.c</file>
|
||||||
<file>RealGetWindowClass.c</file>
|
<file>RealGetWindowClass.c</file>
|
||||||
<file>ScrollDC.c</file>
|
<file>ScrollDC.c</file>
|
||||||
|
@ -18,6 +19,7 @@
|
||||||
<file>GetIconInfo.c</file>
|
<file>GetIconInfo.c</file>
|
||||||
<file>GetPeekMessage.c</file>
|
<file>GetPeekMessage.c</file>
|
||||||
<file>DeferWindowPos.c</file>
|
<file>DeferWindowPos.c</file>
|
||||||
|
<file>SetCursorPos.c</file>
|
||||||
|
|
||||||
</module>
|
</module>
|
||||||
</group>
|
</group>
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
add_library(w32kdll_2k3sp2 SHARED main.c w32kdll_2k3sp2.S)
|
add_library(w32kdll_2k3sp2 SHARED main.c w32kdll_2k3sp2.S)
|
||||||
set_entrypoint(w32kdll_2k3sp2 0)
|
set_entrypoint(w32kdll_2k3sp2 0)
|
||||||
target_link_libraries(w32kdll_2k3sp2 ${CMAKE_CURRENT_SOURCE_DIR}/w32kdll_2k3sp2.def)
|
target_link_libraries(w32kdll_2k3sp2 ${CMAKE_CURRENT_SOURCE_DIR}/w32kdll_2k3sp2.def)
|
||||||
add_dependencies(w32kdll_2k3sp2 psdk buildno_header)
|
add_dependencies(w32kdll_2k3sp2 psdk )
|
||||||
add_importlib_target(w32kdll_2k3sp2.def)
|
add_importlib_target(w32kdll_2k3sp2.def)
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
add_library(w32kdll_2ksp4 SHARED main.c w32kdll_2ksp4.S)
|
add_library(w32kdll_2ksp4 SHARED main.c w32kdll_2ksp4.S)
|
||||||
set_entrypoint(w32kdll_2ksp4 0)
|
set_entrypoint(w32kdll_2ksp4 0)
|
||||||
target_link_libraries(w32kdll_2ksp4 ${CMAKE_CURRENT_SOURCE_DIR}/w32kdll_2ksp4.def)
|
target_link_libraries(w32kdll_2ksp4 ${CMAKE_CURRENT_SOURCE_DIR}/w32kdll_2ksp4.def)
|
||||||
add_dependencies(w32kdll_2ksp4 psdk buildno_header)
|
add_dependencies(w32kdll_2ksp4 psdk )
|
||||||
add_importlib_target(w32kdll_2ksp4.def)
|
add_importlib_target(w32kdll_2ksp4.def)
|
||||||
|
|
|
@ -7,5 +7,5 @@ target_link_libraries(w32kdll
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/w32kdll_ros.def
|
${CMAKE_CURRENT_SOURCE_DIR}/w32kdll_ros.def
|
||||||
win32ksys)
|
win32ksys)
|
||||||
|
|
||||||
add_dependencies(w32kdll psdk buildno_header)
|
add_dependencies(w32kdll psdk )
|
||||||
add_importlib_target(w32kdll_ros.def)
|
add_importlib_target(w32kdll_ros.def)
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
add_library(w32kdll_vista SHARED main.c w32kdll_vista.S)
|
add_library(w32kdll_vista SHARED main.c w32kdll_vista.S)
|
||||||
set_entrypoint(w32kdll_vista 0)
|
set_entrypoint(w32kdll_vista 0)
|
||||||
target_link_libraries(w32kdll_vista ${CMAKE_CURRENT_SOURCE_DIR}/w32kdll_vista.def)
|
target_link_libraries(w32kdll_vista ${CMAKE_CURRENT_SOURCE_DIR}/w32kdll_vista.def)
|
||||||
add_dependencies(w32kdll_vista psdk buildno_header)
|
add_dependencies(w32kdll_vista psdk )
|
||||||
add_importlib_target(w32kdll_vista.def)
|
add_importlib_target(w32kdll_vista.def)
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
add_library(w32kdll_xpsp2 SHARED main.c w32kdll_xpsp2.S)
|
add_library(w32kdll_xpsp2 SHARED main.c w32kdll_xpsp2.S)
|
||||||
set_entrypoint(w32kdll_xpsp2 0)
|
set_entrypoint(w32kdll_xpsp2 0)
|
||||||
target_link_libraries(w32kdll_xpsp2 ${CMAKE_CURRENT_SOURCE_DIR}/w32kdll_xpsp2.def)
|
target_link_libraries(w32kdll_xpsp2 ${CMAKE_CURRENT_SOURCE_DIR}/w32kdll_xpsp2.def)
|
||||||
add_dependencies(w32kdll_xpsp2 psdk buildno_header)
|
add_dependencies(w32kdll_xpsp2 psdk )
|
||||||
add_importlib_target(w32kdll_xpsp2.def)
|
add_importlib_target(w32kdll_xpsp2.def)
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
add_definitions(-D_DLL -D__USE_CRTIMP)
|
add_definitions(-D_DLL -D__USE_CRTIMP)
|
||||||
|
|
||||||
|
set_rc_compiler()
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
osver.c
|
osver.c
|
||||||
testlist.c
|
testlist.c
|
||||||
|
|
|
@ -4,3 +4,4 @@
|
||||||
<library>user32</library>
|
<library>user32</library>
|
||||||
<file>bltrop.c</file>
|
<file>bltrop.c</file>
|
||||||
<file>bltrop.rc</file>
|
<file>bltrop.rc</file>
|
||||||
|
</module>
|
||||||
|
|
|
@ -4,3 +4,4 @@
|
||||||
<library>gdi32</library>
|
<library>gdi32</library>
|
||||||
<file>vbltest.c</file>
|
<file>vbltest.c</file>
|
||||||
<file>vbltest.rc</file>
|
<file>vbltest.rc</file>
|
||||||
|
</module>
|
|
@ -334,6 +334,8 @@ VOID FsRtlIsDbcsInExpressionTest()
|
||||||
VOID
|
VOID
|
||||||
NtoskrnlFsRtlTest(HANDLE KeyHandle)
|
NtoskrnlFsRtlTest(HANDLE KeyHandle)
|
||||||
{
|
{
|
||||||
|
StartTest();
|
||||||
|
|
||||||
FsRtlIsNameInExpressionTest();
|
FsRtlIsNameInExpressionTest();
|
||||||
FsRtlIsDbcsInExpressionTest();
|
FsRtlIsDbcsInExpressionTest();
|
||||||
|
|
||||||
|
|
|
@ -11,3 +11,4 @@
|
||||||
<file>NtGdiDdWaitForVerticalBlank.c</file>
|
<file>NtGdiDdWaitForVerticalBlank.c</file>
|
||||||
<file>NtGdiDdCanCreateSurface.c</file>
|
<file>NtGdiDdCanCreateSurface.c</file>
|
||||||
<file>dump.c</file>
|
<file>dump.c</file>
|
||||||
|
</module>
|
|
@ -4,3 +4,4 @@
|
||||||
<library>user32</library>
|
<library>user32</library>
|
||||||
<file>movefile.cpp</file>
|
<file>movefile.cpp</file>
|
||||||
<file>movefile.rc</file>
|
<file>movefile.rc</file>
|
||||||
|
</module>
|
|
@ -16,3 +16,4 @@
|
||||||
<file>capicon.c</file>
|
<file>capicon.c</file>
|
||||||
<file>capicon.rc</file>
|
<file>capicon.rc</file>
|
||||||
</module>
|
</module>
|
||||||
|
</group>
|
||||||
|
|
|
@ -9,6 +9,8 @@ add_definitions(-D_WIN32_WINNT=0x600)
|
||||||
remove_definitions(-D_WIN32_IE=0x600)
|
remove_definitions(-D_WIN32_IE=0x600)
|
||||||
add_definitions(-D_WIN32_IE=0x500)
|
add_definitions(-D_WIN32_IE=0x500)
|
||||||
|
|
||||||
|
set_rc_compiler()
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
comboex.c
|
comboex.c
|
||||||
datetime.c
|
datetime.c
|
||||||
|
|
|
@ -8,3 +8,4 @@
|
||||||
<library>crypt32</library>
|
<library>crypt32</library>
|
||||||
<library>user32</library>
|
<library>user32</library>
|
||||||
<library>ntdll</library>
|
<library>ntdll</library>
|
||||||
|
</module>
|
||||||
|
|
|
@ -3,6 +3,8 @@ add_definitions(
|
||||||
-D__ROS_LONG64__
|
-D__ROS_LONG64__
|
||||||
-D_DLL -D__USE_CRTIMP)
|
-D_DLL -D__USE_CRTIMP)
|
||||||
|
|
||||||
|
set_rc_compiler()
|
||||||
|
|
||||||
add_executable(itss_winetest protocol.c testlist.c rsrc.rc)
|
add_executable(itss_winetest protocol.c testlist.c rsrc.rc)
|
||||||
target_link_libraries(itss_winetest wine)
|
target_link_libraries(itss_winetest wine)
|
||||||
set_module_type(itss_winetest win32cui)
|
set_module_type(itss_winetest win32cui)
|
||||||
|
|
|
@ -3,6 +3,8 @@ add_definitions(
|
||||||
-D__ROS_LONG64__
|
-D__ROS_LONG64__
|
||||||
-D_DLL -D__USE_CRTIMP)
|
-D_DLL -D__USE_CRTIMP)
|
||||||
|
|
||||||
|
set_rc_compiler()
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
activex.c
|
activex.c
|
||||||
jscript.c
|
jscript.c
|
||||||
|
|
|
@ -3,6 +3,8 @@ add_definitions(
|
||||||
-D__ROS_LONG64__
|
-D__ROS_LONG64__
|
||||||
-D_DLL -D__USE_CRTIMP)
|
-D_DLL -D__USE_CRTIMP)
|
||||||
|
|
||||||
|
set_rc_compiler()
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
actctx.c
|
actctx.c
|
||||||
alloc.c
|
alloc.c
|
||||||
|
@ -38,6 +40,7 @@ list(APPEND SOURCE
|
||||||
version.c
|
version.c
|
||||||
virtual.c
|
virtual.c
|
||||||
volume.c
|
volume.c
|
||||||
|
dosdev.c
|
||||||
testlist.c
|
testlist.c
|
||||||
resource.rc)
|
resource.rc)
|
||||||
|
|
||||||
|
|
228
winetests/kernel32/dosdev.c
Normal file
228
winetests/kernel32/dosdev.c
Normal file
|
@ -0,0 +1,228 @@
|
||||||
|
/*
|
||||||
|
* Unit test suite for virtual substituted drive functions.
|
||||||
|
*
|
||||||
|
* Copyright 2011 Sam Arun Raj
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#include "wine/test.h"
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winerror.h"
|
||||||
|
|
||||||
|
static void test_DefineDosDeviceA1(void)
|
||||||
|
{
|
||||||
|
/* Test using lowercase drive letters */
|
||||||
|
CHAR Target[MAX_PATH];
|
||||||
|
CHAR Drive[] = "m:";
|
||||||
|
BOOL Result;
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp");
|
||||||
|
ok(Result, "Failed to subst drive using lowercase drive letter\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp");
|
||||||
|
ok(Result, "Failed to remove subst drive using lowercase drive letter\n");
|
||||||
|
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(!Result, "Subst drive is present even after remove attempt\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_DefineDosDeviceA2(void)
|
||||||
|
{
|
||||||
|
/* Test using trailing \ against drive letter */
|
||||||
|
CHAR Target[MAX_PATH];
|
||||||
|
CHAR Drive[] = "Q:\\";
|
||||||
|
BOOL Result;
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp");
|
||||||
|
ok(!Result, "Subst drive using trailing path seperator\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp");
|
||||||
|
ok(!Result, "Subst drive using trailing path seperator\n");
|
||||||
|
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(!Result, "Subst drive is present when it should not be created in the first place\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_DefineDosDeviceA3(void)
|
||||||
|
{
|
||||||
|
/* Test using arbitary string, not necessarily a DOS drive letter */
|
||||||
|
CHAR Target[MAX_PATH];
|
||||||
|
CHAR Drive[] = "!QHello:";
|
||||||
|
BOOL Result;
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp");
|
||||||
|
ok(Result, "Failed to subst drive using non-DOS drive name\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp");
|
||||||
|
ok(Result, "Failed to subst drive using non-DOS drive name\n");
|
||||||
|
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(!Result, "Subst drive is present even after remove attempt\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_DefineDosDeviceA4(void)
|
||||||
|
{
|
||||||
|
/* Test remove without using DDD_EXACT_MATCH_ON_REMOVE */
|
||||||
|
CHAR Target[MAX_PATH];
|
||||||
|
CHAR Drive[] = "M:";
|
||||||
|
BOOL Result;
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION, Drive, NULL);
|
||||||
|
ok(Result, "Failed to remove subst drive using NULL Target name\n");
|
||||||
|
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(!Result, "Subst drive is present even after remove attempt\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_DefineDosDeviceA5(void)
|
||||||
|
{
|
||||||
|
/* Test multiple adds and multiple removes in add order */
|
||||||
|
CHAR Target[MAX_PATH];
|
||||||
|
CHAR Drive[] = "M:";
|
||||||
|
BOOL Result;
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp1");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp2");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp3");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp1");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(Result, "Failed to query subst drive\n");
|
||||||
|
if (Result)
|
||||||
|
ok((_stricmp(Target, "\\??\\C:\\temp3") == 0), "Subst drive is not pointing to correct target\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp2");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(Result, "Failed to query subst drive\n");
|
||||||
|
if (Result)
|
||||||
|
ok((_stricmp(Target, "\\??\\C:\\temp3") == 0), "Subst drive is not pointing to correct target\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp3");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(!Result, "Subst drive is present even after remove attempt\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_DefineDosDeviceA6(void)
|
||||||
|
{
|
||||||
|
/* Test multiple adds and multiple removes in reverse order */
|
||||||
|
CHAR Target[MAX_PATH];
|
||||||
|
CHAR Drive[] = "M:";
|
||||||
|
BOOL Result;
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp1");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp2");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp3");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp3");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(Result, "Failed to query subst drive\n");
|
||||||
|
if (Result)
|
||||||
|
ok((_stricmp(Target, "\\??\\C:\\temp2") == 0), "Subst drive is not pointing to correct target\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp2");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(Result, "Failed to query subst drive\n");
|
||||||
|
if (Result)
|
||||||
|
ok((_stricmp(Target, "\\??\\C:\\temp1") == 0), "Subst drive is not pointing to correct target\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp1");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(!Result, "Subst drive is present even after remove attempt\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_DefineDosDeviceA7(void)
|
||||||
|
{
|
||||||
|
/* Test multiple adds and multiple removes out of order */
|
||||||
|
CHAR Target[MAX_PATH];
|
||||||
|
CHAR Drive[] = "M:";
|
||||||
|
BOOL Result;
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp1");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp2");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp3");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp4");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
Result = DefineDosDeviceA(0, Drive, "C:\\temp5");
|
||||||
|
ok(Result, "Failed to subst drive\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp2");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(Result, "Failed to query subst drive\n");
|
||||||
|
if (Result)
|
||||||
|
ok((_stricmp(Target, "\\??\\C:\\temp5") == 0), "Subst drive is not pointing to correct target\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp5");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(Result, "Failed to query subst drive\n");
|
||||||
|
if (Result)
|
||||||
|
ok((_stricmp(Target, "\\??\\C:\\temp4") == 0), "Subst drive is not pointing to correct target\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp1");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(Result, "Failed to query subst drive\n");
|
||||||
|
if (Result)
|
||||||
|
ok((_stricmp(Target, "\\??\\C:\\temp4") == 0), "Subst drive is not pointing to correct target\n");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp3");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(Result, "Failed to query subst drive\n");
|
||||||
|
if (Result)
|
||||||
|
ok((_stricmp(Target, "\\??\\C:\\temp4") == 0), "Subst drive is not pointing to correct target");
|
||||||
|
|
||||||
|
Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, Drive, "C:\\temp4");
|
||||||
|
ok(Result, "Failed to remove subst drive\n");
|
||||||
|
|
||||||
|
Result = QueryDosDeviceA(Drive, Target, MAX_PATH);
|
||||||
|
ok(!Result, "Subst drive is present even after remove attempt\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
START_TEST(dosdev)
|
||||||
|
{
|
||||||
|
test_DefineDosDeviceA1();
|
||||||
|
test_DefineDosDeviceA2();
|
||||||
|
test_DefineDosDeviceA3();
|
||||||
|
test_DefineDosDeviceA4();
|
||||||
|
test_DefineDosDeviceA5();
|
||||||
|
test_DefineDosDeviceA6();
|
||||||
|
test_DefineDosDeviceA7();
|
||||||
|
}
|
|
@ -40,6 +40,7 @@
|
||||||
<file>version.c</file>
|
<file>version.c</file>
|
||||||
<file>virtual.c</file>
|
<file>virtual.c</file>
|
||||||
<file>volume.c</file>
|
<file>volume.c</file>
|
||||||
|
<file>dosdev.c</file>
|
||||||
<file>testlist.c</file>
|
<file>testlist.c</file>
|
||||||
<file>resource.rc</file>
|
<file>resource.rc</file>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -42,6 +42,7 @@ extern void func_toolhelp(void);
|
||||||
extern void func_virtual(void);
|
extern void func_virtual(void);
|
||||||
extern void func_version(void);
|
extern void func_version(void);
|
||||||
extern void func_volume(void);
|
extern void func_volume(void);
|
||||||
|
extern void func_dosdev(void);
|
||||||
|
|
||||||
const struct test winetest_testlist[] =
|
const struct test winetest_testlist[] =
|
||||||
{
|
{
|
||||||
|
@ -78,6 +79,7 @@ const struct test winetest_testlist[] =
|
||||||
{ "virtual", func_virtual },
|
{ "virtual", func_virtual },
|
||||||
{ "version", func_version },
|
{ "version", func_version },
|
||||||
{ "volume", func_volume },
|
{ "volume", func_volume },
|
||||||
|
{ "dosdev", func_dosdev },
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
|
set_rc_compiler()
|
||||||
|
|
||||||
add_definitions(
|
add_definitions(
|
||||||
-D__ROS_LONG64__
|
-D__ROS_LONG64__
|
||||||
-D_DLL -D__USE_CRTIMP)
|
-D_DLL -D__USE_CRTIMP)
|
||||||
|
|
|
@ -3,6 +3,8 @@ add_definitions(
|
||||||
-D__ROS_LONG64__
|
-D__ROS_LONG64__
|
||||||
-D_DLL -D__USE_CRTIMP)
|
-D_DLL -D__USE_CRTIMP)
|
||||||
|
|
||||||
|
set_rc_compiler()
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
broadcast.c
|
broadcast.c
|
||||||
class.c
|
class.c
|
||||||
|
|
|
@ -12572,10 +12572,7 @@ START_TEST(msg)
|
||||||
test_paint_messages();
|
test_paint_messages();
|
||||||
test_interthread_messages();
|
test_interthread_messages();
|
||||||
test_message_conversion();
|
test_message_conversion();
|
||||||
if(!winetest_interactive)
|
test_accelerators();
|
||||||
skip("skipping test_accelerators, that hangs on reactos\n");
|
|
||||||
else
|
|
||||||
test_accelerators();
|
|
||||||
test_timers();
|
test_timers();
|
||||||
test_timers_no_wnd();
|
test_timers_no_wnd();
|
||||||
if (hCBT_hook) test_set_hook();
|
if (hCBT_hook) test_set_hook();
|
||||||
|
@ -12596,10 +12593,7 @@ START_TEST(msg)
|
||||||
test_dialog_messages();
|
test_dialog_messages();
|
||||||
test_nullCallback();
|
test_nullCallback();
|
||||||
test_dbcs_wm_char();
|
test_dbcs_wm_char();
|
||||||
if(!winetest_interactive)
|
test_menu_messages();
|
||||||
skip("skipping test_menu_messages, that hangs on reactos\n");
|
|
||||||
else
|
|
||||||
test_menu_messages();
|
|
||||||
test_paintingloop();
|
test_paintingloop();
|
||||||
test_defwinproc();
|
test_defwinproc();
|
||||||
test_clipboard_viewers();
|
test_clipboard_viewers();
|
||||||
|
|
|
@ -6058,11 +6058,7 @@ START_TEST(win)
|
||||||
test_capture_1();
|
test_capture_1();
|
||||||
test_capture_2();
|
test_capture_2();
|
||||||
test_capture_3(hwndMain, hwndMain2);
|
test_capture_3(hwndMain, hwndMain2);
|
||||||
|
test_capture_4();
|
||||||
if(!winetest_interactive)
|
|
||||||
skip("skipping test_capture_4, that hangs on reactos\n");
|
|
||||||
else
|
|
||||||
test_capture_4();
|
|
||||||
|
|
||||||
test_CreateWindow();
|
test_CreateWindow();
|
||||||
test_parent_owner();
|
test_parent_owner();
|
||||||
|
|
Loading…
Reference in a new issue