Re: dinput: Stub IDirectInputJoyConfig8 interface. (try 2)

2011-11-25 Thread Vitaliy Margolen

On 11/25/2011 04:14 AM, Jacek Caban wrote:

Hi Vitaliy,

On 11/25/11 04:17, Vitaliy Margolen wrote:

Fix QueryInterface, simplify use of AddRef, and replace
"LPDIRECTINPUTJOYCONFIG8"
with "IDirectInputJoyConfig8 *".
---
dlls/dinput/dinput_main.c | 7 ++
dlls/dinput/dinput_private.h | 2 +
dlls/dinput/joystick.c | 196 ++
include/dinputd.h | 243 ++
4 files changed, 448 insertions(+), 0 deletions(-)
create mode 100644 include/dinputd.h



+ if (IsEqualGUID(&IID_IDirectInputJoyConfig8, riid ))
+ {
+ return create_joy_config( riid, ppobj );
+ }


This has the same problem as we discussed about msxml3 lately:

http://www.winehq.org/pipermail/wine-devel/2011-November/093279.html

Are you sure native is broken the same way?
You were right. It is a part of IDirectInput not a standalone class. Sent a 
fixed patch.


Vitaliy.




Re: dinput: Stub IDirectInputJoyConfig8 interface. (try 2)

2011-11-25 Thread Jacek Caban

Hi Vitaliy,

On 11/25/11 04:17, Vitaliy Margolen wrote:

Fix QueryInterface, simplify use of AddRef, and replace 
"LPDIRECTINPUTJOYCONFIG8"
with "IDirectInputJoyConfig8 *".
---
  dlls/dinput/dinput_main.c|7 ++
  dlls/dinput/dinput_private.h |2 +
  dlls/dinput/joystick.c   |  196 ++
  include/dinputd.h|  243 ++
  4 files changed, 448 insertions(+), 0 deletions(-)
  create mode 100644 include/dinputd.h



+if (IsEqualGUID(&IID_IDirectInputJoyConfig8, riid ))
+{
+return create_joy_config( riid, ppobj );
+}


This has the same problem as we discussed about msxml3 lately:

http://www.winehq.org/pipermail/wine-devel/2011-November/093279.html

Are you sure native is broken the same way?

+static const IDirectInputJoyConfig8Vtbl JoyConfig8vt;
+
+HRESULT create_joy_config(REFIID riid, LPVOID *object)
+{
+IDirectInputJoyConfig8Impl *new_joy_config;
+
+TRACE("(%s, %p)\n", debugstr_guid(riid), object);
+
+new_joy_config = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 
sizeof(*new_joy_config));
+if (!new_joy_config) return DIERR_OUTOFMEMORY;
+
+new_joy_config->IDirectInputJoyConfig8_iface.lpVtbl =&JoyConfig8vt;
+*object = new_joy_config;
+
+return DI_OK;
+}

If you moved create_joy_config to the bottom of the file, you wouldn't need 
JoyConfig8vt forward declaration.

+static HRESULT WINAPI JoyConfig8Impl_QueryInterface(IDirectInputJoyConfig8 
*iface, REFIID riid, void** object)
+{
+IDirectInputJoyConfig8Impl *This = impl_from_IDirectInputJoyConfig8(iface);
+
+TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), object);
+
+if (IsEqualGUID(&IID_IUnknown, riid) ||
+IsEqualGUID(&IID_IDirectInput8W, riid))

Here is a typo, it should be IID_IDirectInputJoyConfig8.

Jacek