19#define DIRECTINPUT_VERSION 0x0800
44 } create_device_tests[] =
61 } enum_devices_tests[] =
76 IDirectInputDevice8A *pDID;
78 hr =
CoCreateInstance(&CLSID_DirectInput8,
NULL, CLSCTX_INPROC_SERVER, &IID_IDirectInput8A, (
void **)&pDI);
81 skip(
"Failed to instantiate a IDirectInputA instance: 0x%08x\n",
hr);
87 if (create_device_tests[
i].pdev) pDID = (
void *)0xdeadbeef;
89 create_device_tests[
i].pdev ? &pDID :
NULL,
91 ok(
hr == create_device_tests[
i].expected_hr,
"[%d] IDirectInput8_CreateDevice returned 0x%08x\n",
i,
hr);
92 if (create_device_tests[
i].pdev)
93 ok(pDID ==
NULL,
"[%d] Output interface pointer is %p\n",
i, pDID);
99 enum_devices_tests[
i].lpCallback,
103 ok(
hr == enum_devices_tests[
i].expected_hr,
"[%d] IDirectInput8_EnumDevice returned 0x%08x\n",
i,
hr);
107 ok(
hr ==
E_POINTER,
"IDirectInput8_GetDeviceStatus returned 0x%08x\n",
hr);
122 ok(
hr ==
E_HANDLE,
"IDirectInput8_RunControlPanel returned 0x%08x\n",
hr);
125 ok(
hr ==
E_HANDLE,
"IDirectInput8_RunControlPanel returned 0x%08x\n",
hr);
139 } invalid_param_list[] =
174 static REFIID no_interface_list[] = {&IID_IDirectInputA, &IID_IDirectInputW,
175 &IID_IDirectInput2A, &IID_IDirectInput2W,
176 &IID_IDirectInput7A, &IID_IDirectInput7W,
177 &IID_IDirectInputDeviceA, &IID_IDirectInputDeviceW,
178 &IID_IDirectInputDevice2A, &IID_IDirectInputDevice2W,
179 &IID_IDirectInputDevice7A, &IID_IDirectInputDevice7W,
180 &IID_IDirectInputDevice8A, &IID_IDirectInputDevice8W,
181 &IID_IDirectInputEffect};
191 if (invalid_param_list[
i].ppdi)
pUnk = (
void *)0xdeadbeef;
194 invalid_param_list[
i].
riid,
195 invalid_param_list[
i].ppdi ? (
void **)&
pUnk :
NULL,
197 ok(
hr == invalid_param_list[
i].expected_hr,
"[%d] DirectInput8Create returned 0x%08x\n",
i,
hr);
198 if (invalid_param_list[
i].ppdi)
204 pUnk = (
void *)0xdeadbeef;
214 ok(
hr ==
DI_OK,
"[%d] DirectInput8Create returned 0x%08x\n",
i,
hr);
215 ok(
pUnk !=
NULL,
"[%d] Output interface pointer is NULL\n",
i);
217 IUnknown_Release(
pUnk);
223 static REFIID iid_list[] = {&
IID_IUnknown, &IID_IDirectInput8A, &IID_IDirectInput8W, &IID_IDirectInputJoyConfig8};
225 static REFIID no_interface_list[] =
233 &IID_IDirectInputDeviceA,
234 &IID_IDirectInputDeviceW,
235 &IID_IDirectInputDevice2A,
236 &IID_IDirectInputDevice2W,
237 &IID_IDirectInputDevice7A,
238 &IID_IDirectInputDevice7W,
239 &IID_IDirectInputDevice8A,
240 &IID_IDirectInputDevice8W,
241 &IID_IDirectInputEffect,
252 win_skip(
"Failed to instantiate a IDirectInputA instance: 0x%08x\n",
hr);
257 ok(
hr ==
E_POINTER,
"IDirectInput8_QueryInterface returned 0x%08x\n",
hr);
259 pUnk = (
void *)0xdeadbeef;
261 ok(
hr ==
E_POINTER,
"IDirectInput8_QueryInterface returned 0x%08x\n",
hr);
262 ok(
pUnk == (
void *)0xdeadbeef,
"Output interface pointer is %p\n",
pUnk);
265 ok(
hr ==
E_POINTER,
"IDirectInput8_QueryInterface returned 0x%08x\n",
hr);
271 ok(
hr ==
S_OK,
"[%d] IDirectInput8_QueryInterface returned 0x%08x\n",
i,
hr);
272 ok(
pUnk !=
NULL,
"[%d] Output interface pointer is NULL\n",
i);
280 ok(
hr ==
S_OK,
"[%d] IDirectInput8_QueryInterface(pUnk) returned 0x%08x\n",
j,
hr);
281 ok(pUnk1 !=
NULL,
"[%d] Output interface pointer is NULL\n",
i);
282 if (pUnk1) IUnknown_Release(pUnk1);
284 IUnknown_Release(
pUnk);
290 pUnk = (
void *)0xdeadbeef;
304 IDirectInputDevice8A *pDID;
309 win_skip(
"Failed to instantiate a IDirectInputA instance: 0x%08x\n",
hr);
314 ok(
hr ==
E_POINTER,
"IDirectInput8_CreateDevice returned 0x%08x\n",
hr);
316 pDID = (
void *)0xdeadbeef;
318 ok(
hr ==
E_POINTER,
"IDirectInput8_CreateDevice returned 0x%08x\n",
hr);
319 ok(pDID ==
NULL,
"Output interface pointer is %p\n", pDID);
322 ok(
hr ==
E_POINTER,
"IDirectInput8_CreateDevice returned 0x%08x\n",
hr);
324 pDID = (
void *)0xdeadbeef;
327 ok(pDID ==
NULL,
"Output interface pointer is %p\n", pDID);
330 ok(
hr ==
E_POINTER,
"IDirectInput8_CreateDevice returned 0x%08x\n",
hr);
333 ok(
hr ==
DI_OK,
"IDirectInput8_CreateDevice returned 0x%08x\n",
hr);
349 trace(
"---- Device Information ----\n"
350 "Product Name : %s\n"
351 "Instance Name : %s\n"
353 "GUID Product : %s\n"
354 "GUID Instance : %s\n"
355 "HID Page : 0x%04x\n"
356 "HID Usage : 0x%04x\n",
370 "%s guidInstance (%s) does not match guidProduct (%s)\n",
388 win_skip(
"Failed to instantiate a IDirectInputA instance: 0x%08x\n",
hr);
420 ok(
hr ==
DI_OK,
"IDirectInput8_EnumDevices returned 0x%08x\n",
hr);
427 ok(
hr ==
DI_OK,
"IDirectInput8_EnumDevices returned 0x%08x\n",
hr);
434 ok(
hr ==
DI_OK,
"IDirectInput8_EnumDevices returned 0x%08x\n",
hr);
453 { 0, 0x01008A01 , 0, {
"Steer.\0" } },
455 { 1, 0x01000C01 , 0, {
"Upshift.\0" } },
475 if (!
data->device_count) {
476 data->first_remaining = dwRemaining;
478 ok (dwRemaining ==
data->first_remaining -
data->device_count,
479 "enum semantics remaining devices is wrong, expected %d, had %d\n",
480 data->first_remaining -
data->device_count, dwRemaining);
481 data->device_count++;
511 const GUID ACTION_MAPPING_GUID = { 0x1, 0x2, 0x3, { 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb } };
513 int device_total = 0;
518 win_skip(
"Failed to instantiate a IDirectInputA instance: 0x%08x\n",
hr);
522 memset (&diaf, 0,
sizeof(diaf));
523 diaf.
dwSize =
sizeof(diaf);
535 data.device_count = 0;
537 ok (
data.device_count > 0,
"EnumDevicesBySemantics did not call the callback hr=%08x\n",
hr);
538 ok (
data.keyboard,
"EnumDevicesBySemantics should enumerate the keyboard\n");
539 ok (
data.mouse,
"EnumDevicesBySemantics should enumerate the mouse\n");
544 data.device_count = 0;
547 ok (!
data.keyboard,
"Keyboard should not be enumerated when asking for forcefeedback\n");
548 ok (!
data.mouse,
"Mouse should not be enumerated when asking for forcefeedback\n");
552 data.device_count = 0;
555 ok (
data.device_count > 0,
"There should be devices available before action mapping available=%d\n",
data.device_count);
558 device_total =
data.device_count;
562 data.device_count = 0;
565 ok (
data.device_count == 0,
"No devices should be assigned for this user assigned=%d\n",
data.device_count);
572 data.device_count = 0;
575 ok (
data.device_count == 0,
"No device should be available after action mapping available=%d\n",
data.device_count);
578 data.username =
"Sh4d0w M4g3";
583 data.device_count = 0;
586 ok (
data.device_count == device_total,
"THISUSER has no effect with NULL username owned=%d, expected=%d\n",
data.device_count, device_total);
589 data.device_count = 0;
592 ok (
data.device_count == device_total,
"THISUSER has no effect with \"\" as username owned=%d, expected=%d\n",
data.device_count, device_total);
595 data.device_count = 0;
598 ok (
data.device_count == 0,
"This user should own no devices owned=%d\n",
data.device_count);
601 data.device_count = 0;
604 ok (
data.device_count == device_total,
"This user should own %d devices owned=%d\n", device_total,
data.device_count);
608 data.device_count = 0;
623 win_skip(
"Failed to instantiate a IDirectInputA instance: 0x%08x\n",
hr);
628 ok(
hr ==
E_POINTER,
"IDirectInput8_GetDeviceStatus returned 0x%08x\n",
hr);
635 ok(
hr ==
DI_OK,
"IDirectInput8_GetDeviceStatus returned 0x%08x\n",
hr);
648 win_skip(
"Failed to instantiate a IDirectInputA instance: 0x%08x\n",
hr);
655 ok(
hr ==
S_OK,
"IDirectInput8_RunControlPanel returned 0x%08x\n",
hr);
658 ok(
hr ==
S_OK,
"IDirectInput8_RunControlPanel returned 0x%08x\n",
hr);
665 ok(
hr ==
E_HANDLE,
"IDirectInput8_RunControlPanel returned 0x%08x\n",
hr);
668 ok(
hr ==
E_HANDLE,
"IDirectInput8_RunControlPanel returned 0x%08x\n",
hr);
681 win_skip(
"Failed to instantiate a IDirectInputA instance: 0x%08x\n",
hr);
703 ok(
hr ==
DI_OK,
"IDirectInput8_Initialize returned 0x%08x\n",
hr);
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create(HINSTANCE hinst, DWORD version, REFIID iid, void **out, IUnknown *outer)
static HINSTANCE instance
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define todo_wine_if(is_todo)
#define IsEqualGUID(rguid1, rguid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
unsigned int device_count
unsigned int device_count
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
HWND WINAPI GetDesktopWindow(void)