617 IDirectInput8A *di =
NULL;
618 IDirectInputDevice8A *di_mouse, *di_keyboard;
619 UINT raw_devices_count;
620 RAWINPUTDEVICE raw_devices[3];
622 hwnd =
CreateWindowExA(
WS_EX_TOPMOST,
"static",
"dinput",
WS_POPUP |
WS_VISIBLE, 0, 0, 100, 100,
NULL,
NULL,
NULL,
NULL);
630 win_skip(
"test_mouse_keyboard requires dinput8\n");
638 win_skip(
"test_mouse_keyboard requires dinput8\n");
646 ok(
SUCCEEDED(
hr),
"IDirectInputDevice8_SetDataFormat failed: %08x\n",
hr);
651 ok(
SUCCEEDED(
hr),
"IDirectInputDevice8_SetDataFormat failed: %08x\n",
hr);
656 ok(raw_devices_count == 0,
"Unexpected raw devices registered: %d\n", raw_devices_count);
661 memset(raw_devices, 0,
sizeof(raw_devices));
664 ok(
hr == 1,
"GetRegisteredRawInputDevices returned %d, raw_devices_count: %d\n",
hr, raw_devices_count);
666 ok(raw_devices[0].usUsagePage == 1,
"Unexpected raw device usage page: %x\n", raw_devices[0].usUsagePage);
668 ok(raw_devices[0].usUsage == 6,
"Unexpected raw device usage: %x\n", raw_devices[0].usUsage);
670 ok(raw_devices[0].
dwFlags == RIDEV_INPUTSINK,
"Unexpected raw device flags: %x\n", raw_devices[0].
dwFlags);
672 ok(raw_devices[0].hwndTarget !=
NULL,
"Unexpected raw device target: %p\n", raw_devices[0].hwndTarget);
678 ok(raw_devices_count == 0,
"Unexpected raw devices registered: %d\n", raw_devices_count);
680 if (raw_devices[0].hwndTarget !=
NULL)
682 WCHAR di_hwnd_class[] = {
'D',
'I',
'E',
'm',
'W',
'i',
'n',0};
686 di_hwnd = raw_devices[0].hwndTarget;
688 ok(
i ==
lstrlenW(di_hwnd_class),
"GetClassName returned incorrect length\n");
689 ok(!
lstrcmpW(di_hwnd_class,
str),
"GetClassName returned incorrect name for this window's class\n");
692 ok(
i ==
lstrlenW(di_hwnd_class),
"GetClassName returned incorrect length\n");
693 ok(!
lstrcmpW(di_hwnd_class,
str),
"GetClassName returned incorrect name for this window's class\n");
699 memset(raw_devices, 0,
sizeof(raw_devices));
702 ok(
hr == 1,
"GetRegisteredRawInputDevices returned %d, raw_devices_count: %d\n",
hr, raw_devices_count);
704 ok(raw_devices[0].usUsagePage == 1,
"Unexpected raw device usage page: %x\n", raw_devices[0].usUsagePage);
706 ok(raw_devices[0].usUsage == 2,
"Unexpected raw device usage: %x\n", raw_devices[0].usUsage);
708 ok(raw_devices[0].
dwFlags == RIDEV_INPUTSINK,
"Unexpected raw device flags: %x\n", raw_devices[0].
dwFlags);
710 ok(raw_devices[0].hwndTarget == di_hwnd,
"Unexpected raw device target: %p\n", raw_devices[0].hwndTarget);
716 ok(raw_devices_count == 0,
"Unexpected raw devices registered: %d\n", raw_devices_count);
719 raw_devices[0].usUsagePage = 0x01;
720 raw_devices[0].usUsage = 0x05;
721 raw_devices[0].dwFlags = 0;
722 raw_devices[0].hwndTarget =
hwnd;
723 raw_devices[1].usUsagePage = 0x01;
724 raw_devices[1].usUsage = 0x06;
725 raw_devices[1].dwFlags = 0;
726 raw_devices[1].hwndTarget =
hwnd;
727 raw_devices[2].usUsagePage = 0x01;
728 raw_devices[2].usUsage = 0x02;
729 raw_devices[2].dwFlags = 0;
730 raw_devices[2].hwndTarget =
hwnd;
733 ok(
hr ==
TRUE,
"RegisterRawInputDevices failed\n");
740 memset(raw_devices, 0,
sizeof(raw_devices));
743 ok(
hr == 3,
"GetRegisteredRawInputDevices returned %d, raw_devices_count: %d\n",
hr, raw_devices_count);
745 ok(raw_devices[0].usUsagePage == 1,
"Unexpected raw device usage page: %x\n", raw_devices[0].usUsagePage);
747 ok(raw_devices[0].usUsage == 2,
"Unexpected raw device usage: %x\n", raw_devices[0].usUsage);
749 ok(raw_devices[0].
dwFlags == RIDEV_INPUTSINK,
"Unexpected raw device flags: %x\n", raw_devices[0].
dwFlags);
751 ok(raw_devices[0].hwndTarget == di_hwnd,
"Unexpected raw device target: %p\n", raw_devices[0].hwndTarget);
753 ok(raw_devices[1].usUsagePage == 1,
"Unexpected raw device usage page: %x\n", raw_devices[1].usUsagePage);
755 ok(raw_devices[1].usUsage == 5,
"Unexpected raw device usage: %x\n", raw_devices[1].usUsage);
756 ok(raw_devices[1].
dwFlags == 0,
"Unexpected raw device flags: %x\n", raw_devices[1].
dwFlags);
758 ok(raw_devices[1].hwndTarget ==
hwnd,
"Unexpected raw device target: %p\n", raw_devices[1].hwndTarget);
760 ok(raw_devices[2].usUsagePage == 1,
"Unexpected raw device usage page: %x\n", raw_devices[1].usUsagePage);
762 ok(raw_devices[2].usUsage == 6,
"Unexpected raw device usage: %x\n", raw_devices[1].usUsage);
764 ok(raw_devices[2].
dwFlags == RIDEV_INPUTSINK,
"Unexpected raw device flags: %x\n", raw_devices[1].
dwFlags);
766 ok(raw_devices[2].hwndTarget == di_hwnd,
"Unexpected raw device target: %p\n", raw_devices[1].hwndTarget);
774 ok(raw_devices_count == 1,
"Unexpected raw devices registered: %d\n", raw_devices_count);
779 ok(
hr == 1,
"GetRegisteredRawInputDevices returned %d, raw_devices_count: %d\n",
hr, raw_devices_count);
781 ok(raw_devices[0].usUsagePage == 1,
"Unexpected raw device usage page: %x\n", raw_devices[0].usUsagePage);
783 ok(raw_devices[0].usUsage == 5,
"Unexpected raw device usage: %x\n", raw_devices[0].usUsage);
784 ok(raw_devices[0].
dwFlags == 0,
"Unexpected raw device flags: %x\n", raw_devices[0].
dwFlags);
786 ok(raw_devices[0].hwndTarget ==
hwnd,
"Unexpected raw device target: %p\n", raw_devices[0].hwndTarget);
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
#define INVALID_HANDLE_VALUE
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
UINT WINAPI DECLSPEC_HOTPATCH GetRegisteredRawInputDevices(PRAWINPUTDEVICE pRawInputDevices, PUINT puiNumDevices, UINT cbSize)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
#define REGDB_E_CLASSNOTREG
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
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(PCRAWINPUTDEVICE pRawInputDevices, UINT uiNumDevices, UINT cbSize)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)