diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index edf835091c4..217618a19b5 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -488,13 +488,14 @@ failed: } /* find an object by it's offset in a data format */ -int offset_to_object(LPCDIDATAFORMAT df, int offset) +static int offset_to_object(DataFormat *df, int offset) { int i; - for (i = 0; i < df->dwNumObjs; i++) - if (dataformat_to_odf(df, i)->dwOfs == offset) - return i; + if (!df->offsets) return -1; + + for (i = 0; i < df->wine_df->dwNumObjs; i++) + if (df->offsets[i] == offset) return i; return -1; } @@ -522,8 +523,8 @@ int find_property(DataFormat *df, LPCDIPROPHEADER ph) { switch (ph->dwHow) { - case DIPH_BYID: return id_to_object(df->user_df, ph->dwObj); - case DIPH_BYOFFSET: return offset_to_object(df->user_df, ph->dwObj); + case DIPH_BYID: return id_to_object(df->wine_df, ph->dwObj); + case DIPH_BYOFFSET: return offset_to_object(df, ph->dwObj); } FIXME("Unhandled ph->dwHow=='%04X'\n", (unsigned int)ph->dwHow); diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index e541b86883b..ae2da3c81a5 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -73,7 +73,6 @@ extern HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *forma extern void release_DataFormat(DataFormat *df) ; extern void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, DWORD seq); /* Helper functions to work with data format */ -extern int offset_to_object(LPCDIDATAFORMAT df, int offset); extern int id_to_offset(DataFormat *df, int id); extern int find_property(DataFormat *df, LPCDIPROPHEADER ph);