http://bugs.winehq.org/show_bug.cgi?id=15336
Summary: DirectInputCreate(): hInst is ignored; NULL value doesn't result in an error. Product: Wine Version: 1.1.5 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: directx-dinput AssignedTo: wine-bugs@winehq.org ReportedBy: gerbilsoft@verizon.net
While porting an application from Linux to Win32, I noticed a bug in Wine's implementation of DirectInputCreate(). Specifically, Wine allows a NULL value for hInst, whereas on Windows, specifying a NULL hInst results in error 0x80070057 ("The parameter is incorrect.")
Code:
HRESULT rval; LPDIRECTINPUT lpDI; HINSTANCE ghInstance = NULL;
rval = DirectInputCreate(hInst, 0x0500, &lpDI, NULL);
Expected Result: rval should contain 0x80070057 and lpDI should remain uninitialized.
Actual Result: rval contains 0 and lpDI is initialized.
http://bugs.winehq.org/show_bug.cgi?id=15336
Maarten Lankhorst m.b.lankhorst@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |m.b.lankhorst@gmail.com
--- Comment #1 from Maarten Lankhorst m.b.lankhorst@gmail.com 2008-09-19 20:18:00 --- Please add a test to dlls/dinput/tests for this and fix it, it's not really hard to do. :-)
http://bugs.winehq.org/show_bug.cgi?id=15336
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase
http://bugs.winehq.org/show_bug.cgi?id=15336
Maarten Lankhorst m.b.lankhorst@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|testcase |
--- Comment #2 from Maarten Lankhorst m.b.lankhorst@gmail.com 2008-09-20 02:49:27 --- 'Testcase' keyword should only be added if someone attached a testcase here. Removing it.
http://bugs.winehq.org/show_bug.cgi?id=15336
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #3 from Vitaliy Margolen vitaliy@kievinfo.com 2008-09-20 11:05:44 --- Confirming, code doesn't use/care about that parameter.
http://bugs.winehq.org/show_bug.cgi?id=15336
--- Comment #4 from Austin English austinenglish@gmail.com 2008-09-20 12:06:17 --- (In reply to comment #2)
'Testcase' keyword should only be added if someone attached a testcase here. Removing it.
testcase - 'Bugs that have a testcase attached, in source form but not necessarily integrated into the Wine test suite.'
http://bugs.winehq.org/show_bug.cgi?id=15336
--- Comment #5 from GerbilSoft gerbilsoft@verizon.net 2008-09-20 12:28:47 --- Created an attachment (id=16173) --> (http://bugs.winehq.org/attachment.cgi?id=16173) DirectInputCreate(): Check if hInst is NULL.
Ideally, it should check that hInst matches an existing instance, but I'm unsure how to do that.
http://bugs.winehq.org/show_bug.cgi?id=15336
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com Keywords| |testcase
http://bugs.winehq.org/show_bug.cgi?id=15336
--- Comment #6 from Austin English austinenglish@gmail.com 2009-03-30 13:22:32 --- Is this still an issue in current (1.1.18 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=15336
--- Comment #7 from Austin English austinenglish@gmail.com 2009-10-01 20:49:01 --- Patch sent:
http://www.winehq.org/pipermail/wine-patches/2009-October/079299.html
http://bugs.winehq.org/show_bug.cgi?id=15336
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|austinenglish@gmail.com |
http://bugs.winehq.org/show_bug.cgi?id=15336
Christian Costa titan.costa@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |titan.costa@gmail.com
--- Comment #8 from Christian Costa titan.costa@gmail.com 2012-10-12 16:55:43 CDT --- This bug is fixed. DirectInputCreate{A|W|Ex} call Initialize which does the check of the instance. Please check.
static HRESULT WINAPI IDirectInputAImpl_Initialize(LPDIRECTINPUT7A iface, HINSTANCE hinst, DWORD version) { IDirectInputImpl *This = impl_from_IDirectInput7A( iface );
TRACE("(%p)->(%p, 0x%04x)\n", iface, hinst, version);
if (!hinst) return DIERR_INVALIDPARAM; else if (version == 0) return DIERR_NOTINITIALIZED;
http://bugs.winehq.org/show_bug.cgi?id=15336
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |00cpxxx@gmail.com Resolution| |FIXED
--- Comment #9 from Bruno Jesus 00cpxxx@gmail.com 2012-10-12 21:13:28 CDT --- (In reply to comment #8)
This bug is fixed. DirectInputCreate{A|W|Ex} call Initialize which does the check of the instance. Please check.
Indeed there is a test that currently proves it's fixed AFAICS: http://source.winehq.org/source/dlls/dinput/tests/dinput.c#L174
http://bugs.winehq.org/show_bug.cgi?id=15336
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alexandre Julliard julliard@winehq.org 2012-10-26 13:30:47 CDT --- Closing bugs fixed in 1.5.16.