Author: akhaldi
Date: Sat Apr 19 23:44:04 2014
New Revision: 62825
URL:
http://svn.reactos.org/svn/reactos?rev=62825&view=rev
Log:
[DINPUT_WINETEST]
* Sync with Wine 1.7.17.
CORE-8080
Modified:
trunk/rostests/winetests/dinput/device.c
trunk/rostests/winetests/dinput/joystick.c
trunk/rostests/winetests/dinput/keyboard.c
trunk/rostests/winetests/dinput/mouse.c
Modified: trunk/rostests/winetests/dinput/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dinput/device.c…
==============================================================================
--- trunk/rostests/winetests/dinput/device.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/dinput/device.c [iso-8859-1] Sat Apr 19 23:44:04 2014
@@ -59,7 +59,7 @@
(LPDIOBJECTDATAFORMAT)obj_data_format
};
-static BOOL CALLBACK enum_callback(LPCDIDEVICEOBJECTINSTANCE oi, LPVOID info)
+static BOOL CALLBACK enum_callback(const DIDEVICEOBJECTINSTANCEA *oi, void *info)
{
if (winetest_debug > 1)
trace(" Type:%4x Ofs:%3d Flags:%08x Name:%s\n",
@@ -68,18 +68,18 @@
return DIENUM_CONTINUE;
}
-static BOOL CALLBACK enum_type_callback(LPCDIDEVICEOBJECTINSTANCE oi, LPVOID info)
+static BOOL CALLBACK enum_type_callback(const DIDEVICEOBJECTINSTANCEA *oi, void *info)
{
DWORD expected = *(DWORD*)info;
ok (expected & DIDFT_GETTYPE(oi->dwType), "EnumObjects() enumerated wrong
type for obj %s, expected: %08x got: %08x\n", oi->tszName, expected,
oi->dwType);
return DIENUM_CONTINUE;
}
-static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd)
+static void test_object_info(IDirectInputDeviceA *device, HWND hwnd)
{
HRESULT hr;
DIPROPDWORD dp;
- DIDEVICEOBJECTINSTANCE obj_info;
+ DIDEVICEOBJECTINSTANCEA obj_info;
DWORD obj_types[] = {DIDFT_BUTTON, DIDFT_AXIS, DIDFT_POV};
int type_index;
int cnt1 = 0;
@@ -174,14 +174,14 @@
struct enum_data
{
- LPDIRECTINPUT pDI;
+ IDirectInputA *pDI;
HWND hwnd;
};
-static BOOL CALLBACK enum_devices(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
+static BOOL CALLBACK enum_devices(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
{
struct enum_data *data = pvRef;
- LPDIRECTINPUTDEVICE device, obj = NULL;
+ IDirectInputDeviceA *device, *obj = NULL;
HRESULT hr;
hr = IDirectInput_GetDeviceStatus(data->pDI, &lpddi->guidInstance);
@@ -212,8 +212,8 @@
static void device_tests(void)
{
HRESULT hr;
- LPDIRECTINPUT pDI = NULL, obj = NULL;
- HINSTANCE hInstance = GetModuleHandle(NULL);
+ IDirectInputA *pDI = NULL, *obj = NULL;
+ HINSTANCE hInstance = GetModuleHandleW(NULL);
HWND hwnd;
struct enum_data data;
@@ -223,7 +223,7 @@
skip("Tests require a newer dinput version\n");
return;
}
- ok(SUCCEEDED(hr), "DirectInputCreate() failed: %08x\n", hr);
+ ok(SUCCEEDED(hr), "DirectInputCreateA() failed: %08x\n", hr);
if (FAILED(hr)) return;
hr = IDirectInput_Initialize(pDI, hInstance, DIRECTINPUT_VERSION);
@@ -233,8 +233,8 @@
hr = IUnknown_QueryInterface(pDI, &IID_IDirectInput2W, (LPVOID*)&obj);
ok(SUCCEEDED(hr), "QueryInterface(IDirectInput7W) failed: %08x\n", hr);
- hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW,
- 10, 10, 200, 200, NULL, NULL, NULL, NULL);
+ hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW, 10,
10, 200, 200, NULL, NULL,
+ NULL, NULL);
ok(hwnd != NULL, "err: %d\n", GetLastError());
if (hwnd)
{
@@ -250,7 +250,7 @@
hr = IDirectInput_GetDeviceStatus(pDI, &GUID_Joystick);
if (hr == DI_OK)
{
- LPDIRECTINPUTDEVICE device = NULL;
+ IDirectInputDeviceA *device = NULL;
hr = IDirectInput_CreateDevice(pDI, &GUID_Joystick, &device, NULL);
ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n",
hr);
Modified: trunk/rostests/winetests/dinput/joystick.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dinput/joystick…
==============================================================================
--- trunk/rostests/winetests/dinput/joystick.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/dinput/joystick.c [iso-8859-1] Sat Apr 19 23:44:04 2014
@@ -38,7 +38,7 @@
#define numObjects(x) (sizeof(x) / sizeof(x[0]))
typedef struct tagUserData {
- LPDIRECTINPUT pDI;
+ IDirectInputA *pDI;
DWORD version;
} UserData;
@@ -81,7 +81,7 @@
typedef struct tagJoystickInfo
{
- LPDIRECTINPUTDEVICE pJoystick;
+ IDirectInputDeviceA *pJoystick;
DWORD axis;
DWORD pov;
DWORD button;
@@ -95,9 +95,7 @@
return IUnknown_Release( object );
}
-static BOOL CALLBACK EnumAxes(
- const DIDEVICEOBJECTINSTANCE* pdidoi,
- VOID* pContext)
+static BOOL CALLBACK EnumAxes(const DIDEVICEOBJECTINSTANCEA *pdidoi, void *pContext)
{
HRESULT hr;
JoystickInfo * info = pContext;
@@ -170,21 +168,19 @@
E_INVALIDARG, S_OK, S_OK, E_INVALIDARG,
E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG};
-static BOOL CALLBACK EnumJoysticks(
- LPCDIDEVICEINSTANCE lpddi,
- LPVOID pvRef)
+static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
{
HRESULT hr;
UserData * data = pvRef;
- LPDIRECTINPUTDEVICE pJoystick;
+ IDirectInputDeviceA *pJoystick;
DIDATAFORMAT format;
DIDEVCAPS caps;
DIJOYSTATE2 js;
JoystickInfo info;
int i, count;
ULONG ref;
- DIDEVICEINSTANCE inst;
- DIDEVICEINSTANCE_DX3 inst3;
+ DIDEVICEINSTANCEA inst;
+ DIDEVICEINSTANCE_DX3A inst3;
DIPROPDWORD dipw;
DIPROPSTRING dps;
DIPROPGUIDANDPATH dpg;
@@ -340,7 +336,7 @@
ok(hr==DI_OK,"IDirectInputDevice_GetDeviceInfo() failed: %08x\n", hr);
inst3.dwSize = sizeof(inst3);
- hr = IDirectInputDevice_GetDeviceInfo(pJoystick, (LPDIDEVICEINSTANCE)&inst3);
+ hr = IDirectInputDevice_GetDeviceInfo(pJoystick, (DIDEVICEINSTANCEA*)&inst3);
ok(hr==DI_OK,"IDirectInputDevice_GetDeviceInfo() failed: %08x\n", hr);
hr = IDirectInputDevice_Unacquire(pJoystick);
@@ -370,7 +366,7 @@
LPDIRECTINPUTEFFECT effect = NULL;
LONG cnt1, cnt2;
HWND real_hWnd;
- HINSTANCE hInstance = GetModuleHandle(NULL);
+ HINSTANCE hInstance = GetModuleHandleW(NULL);
DIPROPDWORD dip_gain_set, dip_gain_get;
trace("Testing force-feedback\n");
@@ -393,9 +389,9 @@
* IDirectInputDevice_SetCooperativeLevel
* - a visible window
*/
- real_hWnd = CreateWindowEx(0, "EDIT", "Test text", 0, 10, 10,
300,
- 300, NULL, NULL, hInstance, NULL);
- ok(real_hWnd!=0,"CreateWindowEx failed: %p\n", real_hWnd);
+ real_hWnd = CreateWindowExA(0, "EDIT", "Test text", 0, 10,
10, 300, 300, NULL, NULL,
+ hInstance, NULL);
+ ok(real_hWnd!=0,"CreateWindowExA failed: %p\n", real_hWnd);
ShowWindow(real_hWnd, SW_SHOW);
hr = IDirectInputDevice_Unacquire(pJoystick);
ok(hr==DI_OK,"IDirectInputDevice_Unacquire() failed: %08x\n", hr);
@@ -407,7 +403,7 @@
cnt1 = get_refcount((IUnknown*)pJoystick);
- hr = IDirectInputDevice2_CreateEffect((LPDIRECTINPUTDEVICE2)pJoystick,
&GUID_ConstantForce,
+ hr = IDirectInputDevice2_CreateEffect((IDirectInputDevice2A*)pJoystick,
&GUID_ConstantForce,
&eff, &effect, NULL);
ok(hr == DI_OK, "IDirectInputDevice_CreateEffect() failed: %08x\n",
hr);
cnt2 = get_refcount((IUnknown*)pJoystick);
@@ -559,7 +555,7 @@
ok(hr==DI_OK, "IDirectInputDevice_SetProperty() failed: %08x\n",
hr);
hr = IDirectInputDevice_GetProperty(pJoystick, DIPROP_FFGAIN,
&dip_gain_get.diph);
ok(hr==DI_OK, "IDirectInputDevice_GetProperty() failed: %08x\n",
hr);
- ok(dip_gain_get.dwData==dip_gain_set.dwData, "Gain not udated:
%i\n", dip_gain_get.dwData);
+ ok(dip_gain_get.dwData==dip_gain_set.dwData, "Gain not updated:
%i\n", dip_gain_get.dwData);
hr = IDirectInputDevice_Acquire(pJoystick);
ok(hr==DI_OK,"IDirectInputDevice_Acquire() failed: %08x\n", hr);
dip_gain_set.dwData = 2;
@@ -567,7 +563,7 @@
ok(hr==DI_OK, "IDirectInputDevice_SetProperty() failed: %08x\n",
hr);
hr = IDirectInputDevice_GetProperty(pJoystick, DIPROP_FFGAIN,
&dip_gain_get.diph);
ok(hr==DI_OK, "IDirectInputDevice_GetProperty() failed: %08x\n",
hr);
- ok(dip_gain_get.dwData==dip_gain_set.dwData, "Gain not udated:
%i\n", dip_gain_get.dwData);
+ ok(dip_gain_get.dwData==dip_gain_set.dwData, "Gain not updated:
%i\n", dip_gain_get.dwData);
/* Test range and internal clamping. */
dip_gain_set.dwData = -1;
hr = IDirectInputDevice_SetProperty(pJoystick, DIPROP_FFGAIN,
&dip_gain_set.diph);
@@ -656,14 +652,13 @@
static void joystick_tests(DWORD version)
{
HRESULT hr;
- LPDIRECTINPUT pDI;
+ IDirectInputA *pDI;
ULONG ref;
- HINSTANCE hInstance = GetModuleHandle(NULL);
+ HINSTANCE hInstance = GetModuleHandleW(NULL);
trace("-- Testing Direct Input Version 0x%04x --\n", version);
- hr = DirectInputCreate(hInstance, version, &pDI, NULL);
- ok(hr==DI_OK||hr==DIERR_OLDDIRECTINPUTVERSION,
- "DirectInputCreate() failed: %08x\n", hr);
+ hr = DirectInputCreateA(hInstance, version, &pDI, NULL);
+ ok(hr==DI_OK||hr==DIERR_OLDDIRECTINPUTVERSION, "DirectInputCreateA() failed:
%08x\n", hr);
if (hr==DI_OK && pDI!=0) {
UserData data;
data.pDI = pDI;
Modified: trunk/rostests/winetests/dinput/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dinput/keyboard…
==============================================================================
--- trunk/rostests/winetests/dinput/keyboard.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/dinput/keyboard.c [iso-8859-1] Sat Apr 19 23:44:04 2014
@@ -34,10 +34,10 @@
//#include "wingdi.h"
#include <dinput.h>
-static void acquire_tests(LPDIRECTINPUT pDI, HWND hwnd)
-{
- HRESULT hr;
- LPDIRECTINPUTDEVICE pKeyboard;
+static void acquire_tests(IDirectInputA *pDI, HWND hwnd)
+{
+ HRESULT hr;
+ IDirectInputDeviceA *pKeyboard;
BYTE kbd_state[256];
LONG custom_state[6];
int i;
@@ -116,10 +116,10 @@
E_INVALIDARG, E_HANDLE, E_HANDLE, E_INVALIDARG,
E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG};
-static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd)
-{
- HRESULT hr;
- LPDIRECTINPUTDEVICE pKeyboard = NULL;
+static void test_set_coop(IDirectInputA *pDI, HWND hwnd)
+{
+ HRESULT hr;
+ IDirectInputDeviceA *pKeyboard = NULL;
int i;
HWND child;
@@ -138,8 +138,8 @@
ok(hr == SetCoop_real_window[i], "SetCooperativeLevel(hwnd, %d):
%08x\n", i, hr);
}
- child = CreateWindow("static", "Title", WS_CHILD | WS_VISIBLE,
- 10, 10, 50, 50, hwnd, NULL, NULL, NULL);
+ child = CreateWindowA("static", "Title", WS_CHILD | WS_VISIBLE,
10, 10, 50, 50, hwnd, NULL,
+ NULL, NULL);
ok(child != NULL, "err: %d\n", GetLastError());
for (i=0; i<16; i++)
@@ -152,10 +152,10 @@
if (pKeyboard) IUnknown_Release(pKeyboard);
}
-static void test_get_prop(LPDIRECTINPUT pDI, HWND hwnd)
-{
- HRESULT hr;
- LPDIRECTINPUTDEVICE pKeyboard = NULL;
+static void test_get_prop(IDirectInputA *pDI, HWND hwnd)
+{
+ HRESULT hr;
+ IDirectInputDeviceA *pKeyboard = NULL;
DIPROPRANGE diprg;
hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL);
@@ -174,10 +174,10 @@
if (pKeyboard) IUnknown_Release(pKeyboard);
}
-static void test_capabilities(LPDIRECTINPUT pDI, HWND hwnd)
-{
- HRESULT hr;
- LPDIRECTINPUTDEVICE pKeyboard = NULL;
+static void test_capabilities(IDirectInputA *pDI, HWND hwnd)
+{
+ HRESULT hr;
+ IDirectInputDeviceA *pKeyboard = NULL;
DIDEVCAPS caps;
hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL);
@@ -200,22 +200,22 @@
static void keyboard_tests(DWORD version)
{
HRESULT hr;
- LPDIRECTINPUT pDI = NULL;
- HINSTANCE hInstance = GetModuleHandle(NULL);
+ IDirectInputA *pDI = NULL;
+ HINSTANCE hInstance = GetModuleHandleW(NULL);
HWND hwnd;
ULONG ref = 0;
- hr = DirectInputCreate(hInstance, version, &pDI, NULL);
+ hr = DirectInputCreateA(hInstance, version, &pDI, NULL);
if (hr == DIERR_OLDDIRECTINPUTVERSION)
{
skip("Tests require a newer dinput version\n");
return;
}
- ok(SUCCEEDED(hr), "DirectInputCreate() failed: %08x\n", hr);
- if (FAILED(hr)) return;
-
- hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW |
WS_VISIBLE,
- 10, 10, 200, 200, NULL, NULL, NULL, NULL);
+ ok(SUCCEEDED(hr), "DirectInputCreateA() failed: %08x\n", hr);
+ if (FAILED(hr)) return;
+
+ hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW |
WS_VISIBLE, 10, 10, 200, 200,
+ NULL, NULL, NULL, NULL);
ok(hwnd != NULL, "err: %d\n", GetLastError());
if (hwnd)
Modified: trunk/rostests/winetests/dinput/mouse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dinput/mouse.c?…
==============================================================================
--- trunk/rostests/winetests/dinput/mouse.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/dinput/mouse.c [iso-8859-1] Sat Apr 19 23:44:04 2014
@@ -52,10 +52,10 @@
E_INVALIDARG, E_HANDLE, E_HANDLE, E_INVALIDARG,
E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG};
-static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd)
+static void test_set_coop(IDirectInputA *pDI, HWND hwnd)
{
HRESULT hr;
- LPDIRECTINPUTDEVICE pMouse = NULL;
+ IDirectInputDeviceA *pMouse = NULL;
int i;
HWND child;
@@ -74,8 +74,8 @@
ok(hr == SetCoop_real_window[i], "SetCooperativeLevel(hwnd, %d):
%08x\n", i, hr);
}
- child = CreateWindow("static", "Title", WS_CHILD | WS_VISIBLE,
- 10, 10, 50, 50, hwnd, NULL, NULL, NULL);
+ child = CreateWindowA("static", "Title", WS_CHILD | WS_VISIBLE,
10, 10, 50, 50, hwnd, NULL,
+ NULL, NULL);
ok(child != NULL, "err: %d\n", GetLastError());
for (i=0; i<16; i++)
@@ -88,10 +88,10 @@
if (pMouse) IUnknown_Release(pMouse);
}
-static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
+static void test_acquire(IDirectInputA *pDI, HWND hwnd)
{
HRESULT hr;
- LPDIRECTINPUTDEVICE pMouse = NULL;
+ IDirectInputDeviceA *pMouse = NULL;
DIMOUSESTATE m_state;
HWND hwnd2;
DIPROPDWORD di_op;
@@ -132,8 +132,8 @@
/* Foreground coop level requires window to have focus */
/* Create a temporary window, this should make dinput
* loose mouse input */
- hwnd2 = CreateWindow("static", "Temporary", WS_VISIBLE,
- 10, 210, 200, 200, NULL, NULL, NULL, NULL);
+ hwnd2 = CreateWindowA("static", "Temporary", WS_VISIBLE, 10, 210,
200, 200, NULL, NULL, NULL,
+ NULL);
hr = IDirectInputDevice_GetDeviceState(pMouse, sizeof(m_state), &m_state);
ok(hr == DIERR_NOTACQUIRED, "GetDeviceState() should have failed: %08x\n",
hr);
@@ -185,22 +185,22 @@
static void mouse_tests(void)
{
HRESULT hr;
- LPDIRECTINPUT pDI = NULL;
- HINSTANCE hInstance = GetModuleHandle(NULL);
+ IDirectInputA *pDI = NULL;
+ HINSTANCE hInstance = GetModuleHandleW(NULL);
HWND hwnd;
ULONG ref = 0;
- hr = DirectInputCreate(hInstance, DIRECTINPUT_VERSION, &pDI, NULL);
+ hr = DirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &pDI, NULL);
if (hr == DIERR_OLDDIRECTINPUTVERSION)
{
skip("Tests require a newer dinput version\n");
return;
}
- ok(SUCCEEDED(hr), "DirectInputCreate() failed: %08x\n", hr);
+ ok(SUCCEEDED(hr), "DirectInputCreateA() failed: %08x\n", hr);
if (FAILED(hr)) return;
- hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW,
- 10, 10, 200, 200, NULL, NULL, NULL, NULL);
+ hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW, 10,
10, 200, 200, NULL, NULL,
+ NULL, NULL);
ok(hwnd != NULL, "err: %d\n", GetLastError());
if (hwnd)
{