${SOURCE}
data_formats.c
dinput.rc
+ version.rc
${CMAKE_CURRENT_BINARY_DIR}/dinput.def)
add_library(dinput_data_formats data_formats.c)
*/
static void init_listview_columns(HWND dialog)
{
- HINSTANCE hinstance = (HINSTANCE) GetWindowLongPtrW(dialog, GWLP_HINSTANCE);
LVCOLUMNW listColumn;
RECT viewRect;
int width;
GetClientRect(GetDlgItem(dialog, IDC_DEVICEOBJECTSLIST), &viewRect);
width = (viewRect.right - viewRect.left)/2;
- LoadStringW(hinstance, IDS_OBJECTCOLUMN, column, sizeof(column)/sizeof(column[0]));
+ LoadStringW(DINPUT_instance, IDS_OBJECTCOLUMN, column, ARRAY_SIZE(column));
listColumn.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
listColumn.pszText = column;
listColumn.cchTextMax = lstrlenW(listColumn.pszText);
SendDlgItemMessageW (dialog, IDC_DEVICEOBJECTSLIST, LVM_INSERTCOLUMNW, 0, (LPARAM) &listColumn);
- LoadStringW(hinstance, IDS_ACTIONCOLUMN, column, sizeof(column)/sizeof(column[0]));
+ LoadStringW(DINPUT_instance, IDS_ACTIONCOLUMN, column, ARRAY_SIZE(column));
listColumn.cx = width;
listColumn.pszText = column;
listColumn.cchTextMax = lstrlenW(listColumn.pszText);
InitCommonControls();
- DialogBoxParamW(GetModuleHandleA("dinput.dll"), (LPCWSTR) MAKEINTRESOURCE(IDD_CONFIGUREDEVICES), lpdiCDParams->hwnd, ConfigureDevicesDlgProc, (LPARAM) &data);
+ DialogBoxParamW(DINPUT_instance, (const WCHAR *)MAKEINTRESOURCE(IDD_CONFIGUREDEVICES),
+ lpdiCDParams->hwnd, ConfigureDevicesDlgProc, (LPARAM)&data);
return DI_OK;
}
#undef FE
};
TRACE(" cooperative level : ");
- for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++)
+ for (i = 0; i < ARRAY_SIZE(flags); i++)
if (flags[i].mask & dwFlags)
TRACE("%s ",flags[i].name);
TRACE("\n");
TRACE("Flags:");
/* First the flags */
- for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++) {
+ for (i = 0; i < ARRAY_SIZE(flags); i++) {
if (flags[i].mask & dwFlags)
TRACE(" %s",flags[i].name);
}
if (type == DIDFT_ALL) {
TRACE(" DIDFT_ALL");
} else {
- for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++) {
+ for (i = 0; i < ARRAY_SIZE(flags); i++) {
if (flags[i].mask & type) {
type &= ~flags[i].mask;
TRACE(" %s",flags[i].name);
};
if (guid == NULL)
return "null GUID";
- for (i = 0; i < (sizeof(guids) / sizeof(guids[0])); i++) {
+ for (i = 0; i < ARRAY_SIZE(guids); i++) {
if (IsEqualGUID(guids[i].guid, guid)) {
return guids[i].name;
}
if (dwFlags & DIDSAM_NOUSER)
dps.wsz[0] = '\0';
else
- lstrcpynW(dps.wsz, username, sizeof(dps.wsz)/sizeof(WCHAR));
+ lstrcpynW(dps.wsz, username, ARRAY_SIZE(dps.wsz));
IDirectInputDevice8_SetProperty(iface, DIPROP_USERNAME, &dps.diph);
/* Save the settings to disk */
{
if (*device_player->username)
{
- lstrcpynW(ps->wsz, device_player->username, sizeof(ps->wsz)/sizeof(WCHAR));
+ lstrcpynW(ps->wsz, device_player->username, ARRAY_SIZE(ps->wsz));
return DI_OK;
}
else break;
device_player->instance_guid = This->guid;
}
if (device_player)
- lstrcpynW(device_player->username, ps->wsz,
- sizeof(device_player->username)/sizeof(WCHAR));
+ lstrcpynW(device_player->username, ps->wsz, ARRAY_SIZE(device_player->username));
break;
}
default:
LPDIRECTINPUTEFFECT ref;
} effect_list_item;
-extern const GUID DInput_Wine_Keyboard_GUID DECLSPEC_HIDDEN;
-extern const GUID DInput_Wine_Mouse_GUID DECLSPEC_HIDDEN;
-
/* Various debug tools */
extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) DECLSPEC_HIDDEN;
extern void _dump_OBJECTINSTANCEA(const DIDEVICEOBJECTINSTANCEA *ddoi) DECLSPEC_HIDDEN;
#include "resource.h"
-1 WINE_REGISTRY dinput_classes.rgs
-
-#define WINE_FILEDESCRIPTION_STR "Wine DirectInput"
-#define WINE_FILENAME_STR "dinput.dll"
-#define WINE_FILEVERSION 5,1,2600,881
-#define WINE_FILEVERSION_STR "5.1.2600.881"
-#define WINE_PRODUCTVERSION 5,1,2600,881
-#define WINE_PRODUCTVERSION_STR "5.1"
-
-#include "wine/wine_common_ver.rc"
-
#pragma makedep po
+1 WINE_REGISTRY dinput_classes.rgs
+
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STRINGTABLE
&joystick_osx_device
};
-static HINSTANCE DINPUT_instance = NULL;
+HINSTANCE DINPUT_instance;
static BOOL check_hook_thread(void);
static CRITICAL_SECTION dinput_hook_crit;
TRACE("DIEDFL_ALLDEVICES\n");
return;
}
- for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++)
+ for (i = 0; i < ARRAY_SIZE(flags); i++)
if (flags[i].mask & dwFlags)
TRACE("%s ",flags[i].name);
}
/* Add keyboard and mouse to remaining device count */
if (!(dwFlags & DIEDBSFL_FORCEFEEDBACK))
{
- for (i = 0; i < sizeof(guids) / sizeof(guids[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
{
if (should_enumerate_device(username_w, dwFlags, &This->device_players, guids[i]))
remain++;
}
/* Enumerate keyboard and mouse */
- for(i=0; i < sizeof(guids)/sizeof(guids[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
{
if (should_enumerate_device(username_w, dwFlags, &This->device_players, guids[i]))
{
/* Add keyboard and mouse to remaining device count */
if (!(dwFlags & DIEDBSFL_FORCEFEEDBACK))
{
- for (i = 0; i < sizeof(guids) / sizeof(guids[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
{
if (should_enumerate_device(ptszUserName, dwFlags, &This->device_players, guids[i]))
remain++;
if (dwFlags & DIEDBSFL_FORCEFEEDBACK) return DI_OK;
/* Enumerate keyboard and mouse */
- for(i=0; i < sizeof(guids)/sizeof(guids[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
{
if (should_enumerate_device(ptszUserName, dwFlags, &This->device_players, guids[i]))
{
{
if (!dev->acquired || !dev->event_proc) continue;
- if (IsEqualGUID( &dev->guid, &GUID_SysKeyboard ) ||
- IsEqualGUID( &dev->guid, &DInput_Wine_Keyboard_GUID ))
+ if (IsEqualGUID( &dev->guid, &GUID_SysKeyboard ))
kbd_cnt++;
else
- if (IsEqualGUID( &dev->guid, &GUID_SysMouse ) ||
- IsEqualGUID( &dev->guid, &DInput_Wine_Mouse_GUID ))
+ if (IsEqualGUID( &dev->guid, &GUID_SysMouse ))
mice_cnt++;
}
LeaveCriticalSection( &dinput->crit );
#include "dinputd.h"
#include "wine/list.h"
+extern HINSTANCE DINPUT_instance;
+
/* Implementation specification */
typedef struct IDirectInputImpl IDirectInputImpl;
struct IDirectInputImpl
FE(DIEFF_SPHERICAL)
#undef FE
};
- for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++)
+ for (i = 0; i < ARRAY_SIZE(flags); i++)
if (flags[i].mask & dwFlags)
TRACE("%s ", flags[i].name);
TRACE("\n");
LPCWSTR lpszUserName,
DWORD dwFlags)
{
+ static const DWORD object_types[] = { DIDFT_AXIS, DIDFT_BUTTON };
+ static const DWORD type_map[] = { DIDFT_RELAXIS, DIDFT_PSHBUTTON };
JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface);
unsigned int i, j;
BOOL has_actions = FALSE;
- DWORD object_types[] = { DIDFT_AXIS, DIDFT_BUTTON };
- DWORD type_map[] = { DIDFT_RELAXIS, DIDFT_PSHBUTTON };
FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
/* Only consider actions of the right genre */
if (lpdiaf->dwGenre != genre && genre != DIGENRE_ANY) continue;
- for (j=0; j < sizeof(object_types)/sizeof(object_types[0]); j++)
+ for (j = 0; j < ARRAY_SIZE(object_types); j++)
{
if (type & object_types[j])
{
{
int i;
- for (i = 0; i < sizeof(axis_names) / sizeof(axis_names[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(axis_names); i++)
{
if (!strcmp(ptr, axis_names[i]))
{
}
}
- if (i == sizeof(axis_names) / sizeof(axis_names[0]))
+ if (i == ARRAY_SIZE(axis_names))
{
ERR("invalid joystick axis type: \"%s\"\n", ptr);
i = -1;
if (!ret)
{
UniChar buf[200];
- int len = min(CFStringGetLength(s), sizeof(buf)/sizeof(buf[0]));
+ int len = min(CFStringGetLength(s), ARRAY_SIZE(buf));
CFStringGetCharacters(s, CFRangeMake(0, len), buf);
ret = debugstr_wn(buf, len);
}
return ret;
}
-const GUID DInput_Wine_Keyboard_GUID = { /* 0ab8648a-7735-11d2-8c73-71df54a96441 */
- 0x0ab8648a, 0x7735, 0x11d2, {0x8c, 0x73, 0x71, 0xdf, 0x54, 0xa9, 0x64, 0x41}
-};
-
static DWORD get_keyboard_subtype(void)
{
DWORD kbd_type, kbd_subtype, dev_subtype;
ddi.dwSize = dwSize;
ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
- ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */
+ ddi.guidProduct = GUID_SysKeyboard;
if (version >= 0x0800)
ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8);
else
ddi.dwSize = dwSize;
ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
- ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */
+ ddi.guidProduct = GUID_SysKeyboard;
if (version >= 0x0800)
ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8);
else
TRACE("%p %s %s %p %i\n", dinput, debugstr_guid(rguid), debugstr_guid(riid), pdev, unicode);
*pdev = NULL;
- if (IsEqualGUID(&GUID_SysKeyboard, rguid) || /* Generic Keyboard */
- IsEqualGUID(&DInput_Wine_Keyboard_GUID, rguid)) /* Wine Keyboard */
+ if (IsEqualGUID(&GUID_SysKeyboard, rguid)) /* Wine Keyboard */
{
SysKeyboardImpl *This;
scan = map_dik_to_scan(DIDFT_GETINSTANCE(pdidoi->dwType), This->subtype);
if (!GetKeyNameTextW((scan & 0x80) << 17 | (scan & 0x7f) << 16,
- pdidoi->tszName, sizeof(pdidoi->tszName)/sizeof(pdidoi->tszName[0])))
+ pdidoi->tszName, ARRAY_SIZE(pdidoi->tszName)))
return DIERR_OBJECTNOTFOUND;
_dump_OBJECTINSTANCEW(pdidoi);
static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam );
-const GUID DInput_Wine_Mouse_GUID = { /* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 */
- 0x9e573ed8, 0x7734, 0x11d2, {0x8d, 0x4a, 0x23, 0x90, 0x3f, 0xb6, 0xbd, 0xf7}
-};
-
static void _dump_mouse_state(const DIMOUSESTATE2 *m_state)
{
int i;
ddi.dwSize = dwSize;
ddi.guidInstance = GUID_SysMouse;/* DInput's GUID */
- ddi.guidProduct = DInput_Wine_Mouse_GUID; /* Vendor's GUID */
+ ddi.guidProduct = GUID_SysMouse;
if (version >= 0x0800)
ddi.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8);
else
ddi.dwSize = dwSize;
ddi.guidInstance = GUID_SysMouse;/* DInput's GUID */
- ddi.guidProduct = DInput_Wine_Mouse_GUID; /* Vendor's GUID */
+ ddi.guidProduct = GUID_SysMouse;
if (version >= 0x0800)
ddi.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8);
else
TRACE("%p %s %s %p %i\n", dinput, debugstr_guid(rguid), debugstr_guid(riid), pdev, unicode);
*pdev = NULL;
- if (IsEqualGUID(&GUID_SysMouse, rguid) || /* Generic Mouse */
- IsEqualGUID(&DInput_Wine_Mouse_GUID, rguid)) /* Wine Mouse */
+ if (IsEqualGUID(&GUID_SysMouse, rguid)) /* Wine Mouse */
{
SysMouseImpl *This;
--- /dev/null
+/*
+ * Copyright 2001 Ove Kaaven
+ *
+ * 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
+ */
+
+#define WINE_FILEDESCRIPTION_STR "Wine DirectInput"
+#define WINE_FILENAME_STR "dinput.dll"
+#define WINE_FILEVERSION 5,1,2600,881
+#define WINE_FILEVERSION_STR "5.1.2600.881"
+#define WINE_PRODUCTVERSION 5,1,2600,881
+#define WINE_PRODUCTVERSION_STR "5.1"
+
+#include "wine/wine_common_ver.rc"
reactos/dll/directx/wine/d3dxof # Synced to WineStaging-3.17
reactos/dll/directx/wine/ddraw # Synced to WineStaging-3.9
reactos/dll/directx/wine/devenum # Synced to WineStaging-3.9
-reactos/dll/directx/wine/dinput # Synced to WineStaging-3.17
+reactos/dll/directx/wine/dinput # Synced to WineStaging-4.0
reactos/dll/directx/wine/dinput8 # Synced to WineStaging-3.3
reactos/dll/directx/wine/dmusic # Synced to WineStaging-3.17
reactos/dll/directx/wine/dplay # Synced to WineStaging-3.3