Commit 9a263e58 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dinput/tests: Compile with -D__WINESRC__.

parent cb0ef088
TESTDLL = dinput.dll TESTDLL = dinput.dll
IMPORTS = dinput ole32 version user32 IMPORTS = dinput ole32 version user32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \ C_SRCS = \
device.c \ device.c \
......
...@@ -55,7 +55,7 @@ static const DIDATAFORMAT data_format = { ...@@ -55,7 +55,7 @@ static const DIDATAFORMAT data_format = {
(LPDIOBJECTDATAFORMAT)obj_data_format (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) if (winetest_debug > 1)
trace(" Type:%4x Ofs:%3d Flags:%08x Name:%s\n", trace(" Type:%4x Ofs:%3d Flags:%08x Name:%s\n",
...@@ -64,18 +64,18 @@ static BOOL CALLBACK enum_callback(LPCDIDEVICEOBJECTINSTANCE oi, LPVOID info) ...@@ -64,18 +64,18 @@ static BOOL CALLBACK enum_callback(LPCDIDEVICEOBJECTINSTANCE oi, LPVOID info)
return DIENUM_CONTINUE; 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; 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); 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; return DIENUM_CONTINUE;
} }
static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd) static void test_object_info(IDirectInputDeviceA *device, HWND hwnd)
{ {
HRESULT hr; HRESULT hr;
DIPROPDWORD dp; DIPROPDWORD dp;
DIDEVICEOBJECTINSTANCE obj_info; DIDEVICEOBJECTINSTANCEA obj_info;
DWORD obj_types[] = {DIDFT_BUTTON, DIDFT_AXIS, DIDFT_POV}; DWORD obj_types[] = {DIDFT_BUTTON, DIDFT_AXIS, DIDFT_POV};
int type_index; int type_index;
int cnt1 = 0; int cnt1 = 0;
...@@ -170,14 +170,14 @@ static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd) ...@@ -170,14 +170,14 @@ static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd)
struct enum_data struct enum_data
{ {
LPDIRECTINPUT pDI; IDirectInputA *pDI;
HWND hwnd; 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; struct enum_data *data = pvRef;
LPDIRECTINPUTDEVICE device, obj = NULL; IDirectInputDeviceA *device, *obj = NULL;
HRESULT hr; HRESULT hr;
hr = IDirectInput_GetDeviceStatus(data->pDI, &lpddi->guidInstance); hr = IDirectInput_GetDeviceStatus(data->pDI, &lpddi->guidInstance);
...@@ -208,8 +208,8 @@ static BOOL CALLBACK enum_devices(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) ...@@ -208,8 +208,8 @@ static BOOL CALLBACK enum_devices(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
static void device_tests(void) static void device_tests(void)
{ {
HRESULT hr; HRESULT hr;
LPDIRECTINPUT pDI = NULL, obj = NULL; IDirectInputA *pDI = NULL, *obj = NULL;
HINSTANCE hInstance = GetModuleHandle(NULL); HINSTANCE hInstance = GetModuleHandleW(NULL);
HWND hwnd; HWND hwnd;
struct enum_data data; struct enum_data data;
...@@ -219,7 +219,7 @@ static void device_tests(void) ...@@ -219,7 +219,7 @@ static void device_tests(void)
skip("Tests require a newer dinput version\n"); skip("Tests require a newer dinput version\n");
return; return;
} }
ok(SUCCEEDED(hr), "DirectInputCreate() failed: %08x\n", hr); ok(SUCCEEDED(hr), "DirectInputCreateA() failed: %08x\n", hr);
if (FAILED(hr)) return; if (FAILED(hr)) return;
hr = IDirectInput_Initialize(pDI, hInstance, DIRECTINPUT_VERSION); hr = IDirectInput_Initialize(pDI, hInstance, DIRECTINPUT_VERSION);
...@@ -229,8 +229,8 @@ static void device_tests(void) ...@@ -229,8 +229,8 @@ static void device_tests(void)
hr = IUnknown_QueryInterface(pDI, &IID_IDirectInput2W, (LPVOID*)&obj); hr = IUnknown_QueryInterface(pDI, &IID_IDirectInput2W, (LPVOID*)&obj);
ok(SUCCEEDED(hr), "QueryInterface(IDirectInput7W) failed: %08x\n", hr); ok(SUCCEEDED(hr), "QueryInterface(IDirectInput7W) failed: %08x\n", hr);
hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW, hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW, 10, 10, 200, 200, NULL, NULL,
10, 10, 200, 200, NULL, NULL, NULL, NULL); NULL, NULL);
ok(hwnd != NULL, "err: %d\n", GetLastError()); ok(hwnd != NULL, "err: %d\n", GetLastError());
if (hwnd) if (hwnd)
{ {
...@@ -246,7 +246,7 @@ static void device_tests(void) ...@@ -246,7 +246,7 @@ static void device_tests(void)
hr = IDirectInput_GetDeviceStatus(pDI, &GUID_Joystick); hr = IDirectInput_GetDeviceStatus(pDI, &GUID_Joystick);
if (hr == DI_OK) if (hr == DI_OK)
{ {
LPDIRECTINPUTDEVICE device = NULL; IDirectInputDeviceA *device = NULL;
hr = IDirectInput_CreateDevice(pDI, &GUID_Joystick, &device, NULL); hr = IDirectInput_CreateDevice(pDI, &GUID_Joystick, &device, NULL);
ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n", hr); ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n", hr);
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define numObjects(x) (sizeof(x) / sizeof(x[0])) #define numObjects(x) (sizeof(x) / sizeof(x[0]))
typedef struct tagUserData { typedef struct tagUserData {
LPDIRECTINPUT pDI; IDirectInputA *pDI;
DWORD version; DWORD version;
} UserData; } UserData;
...@@ -76,7 +76,7 @@ static HWND get_hwnd(void) ...@@ -76,7 +76,7 @@ static HWND get_hwnd(void)
typedef struct tagJoystickInfo typedef struct tagJoystickInfo
{ {
LPDIRECTINPUTDEVICE pJoystick; IDirectInputDeviceA *pJoystick;
DWORD axis; DWORD axis;
DWORD pov; DWORD pov;
DWORD button; DWORD button;
...@@ -90,9 +90,7 @@ static int get_refcount(IUnknown *object) ...@@ -90,9 +90,7 @@ static int get_refcount(IUnknown *object)
return IUnknown_Release( object ); return IUnknown_Release( object );
} }
static BOOL CALLBACK EnumAxes( static BOOL CALLBACK EnumAxes(const DIDEVICEOBJECTINSTANCEA *pdidoi, void *pContext)
const DIDEVICEOBJECTINSTANCE* pdidoi,
VOID* pContext)
{ {
HRESULT hr; HRESULT hr;
JoystickInfo * info = pContext; JoystickInfo * info = pContext;
...@@ -165,21 +163,19 @@ static const HRESULT SetCoop_real_window[16] = { ...@@ -165,21 +163,19 @@ static const HRESULT SetCoop_real_window[16] = {
E_INVALIDARG, S_OK, S_OK, E_INVALIDARG, E_INVALIDARG, S_OK, S_OK, E_INVALIDARG,
E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG}; E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG};
static BOOL CALLBACK EnumJoysticks( static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
LPCDIDEVICEINSTANCE lpddi,
LPVOID pvRef)
{ {
HRESULT hr; HRESULT hr;
UserData * data = pvRef; UserData * data = pvRef;
LPDIRECTINPUTDEVICE pJoystick; IDirectInputDeviceA *pJoystick;
DIDATAFORMAT format; DIDATAFORMAT format;
DIDEVCAPS caps; DIDEVCAPS caps;
DIJOYSTATE2 js; DIJOYSTATE2 js;
JoystickInfo info; JoystickInfo info;
int i, count; int i, count;
ULONG ref; ULONG ref;
DIDEVICEINSTANCE inst; DIDEVICEINSTANCEA inst;
DIDEVICEINSTANCE_DX3 inst3; DIDEVICEINSTANCE_DX3A inst3;
DIPROPDWORD dipw; DIPROPDWORD dipw;
DIPROPSTRING dps; DIPROPSTRING dps;
DIPROPGUIDANDPATH dpg; DIPROPGUIDANDPATH dpg;
...@@ -335,7 +331,7 @@ static BOOL CALLBACK EnumJoysticks( ...@@ -335,7 +331,7 @@ static BOOL CALLBACK EnumJoysticks(
ok(hr==DI_OK,"IDirectInputDevice_GetDeviceInfo() failed: %08x\n", hr); ok(hr==DI_OK,"IDirectInputDevice_GetDeviceInfo() failed: %08x\n", hr);
inst3.dwSize = sizeof(inst3); 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); ok(hr==DI_OK,"IDirectInputDevice_GetDeviceInfo() failed: %08x\n", hr);
hr = IDirectInputDevice_Unacquire(pJoystick); hr = IDirectInputDevice_Unacquire(pJoystick);
...@@ -365,7 +361,7 @@ static BOOL CALLBACK EnumJoysticks( ...@@ -365,7 +361,7 @@ static BOOL CALLBACK EnumJoysticks(
LPDIRECTINPUTEFFECT effect = NULL; LPDIRECTINPUTEFFECT effect = NULL;
LONG cnt1, cnt2; LONG cnt1, cnt2;
HWND real_hWnd; HWND real_hWnd;
HINSTANCE hInstance = GetModuleHandle(NULL); HINSTANCE hInstance = GetModuleHandleW(NULL);
DIPROPDWORD dip_gain_set, dip_gain_get; DIPROPDWORD dip_gain_set, dip_gain_get;
trace("Testing force-feedback\n"); trace("Testing force-feedback\n");
...@@ -388,9 +384,9 @@ static BOOL CALLBACK EnumJoysticks( ...@@ -388,9 +384,9 @@ static BOOL CALLBACK EnumJoysticks(
* IDirectInputDevice_SetCooperativeLevel * IDirectInputDevice_SetCooperativeLevel
* - a visible window * - a visible window
*/ */
real_hWnd = CreateWindowEx(0, "EDIT", "Test text", 0, 10, 10, 300, real_hWnd = CreateWindowExA(0, "EDIT", "Test text", 0, 10, 10, 300, 300, NULL, NULL,
300, NULL, NULL, hInstance, NULL); hInstance, NULL);
ok(real_hWnd!=0,"CreateWindowEx failed: %p\n", real_hWnd); ok(real_hWnd!=0,"CreateWindowExA failed: %p\n", real_hWnd);
ShowWindow(real_hWnd, SW_SHOW); ShowWindow(real_hWnd, SW_SHOW);
hr = IDirectInputDevice_Unacquire(pJoystick); hr = IDirectInputDevice_Unacquire(pJoystick);
ok(hr==DI_OK,"IDirectInputDevice_Unacquire() failed: %08x\n", hr); ok(hr==DI_OK,"IDirectInputDevice_Unacquire() failed: %08x\n", hr);
...@@ -402,7 +398,7 @@ static BOOL CALLBACK EnumJoysticks( ...@@ -402,7 +398,7 @@ static BOOL CALLBACK EnumJoysticks(
cnt1 = get_refcount((IUnknown*)pJoystick); cnt1 = get_refcount((IUnknown*)pJoystick);
hr = IDirectInputDevice2_CreateEffect((LPDIRECTINPUTDEVICE2)pJoystick, &GUID_ConstantForce, hr = IDirectInputDevice2_CreateEffect((IDirectInputDevice2A*)pJoystick, &GUID_ConstantForce,
&eff, &effect, NULL); &eff, &effect, NULL);
ok(hr == DI_OK, "IDirectInputDevice_CreateEffect() failed: %08x\n", hr); ok(hr == DI_OK, "IDirectInputDevice_CreateEffect() failed: %08x\n", hr);
cnt2 = get_refcount((IUnknown*)pJoystick); cnt2 = get_refcount((IUnknown*)pJoystick);
...@@ -651,14 +647,13 @@ DONE: ...@@ -651,14 +647,13 @@ DONE:
static void joystick_tests(DWORD version) static void joystick_tests(DWORD version)
{ {
HRESULT hr; HRESULT hr;
LPDIRECTINPUT pDI; IDirectInputA *pDI;
ULONG ref; ULONG ref;
HINSTANCE hInstance = GetModuleHandle(NULL); HINSTANCE hInstance = GetModuleHandleW(NULL);
trace("-- Testing Direct Input Version 0x%04x --\n", version); trace("-- Testing Direct Input Version 0x%04x --\n", version);
hr = DirectInputCreate(hInstance, version, &pDI, NULL); hr = DirectInputCreateA(hInstance, version, &pDI, NULL);
ok(hr==DI_OK||hr==DIERR_OLDDIRECTINPUTVERSION, ok(hr==DI_OK||hr==DIERR_OLDDIRECTINPUTVERSION, "DirectInputCreateA() failed: %08x\n", hr);
"DirectInputCreate() failed: %08x\n", hr);
if (hr==DI_OK && pDI!=0) { if (hr==DI_OK && pDI!=0) {
UserData data; UserData data;
data.pDI = pDI; data.pDI = pDI;
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
#include "wingdi.h" #include "wingdi.h"
#include "dinput.h" #include "dinput.h"
static void acquire_tests(LPDIRECTINPUT pDI, HWND hwnd) static void acquire_tests(IDirectInputA *pDI, HWND hwnd)
{ {
HRESULT hr; HRESULT hr;
LPDIRECTINPUTDEVICE pKeyboard; IDirectInputDeviceA *pKeyboard;
BYTE kbd_state[256]; BYTE kbd_state[256];
LONG custom_state[6]; LONG custom_state[6];
int i; int i;
...@@ -112,10 +112,10 @@ static const HRESULT SetCoop_child_window[16] = { ...@@ -112,10 +112,10 @@ static const HRESULT SetCoop_child_window[16] = {
E_INVALIDARG, E_HANDLE, E_HANDLE, E_INVALIDARG, E_INVALIDARG, E_HANDLE, E_HANDLE, E_INVALIDARG,
E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, 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; HRESULT hr;
LPDIRECTINPUTDEVICE pKeyboard = NULL; IDirectInputDeviceA *pKeyboard = NULL;
int i; int i;
HWND child; HWND child;
...@@ -134,8 +134,8 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd) ...@@ -134,8 +134,8 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd)
ok(hr == SetCoop_real_window[i], "SetCooperativeLevel(hwnd, %d): %08x\n", i, hr); ok(hr == SetCoop_real_window[i], "SetCooperativeLevel(hwnd, %d): %08x\n", i, hr);
} }
child = CreateWindow("static", "Title", WS_CHILD | WS_VISIBLE, child = CreateWindowA("static", "Title", WS_CHILD | WS_VISIBLE, 10, 10, 50, 50, hwnd, NULL,
10, 10, 50, 50, hwnd, NULL, NULL, NULL); NULL, NULL);
ok(child != NULL, "err: %d\n", GetLastError()); ok(child != NULL, "err: %d\n", GetLastError());
for (i=0; i<16; i++) for (i=0; i<16; i++)
...@@ -148,10 +148,10 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd) ...@@ -148,10 +148,10 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd)
if (pKeyboard) IUnknown_Release(pKeyboard); if (pKeyboard) IUnknown_Release(pKeyboard);
} }
static void test_get_prop(LPDIRECTINPUT pDI, HWND hwnd) static void test_get_prop(IDirectInputA *pDI, HWND hwnd)
{ {
HRESULT hr; HRESULT hr;
LPDIRECTINPUTDEVICE pKeyboard = NULL; IDirectInputDeviceA *pKeyboard = NULL;
DIPROPRANGE diprg; DIPROPRANGE diprg;
hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL); hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL);
...@@ -170,10 +170,10 @@ static void test_get_prop(LPDIRECTINPUT pDI, HWND hwnd) ...@@ -170,10 +170,10 @@ static void test_get_prop(LPDIRECTINPUT pDI, HWND hwnd)
if (pKeyboard) IUnknown_Release(pKeyboard); if (pKeyboard) IUnknown_Release(pKeyboard);
} }
static void test_capabilities(LPDIRECTINPUT pDI, HWND hwnd) static void test_capabilities(IDirectInputA *pDI, HWND hwnd)
{ {
HRESULT hr; HRESULT hr;
LPDIRECTINPUTDEVICE pKeyboard = NULL; IDirectInputDeviceA *pKeyboard = NULL;
DIDEVCAPS caps; DIDEVCAPS caps;
hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL); hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL);
...@@ -196,22 +196,22 @@ static void test_capabilities(LPDIRECTINPUT pDI, HWND hwnd) ...@@ -196,22 +196,22 @@ static void test_capabilities(LPDIRECTINPUT pDI, HWND hwnd)
static void keyboard_tests(DWORD version) static void keyboard_tests(DWORD version)
{ {
HRESULT hr; HRESULT hr;
LPDIRECTINPUT pDI = NULL; IDirectInputA *pDI = NULL;
HINSTANCE hInstance = GetModuleHandle(NULL); HINSTANCE hInstance = GetModuleHandleW(NULL);
HWND hwnd; HWND hwnd;
ULONG ref = 0; ULONG ref = 0;
hr = DirectInputCreate(hInstance, version, &pDI, NULL); hr = DirectInputCreateA(hInstance, version, &pDI, NULL);
if (hr == DIERR_OLDDIRECTINPUTVERSION) if (hr == DIERR_OLDDIRECTINPUTVERSION)
{ {
skip("Tests require a newer dinput version\n"); skip("Tests require a newer dinput version\n");
return; return;
} }
ok(SUCCEEDED(hr), "DirectInputCreate() failed: %08x\n", hr); ok(SUCCEEDED(hr), "DirectInputCreateA() failed: %08x\n", hr);
if (FAILED(hr)) return; if (FAILED(hr)) return;
hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW | WS_VISIBLE, hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 10, 10, 200, 200,
10, 10, 200, 200, NULL, NULL, NULL, NULL); NULL, NULL, NULL, NULL);
ok(hwnd != NULL, "err: %d\n", GetLastError()); ok(hwnd != NULL, "err: %d\n", GetLastError());
if (hwnd) if (hwnd)
......
...@@ -48,10 +48,10 @@ static const HRESULT SetCoop_child_window[16] = { ...@@ -48,10 +48,10 @@ static const HRESULT SetCoop_child_window[16] = {
E_INVALIDARG, E_HANDLE, E_HANDLE, E_INVALIDARG, E_INVALIDARG, E_HANDLE, E_HANDLE, E_INVALIDARG,
E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, 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; HRESULT hr;
LPDIRECTINPUTDEVICE pMouse = NULL; IDirectInputDeviceA *pMouse = NULL;
int i; int i;
HWND child; HWND child;
...@@ -70,8 +70,8 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd) ...@@ -70,8 +70,8 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd)
ok(hr == SetCoop_real_window[i], "SetCooperativeLevel(hwnd, %d): %08x\n", i, hr); ok(hr == SetCoop_real_window[i], "SetCooperativeLevel(hwnd, %d): %08x\n", i, hr);
} }
child = CreateWindow("static", "Title", WS_CHILD | WS_VISIBLE, child = CreateWindowA("static", "Title", WS_CHILD | WS_VISIBLE, 10, 10, 50, 50, hwnd, NULL,
10, 10, 50, 50, hwnd, NULL, NULL, NULL); NULL, NULL);
ok(child != NULL, "err: %d\n", GetLastError()); ok(child != NULL, "err: %d\n", GetLastError());
for (i=0; i<16; i++) for (i=0; i<16; i++)
...@@ -84,10 +84,10 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd) ...@@ -84,10 +84,10 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd)
if (pMouse) IUnknown_Release(pMouse); if (pMouse) IUnknown_Release(pMouse);
} }
static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd) static void test_acquire(IDirectInputA *pDI, HWND hwnd)
{ {
HRESULT hr; HRESULT hr;
LPDIRECTINPUTDEVICE pMouse = NULL; IDirectInputDeviceA *pMouse = NULL;
DIMOUSESTATE m_state; DIMOUSESTATE m_state;
HWND hwnd2; HWND hwnd2;
DIPROPDWORD di_op; DIPROPDWORD di_op;
...@@ -128,8 +128,8 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd) ...@@ -128,8 +128,8 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
/* Foreground coop level requires window to have focus */ /* Foreground coop level requires window to have focus */
/* Create a temporary window, this should make dinput /* Create a temporary window, this should make dinput
* loose mouse input */ * loose mouse input */
hwnd2 = CreateWindow("static", "Temporary", WS_VISIBLE, hwnd2 = CreateWindowA("static", "Temporary", WS_VISIBLE, 10, 210, 200, 200, NULL, NULL, NULL,
10, 210, 200, 200, NULL, NULL, NULL, NULL); NULL);
hr = IDirectInputDevice_GetDeviceState(pMouse, sizeof(m_state), &m_state); hr = IDirectInputDevice_GetDeviceState(pMouse, sizeof(m_state), &m_state);
ok(hr == DIERR_NOTACQUIRED, "GetDeviceState() should have failed: %08x\n", hr); ok(hr == DIERR_NOTACQUIRED, "GetDeviceState() should have failed: %08x\n", hr);
...@@ -181,22 +181,22 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd) ...@@ -181,22 +181,22 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
static void mouse_tests(void) static void mouse_tests(void)
{ {
HRESULT hr; HRESULT hr;
LPDIRECTINPUT pDI = NULL; IDirectInputA *pDI = NULL;
HINSTANCE hInstance = GetModuleHandle(NULL); HINSTANCE hInstance = GetModuleHandleW(NULL);
HWND hwnd; HWND hwnd;
ULONG ref = 0; ULONG ref = 0;
hr = DirectInputCreate(hInstance, DIRECTINPUT_VERSION, &pDI, NULL); hr = DirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &pDI, NULL);
if (hr == DIERR_OLDDIRECTINPUTVERSION) if (hr == DIERR_OLDDIRECTINPUTVERSION)
{ {
skip("Tests require a newer dinput version\n"); skip("Tests require a newer dinput version\n");
return; return;
} }
ok(SUCCEEDED(hr), "DirectInputCreate() failed: %08x\n", hr); ok(SUCCEEDED(hr), "DirectInputCreateA() failed: %08x\n", hr);
if (FAILED(hr)) return; if (FAILED(hr)) return;
hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW, hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW, 10, 10, 200, 200, NULL, NULL,
10, 10, 200, 200, NULL, NULL, NULL, NULL); NULL, NULL);
ok(hwnd != NULL, "err: %d\n", GetLastError()); ok(hwnd != NULL, "err: %d\n", GetLastError());
if (hwnd) if (hwnd)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment