Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backström <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma català).
1998-02-01 19:33:27 +01:00
|
|
|
/* DirectInput
|
|
|
|
*
|
|
|
|
* Copyright 1998 Marcus Meissner
|
1999-02-09 15:18:21 +01:00
|
|
|
* Copyright 1998,1999 Lionel Ulmer
|
2002-06-14 02:39:44 +02:00
|
|
|
* Copyright 2000-2002 TransGaming Technologies Inc.
|
2007-07-12 06:51:32 +02:00
|
|
|
* Copyright 2007 Vitaliy Margolen
|
1998-11-06 18:28:22 +01:00
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backström <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma català).
1998-02-01 19:33:27 +01:00
|
|
|
*/
|
|
|
|
/* Status:
|
|
|
|
*
|
|
|
|
* - Tomb Raider 2 Demo:
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
* Playable using keyboard only.
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backström <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma català).
1998-02-01 19:33:27 +01:00
|
|
|
* - WingCommander Prophecy Demo:
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
* Doesn't get Input Focus.
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
1998-11-06 18:28:22 +01:00
|
|
|
* - Fallout : works great in X and DGA mode
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backström <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma català).
1998-02-01 19:33:27 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <assert.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2001-01-26 21:43:40 +01:00
|
|
|
#include <string.h>
|
2000-08-03 06:22:35 +02:00
|
|
|
|
2004-10-07 05:06:48 +02:00
|
|
|
#define COBJMACROS
|
2008-02-26 09:49:20 +01:00
|
|
|
#define NONAMELESSUNION
|
2004-10-07 05:06:48 +02:00
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
1999-07-25 13:21:07 +02:00
|
|
|
#include "winbase.h"
|
2002-05-20 00:26:16 +02:00
|
|
|
#include "winuser.h"
|
1999-07-04 15:31:03 +02:00
|
|
|
#include "winerror.h"
|
2010-12-07 12:48:24 +01:00
|
|
|
#include "objbase.h"
|
|
|
|
#include "rpcproxy.h"
|
2011-11-26 18:30:07 +01:00
|
|
|
#include "initguid.h"
|
2019-06-04 23:53:44 +02:00
|
|
|
#include "devguid.h"
|
2021-10-11 10:10:58 +02:00
|
|
|
#include "dinputd.h"
|
|
|
|
|
2000-11-05 21:25:02 +01:00
|
|
|
#include "dinput_private.h"
|
2007-07-07 07:36:09 +02:00
|
|
|
#include "device_private.h"
|
2021-10-11 10:10:58 +02:00
|
|
|
|
|
|
|
#include "wine/asm.h"
|
|
|
|
#include "wine/debug.h"
|
2000-08-03 06:22:35 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(dinput);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static const IDirectInput7WVtbl dinput7_vtbl;
|
2022-02-07 09:23:29 +01:00
|
|
|
static const IDirectInput8WVtbl dinput8_vtbl;
|
2022-02-07 09:23:27 +01:00
|
|
|
static const IDirectInputJoyConfig8Vtbl joy_config_vtbl;
|
1998-11-14 12:22:25 +01:00
|
|
|
|
2022-02-08 09:55:36 +01:00
|
|
|
static inline struct dinput *impl_from_IDirectInput7W( IDirectInput7W *iface )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
return CONTAINING_RECORD( iface, struct dinput, IDirectInput7W_iface );
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
|
|
|
|
2022-02-08 09:55:36 +01:00
|
|
|
static inline struct dinput *impl_from_IDirectInput8W( IDirectInput8W *iface )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
return CONTAINING_RECORD( iface, struct dinput, IDirectInput8W_iface );
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
|
|
|
|
2021-10-27 09:40:59 +02:00
|
|
|
static inline struct dinput_device *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface )
|
2011-01-09 23:44:19 +01:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
return CONTAINING_RECORD( iface, struct dinput_device, IDirectInputDevice8W_iface );
|
2011-01-09 23:44:19 +01:00
|
|
|
}
|
|
|
|
|
2018-12-19 22:41:13 +01:00
|
|
|
HINSTANCE DINPUT_instance;
|
2002-12-24 02:18:21 +01:00
|
|
|
|
2020-08-10 11:04:15 +02:00
|
|
|
static HWND di_em_win;
|
|
|
|
|
2021-12-10 09:44:44 +01:00
|
|
|
static HANDLE dinput_thread;
|
|
|
|
static DWORD dinput_thread_id;
|
|
|
|
|
2007-07-07 07:36:18 +02:00
|
|
|
static CRITICAL_SECTION dinput_hook_crit;
|
2021-12-10 09:44:44 +01:00
|
|
|
static CRITICAL_SECTION_DEBUG dinput_critsect_debug =
|
|
|
|
{
|
|
|
|
0, 0, &dinput_hook_crit,
|
|
|
|
{ &dinput_critsect_debug.ProcessLocksList, &dinput_critsect_debug.ProcessLocksList },
|
|
|
|
0, 0, { (DWORD_PTR)(__FILE__ ": dinput_hook_crit") }
|
|
|
|
};
|
|
|
|
static CRITICAL_SECTION dinput_hook_crit = { &dinput_critsect_debug, -1, 0, 0, 0, 0 };
|
|
|
|
|
2020-06-08 09:47:09 +02:00
|
|
|
static struct list acquired_mouse_list = LIST_INIT( acquired_mouse_list );
|
2020-08-10 11:04:17 +02:00
|
|
|
static struct list acquired_rawmouse_list = LIST_INIT( acquired_rawmouse_list );
|
2020-06-08 09:47:09 +02:00
|
|
|
static struct list acquired_keyboard_list = LIST_INIT( acquired_keyboard_list );
|
2020-06-08 09:47:08 +02:00
|
|
|
static struct list acquired_device_list = LIST_INIT( acquired_device_list );
|
2002-05-20 00:26:16 +02:00
|
|
|
|
2022-02-08 09:55:36 +01:00
|
|
|
static HRESULT initialize_directinput_instance( struct dinput *impl, DWORD version );
|
|
|
|
static void uninitialize_directinput_instance( struct dinput *impl );
|
2011-07-05 14:19:17 +02:00
|
|
|
|
2021-10-27 09:40:59 +02:00
|
|
|
void dinput_hooks_acquire_device( IDirectInputDevice8W *iface )
|
2020-06-08 09:47:08 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
|
2020-06-08 09:47:08 +02:00
|
|
|
|
|
|
|
EnterCriticalSection( &dinput_hook_crit );
|
2021-10-27 09:40:59 +02:00
|
|
|
if (IsEqualGUID( &impl->guid, &GUID_SysMouse ))
|
|
|
|
list_add_tail( impl->use_raw_input ? &acquired_rawmouse_list : &acquired_mouse_list, &impl->entry );
|
|
|
|
else if (IsEqualGUID( &impl->guid, &GUID_SysKeyboard ))
|
|
|
|
list_add_tail( &acquired_keyboard_list, &impl->entry );
|
2020-06-08 09:47:09 +02:00
|
|
|
else
|
2021-10-27 09:40:59 +02:00
|
|
|
list_add_tail( &acquired_device_list, &impl->entry );
|
2020-06-08 09:47:08 +02:00
|
|
|
LeaveCriticalSection( &dinput_hook_crit );
|
|
|
|
}
|
|
|
|
|
2021-10-27 09:40:59 +02:00
|
|
|
void dinput_hooks_unacquire_device( IDirectInputDevice8W *iface )
|
2020-06-08 09:47:08 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
|
2020-06-08 09:47:08 +02:00
|
|
|
|
|
|
|
EnterCriticalSection( &dinput_hook_crit );
|
2021-10-27 09:40:59 +02:00
|
|
|
list_remove( &impl->entry );
|
2020-06-08 09:47:08 +02:00
|
|
|
LeaveCriticalSection( &dinput_hook_crit );
|
|
|
|
}
|
|
|
|
|
2021-10-13 09:21:18 +02:00
|
|
|
static void dinput_device_internal_unacquire( IDirectInputDevice8W *iface )
|
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
|
2021-10-13 09:21:18 +02:00
|
|
|
|
|
|
|
TRACE( "iface %p.\n", iface );
|
|
|
|
|
|
|
|
EnterCriticalSection( &impl->crit );
|
2022-01-24 12:02:46 +01:00
|
|
|
if (impl->status == STATUS_ACQUIRED)
|
2021-10-13 09:21:18 +02:00
|
|
|
{
|
|
|
|
impl->vtbl->unacquire( iface );
|
2022-01-24 12:02:46 +01:00
|
|
|
impl->status = STATUS_UNACQUIRED;
|
2021-10-13 09:21:18 +02:00
|
|
|
list_remove( &impl->entry );
|
|
|
|
}
|
|
|
|
LeaveCriticalSection( &impl->crit );
|
|
|
|
}
|
|
|
|
|
2022-02-08 09:55:38 +01:00
|
|
|
static HRESULT dinput_create( IUnknown **out )
|
2011-07-05 14:19:17 +02:00
|
|
|
{
|
2022-02-08 09:55:38 +01:00
|
|
|
struct dinput *impl;
|
2011-07-05 14:19:17 +02:00
|
|
|
|
2022-02-08 09:55:38 +01:00
|
|
|
if (!(impl = calloc( 1, sizeof(struct dinput) ))) return E_OUTOFMEMORY;
|
2022-02-08 09:55:36 +01:00
|
|
|
impl->IDirectInput7A_iface.lpVtbl = &dinput7_a_vtbl;
|
|
|
|
impl->IDirectInput7W_iface.lpVtbl = &dinput7_vtbl;
|
|
|
|
impl->IDirectInput8A_iface.lpVtbl = &dinput8_a_vtbl;
|
|
|
|
impl->IDirectInput8W_iface.lpVtbl = &dinput8_vtbl;
|
|
|
|
impl->IDirectInputJoyConfig8_iface.lpVtbl = &joy_config_vtbl;
|
2022-02-08 09:55:38 +01:00
|
|
|
impl->ref = 1;
|
2011-07-05 14:19:17 +02:00
|
|
|
|
2022-02-08 09:55:38 +01:00
|
|
|
#if DIRECTINPUT_VERSION == 0x0700
|
|
|
|
*out = (IUnknown *)&impl->IDirectInput7W_iface;
|
|
|
|
#else
|
|
|
|
*out = (IUnknown *)&impl->IDirectInput8W_iface;
|
|
|
|
#endif
|
2011-07-05 14:19:17 +02:00
|
|
|
return DI_OK;
|
|
|
|
}
|
|
|
|
|
2000-10-14 01:07:29 +02:00
|
|
|
/******************************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* DirectInputCreateEx (DINPUT.@)
|
2000-10-14 01:07:29 +02:00
|
|
|
*/
|
2022-02-08 09:55:37 +01:00
|
|
|
HRESULT WINAPI DirectInputCreateEx( HINSTANCE hinst, DWORD version, REFIID iid, void **out, IUnknown *outer )
|
2003-06-16 22:22:13 +02:00
|
|
|
{
|
2022-02-08 09:55:38 +01:00
|
|
|
IUnknown *unknown;
|
2011-07-05 14:19:17 +02:00
|
|
|
HRESULT hr;
|
2006-07-31 07:32:30 +02:00
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "hinst %p, version %#lx, iid %s, out %p, outer %p.\n", hinst, version, debugstr_guid( iid ), out, outer );
|
2006-07-31 07:32:30 +02:00
|
|
|
|
2022-02-08 09:55:38 +01:00
|
|
|
if (!IsEqualGUID( &IID_IDirectInputA, iid ) &&
|
|
|
|
!IsEqualGUID( &IID_IDirectInputW, iid ) &&
|
|
|
|
!IsEqualGUID( &IID_IDirectInput2A, iid ) &&
|
|
|
|
!IsEqualGUID( &IID_IDirectInput2W, iid ) &&
|
|
|
|
!IsEqualGUID( &IID_IDirectInput7A, iid ) &&
|
|
|
|
!IsEqualGUID( &IID_IDirectInput7W, iid ))
|
2011-07-05 14:19:21 +02:00
|
|
|
return DIERR_NOINTERFACE;
|
2006-07-31 07:32:30 +02:00
|
|
|
|
2022-02-08 09:55:38 +01:00
|
|
|
if (FAILED(hr = dinput_create( &unknown ))) return hr;
|
|
|
|
hr = IUnknown_QueryInterface( unknown, iid, out );
|
|
|
|
IUnknown_Release( unknown );
|
|
|
|
if (FAILED(hr)) return hr;
|
|
|
|
|
|
|
|
if (outer || FAILED(hr = IDirectInput7_Initialize( (IDirectInput7W *)unknown, hinst, version )))
|
2007-07-07 07:36:18 +02:00
|
|
|
{
|
2022-02-08 09:55:38 +01:00
|
|
|
IUnknown_Release( unknown );
|
2022-02-08 09:55:37 +01:00
|
|
|
*out = NULL;
|
2011-07-05 14:19:17 +02:00
|
|
|
return hr;
|
2006-07-31 07:32:30 +02:00
|
|
|
}
|
2007-07-07 07:36:18 +02:00
|
|
|
|
|
|
|
return DI_OK;
|
2000-10-14 01:07:29 +02:00
|
|
|
}
|
|
|
|
|
2018-08-20 17:25:26 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* DirectInput8Create (DINPUT8.@)
|
|
|
|
*/
|
2022-02-08 09:55:37 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create( HINSTANCE hinst, DWORD version, REFIID iid, void **out, IUnknown *outer )
|
2018-08-20 17:25:26 +02:00
|
|
|
{
|
2022-02-08 09:55:38 +01:00
|
|
|
IUnknown *unknown;
|
2018-08-20 17:25:26 +02:00
|
|
|
HRESULT hr;
|
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "hinst %p, version %#lx, iid %s, out %p, outer %p.\n", hinst, version, debugstr_guid( iid ), out, outer );
|
2018-08-20 17:25:26 +02:00
|
|
|
|
2022-02-08 09:55:37 +01:00
|
|
|
if (!out) return E_POINTER;
|
2018-08-20 17:25:26 +02:00
|
|
|
|
2022-02-08 09:55:38 +01:00
|
|
|
if (!IsEqualGUID( &IID_IDirectInput8A, iid ) &&
|
|
|
|
!IsEqualGUID( &IID_IDirectInput8W, iid ) &&
|
|
|
|
!IsEqualGUID( &IID_IUnknown, iid ))
|
2018-08-20 17:25:26 +02:00
|
|
|
{
|
|
|
|
*out = NULL;
|
|
|
|
return DIERR_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2022-02-08 09:55:38 +01:00
|
|
|
if (FAILED(hr = dinput_create( &unknown ))) return hr;
|
|
|
|
hr = IUnknown_QueryInterface( unknown, iid, out );
|
|
|
|
IUnknown_Release( unknown );
|
|
|
|
if (FAILED(hr)) return hr;
|
2018-08-20 17:25:26 +02:00
|
|
|
|
2022-02-08 09:55:38 +01:00
|
|
|
if (outer || FAILED(hr = IDirectInput8_Initialize( (IDirectInput8W *)unknown, hinst, version )))
|
2018-08-20 17:25:26 +02:00
|
|
|
{
|
2022-02-08 09:55:38 +01:00
|
|
|
IUnknown_Release( (IUnknown *)unknown );
|
|
|
|
*out = NULL;
|
2018-08-20 17:25:26 +02:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
Release 980601
Sun May 31 13:40:13 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/signal.c]
Added display of exception name.
* [loader/task.c]
Yet another attempt at fixing SwitchStackTo/SwitchStackBack.
* [memory/selector.c] [relay32/builtin32.c] [tools/build.c]
[win32/kernel32.c]
Generate an assembly stub for Win32 register functions to make
their names available at link time.
* [programs/*/Makefile.in]
Added hacks to support old resource compiler.
Fri May 29 16:27:14 1998 Marcus Meissner <marcus@jet.franken.de>
* [tools/testrun]
Merge of my testscripts at home into one single perl program
(tested with perl5). Works only on Linux due to 'ps' and 'ipcs'
magic.
* [controls/menu.c]
Added some DefaultMenuItem stubs.
* [debugger/stabs.c]
Fixed stabs loading, now supports (int,int) typeinfo format used
by gcc-2.8 and egcs-1. If it still crashes, please mail me.
* [if1632/][relay32/]
Added msvideo.dll (stubs only)
Replaced some ptr by str for stringcases
Added some new stubs (VxDCall, FindCloseNotif....)
* [misc/network.c]
Some argument fixes.
* [misc/registry.c][misc/cpu.c]
Registry initialization partially rewritten and enhanced.
* [scheduler/*.c]
Some additions so we don't do kill(0,SIGUSR1) (kill processgroup
instead of targeted thread)
Added SetThreadContext.
Thu May 28 23:59:59 1998 Bertho Stultiens <bertho@akhphd.au.dk>
* [tools/wrc/*]
New resource compiler version 1.0.0 (28-May-1998)
* [Make.rules.in] [Makefile.in]
Changed and added rc rules to point to tools/wrc/wrc.
* [configure.in] [include/config.h.in]
Added check for function 'stricmp'.
* [include/resource.h]
Commented out the old resource structure to catch references.
It also includes wrc_rsc.h.
* [include/wrc_rsc.h]
New file. Definitions for the resources generated with wrc.
* [include/windows.h]
Added #ifdef RC_INVOKED to exclude stdarg.h.
Added SS_NOTIFY flag.
* [include/winnls.h]
Added SUBLANG_* definitions and corrected some defaults.
* [loader/libres.c]
Changed the sysres load functions to support wrc generated
resources.
* [resource/sysres_*.rc]
Added #include <windows.h>
* [resource/sysres.c]
Changed declarations to match wrc's output
* [resource/Makefile.in]
Changed rules to work with wrc.
* [tools/makedep.c]
Changed generation of .rc file dependencies to .s target.
Thu May 28 22:28:39 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [files/file.c][include/windows.c][relay32/kernel32.spec]
Implemented GetFileAttributesEx32A/W.
* [misc/imagelist.h][include/commctrl.h][relay32/comctl32.spec]
Added ImageList_Read and ImageList_Write stubs.
Added ImageList_AddIcon function.
Added ImageList_LoadImage. It is the same as ImageList_LoadImage32A.
* [controls/header.c]
Fixed bitmap drawing bug.
Added full bitmap support.
* [include/commctrl.h]
Added missing header macros.
* [controls/toolbar.c][include/toolbar.h][include/commctrl.h]
[controls/commctrl.c] [relay32/comctl32.spec]
First implementation of toolbar control.
Implemented CreateToolbar, CreateToolbarEx and CreateMappedBitmap.
* [controls/progress.c][controls/status.c]
Some code cleanup.
* [controls/commctrl.c][include/commctrl.h][relay32/comctl32.spec]
Removed CreateStatusWindow16 and DrawStatusText16.
CreateStatusWindow is the same as CreateStatusWindow32A.
DrawStatusText is the same as DrawStatusText32A.
Thu May 28 16:01:28 1998 Matthew J. Francis <asbel@dial.pipex.com>
* [objects/bitmap.c] [objects/bitmap.h] [objects/oembitmap.c]
[objects/dc.c] [graphics/x11drv/bitblt.c]
Added partial implementation of CreateDIBSection, with great thanks
to Ulrich Weigand <weigand@informatik.uni-erlangen.de> for
contributing the bulk of the patch.
Wed May 27 19:04:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [win32/kernel32.c] [if1632/thunk.c] [include/flatthunk.h]
ThunkConnect16 and related functions moved to emulator.
* [loader/ne/segment.c]
Call DllEntryPoint with correct arguments.
* [relay32/builtin32.c]
Bugfix: Relay debugging did not work for multiple processes.
* [controls/menu.c]
Bugfix: dwItemData was not set for MF_OWNERDRAW menus.
* [if1632/relay.c] [relay32/relay386.c]
Relay messages converted to use DPRINTF.
* [controls/desktop.c] [relay32/user32.spec]
Implemented PaintDesktop.
* [files/profile.c] [if1632/kernel.spec] [misc/network.c]
[misc/printdrv.c] [relay32/winspool.spec]
[win32/ordinals.c] [relay32/kernel32.spec]
Some stubs added.
* [relay32/mpr.spec]
All ordinals were off by one.
Tue May 26 13:32:57 1998 Bill Hawes <whawes@star.net>
* [misc/lstr.c] [include/casemap.h] [tools/unimap.pl]
Added Unicode case conversion routines towupper/towlower,
with mapping tables casemap.h created by tools/unimap.pl.
* [misc/ntdll.c] [include/winnls.h] [relay32/ntdll.spec]
[relay32/advapi.spec]
Minimal implementation of IsTextUnicode, just enough to get
NT4 notepad to open ascii/unicode files.
* [Make.rules.in] [resources/sysres_En.rc]
Added include file dlgs.h for building resource files, so that
resources can refer to defined values (e.g. pshHelp).
* [misc/crtdll.c] [relay32/crtdll.spec]
Use towupper/towlower for 32W case conversions.
* [memory/string.c]
Use towupper for 32W case conversions.
* [ole/ole2nls.c]
Use towupper for 32W case conversions; fix mem leak; minor cleanup
* [controls/edit.c]
Added soft break flag to edit state. Print unknown action values
for WM_VSCROLL (action 190 occurs when running NT4 notepad.)
Mon May 25 22:42:40 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [files/file.c]
Care for a pathological case in SetFilePointer.
* [graphics/x11drv/xfont.c]
Handle longer Font names in LFD_ComposeLFD and try to catch errors.
* [loader/pe_image.c]
Unload Dummymodule when PE_LoadLibraryEx32A fails with
PE_LoadImage (makes Encarta 98 installer proceed).
* [misc/registry.c]
Move a check for a special case in RegCreateKeyEx32W after the
check for existence.
Tue May 25 20:18:26 1998 Matthew Becker <mbecker@glasscity.net>
* [misc/ntdll.c]
Added some stubs, just guessing at the size of their param lists.
* [misc/registry.c]
Added stubs for RegUnLoadKey, RegSetKeySecurity, RegSaveKey,
RegRestoreKey, and RegReplaceKey
* [programs/regtest/regtest.c]
Updated registry testing program.
Sun May 24 18:11:40 1998 Alex Priem <alexp@sci.kun.nl>
* [file/profile.c]
Added flag 'return_values' to PROFILE_GetSection.
Sun May 24 13:41:10 1998 James Juran <jrj120@psu.edu>
* [misc/shell.c] [files/directory.c]
Documentation/debugging info additions.
* [*/*.c] [include/*.h]
Moved many extern function definitions to appropriate header files.
Cleaned up a few compile warnings.
If #include "debug.h" is present, removed #include <stdio.h>.
debug.h includes stdio.h, so it is not necessary to include both.
* [graphics/*.c] [if1632/signal.c] [ipc/*.c] [scheduler/*.c]
[win32/*.c] [windows/*.c]
Final patch to convert fprintf statements to new debugging interface.
Some fprintfs are still left, especially in the debugger/ directory.
However, IMHO, it's not worth the effort to change the rest.
Fri May 22 21:58:35 1998 Morten Welinder <terra@diku.dk>
* [windows/keyboard.c]
Correct handling of keys "`-=[]\;',./".
Fri May 22 12:06:00 1998 Per Lindström <pelinstr@algonet.se>
* [include/windows.h] [relay32/kernel32.spec] [win32/console.c]
Added stub for ReadConsoleOutputCharacter32A.
Thu May 21 16:45:48 1998 Pascal Cuoq <pcuoq@ens-lyon.fr>
* [ole/ole2nls.c]
Began better implementation of LCMapString32A.
Not very well tested yet, and still need improvements.
* [controls/scroll.c]
Documented functions.
Wed May 20 21:37:56 1998 Peter Hunnisett <hunnise@nortel.ca>
* [include/windows.h][misc/main.c]
Change SystemParameterInfo to support SPI_GETHIGHCONTRAST. Also
include some missing SPI_ definitions.
* [include/dsound.h][multimedia/dsound.c][relay32/dplayx.spec]
Added stubs for DirectPlayLobbyCreate[AW]. Not sure if these
should go into a new files dplayx.c? Anyone care?
* [include/winnls.h]
Added two missing flags for the CompareString32 functions.
1998-06-01 12:44:35 +02:00
|
|
|
/******************************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* DirectInputCreateA (DINPUT.@)
|
Release 980601
Sun May 31 13:40:13 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/signal.c]
Added display of exception name.
* [loader/task.c]
Yet another attempt at fixing SwitchStackTo/SwitchStackBack.
* [memory/selector.c] [relay32/builtin32.c] [tools/build.c]
[win32/kernel32.c]
Generate an assembly stub for Win32 register functions to make
their names available at link time.
* [programs/*/Makefile.in]
Added hacks to support old resource compiler.
Fri May 29 16:27:14 1998 Marcus Meissner <marcus@jet.franken.de>
* [tools/testrun]
Merge of my testscripts at home into one single perl program
(tested with perl5). Works only on Linux due to 'ps' and 'ipcs'
magic.
* [controls/menu.c]
Added some DefaultMenuItem stubs.
* [debugger/stabs.c]
Fixed stabs loading, now supports (int,int) typeinfo format used
by gcc-2.8 and egcs-1. If it still crashes, please mail me.
* [if1632/][relay32/]
Added msvideo.dll (stubs only)
Replaced some ptr by str for stringcases
Added some new stubs (VxDCall, FindCloseNotif....)
* [misc/network.c]
Some argument fixes.
* [misc/registry.c][misc/cpu.c]
Registry initialization partially rewritten and enhanced.
* [scheduler/*.c]
Some additions so we don't do kill(0,SIGUSR1) (kill processgroup
instead of targeted thread)
Added SetThreadContext.
Thu May 28 23:59:59 1998 Bertho Stultiens <bertho@akhphd.au.dk>
* [tools/wrc/*]
New resource compiler version 1.0.0 (28-May-1998)
* [Make.rules.in] [Makefile.in]
Changed and added rc rules to point to tools/wrc/wrc.
* [configure.in] [include/config.h.in]
Added check for function 'stricmp'.
* [include/resource.h]
Commented out the old resource structure to catch references.
It also includes wrc_rsc.h.
* [include/wrc_rsc.h]
New file. Definitions for the resources generated with wrc.
* [include/windows.h]
Added #ifdef RC_INVOKED to exclude stdarg.h.
Added SS_NOTIFY flag.
* [include/winnls.h]
Added SUBLANG_* definitions and corrected some defaults.
* [loader/libres.c]
Changed the sysres load functions to support wrc generated
resources.
* [resource/sysres_*.rc]
Added #include <windows.h>
* [resource/sysres.c]
Changed declarations to match wrc's output
* [resource/Makefile.in]
Changed rules to work with wrc.
* [tools/makedep.c]
Changed generation of .rc file dependencies to .s target.
Thu May 28 22:28:39 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [files/file.c][include/windows.c][relay32/kernel32.spec]
Implemented GetFileAttributesEx32A/W.
* [misc/imagelist.h][include/commctrl.h][relay32/comctl32.spec]
Added ImageList_Read and ImageList_Write stubs.
Added ImageList_AddIcon function.
Added ImageList_LoadImage. It is the same as ImageList_LoadImage32A.
* [controls/header.c]
Fixed bitmap drawing bug.
Added full bitmap support.
* [include/commctrl.h]
Added missing header macros.
* [controls/toolbar.c][include/toolbar.h][include/commctrl.h]
[controls/commctrl.c] [relay32/comctl32.spec]
First implementation of toolbar control.
Implemented CreateToolbar, CreateToolbarEx and CreateMappedBitmap.
* [controls/progress.c][controls/status.c]
Some code cleanup.
* [controls/commctrl.c][include/commctrl.h][relay32/comctl32.spec]
Removed CreateStatusWindow16 and DrawStatusText16.
CreateStatusWindow is the same as CreateStatusWindow32A.
DrawStatusText is the same as DrawStatusText32A.
Thu May 28 16:01:28 1998 Matthew J. Francis <asbel@dial.pipex.com>
* [objects/bitmap.c] [objects/bitmap.h] [objects/oembitmap.c]
[objects/dc.c] [graphics/x11drv/bitblt.c]
Added partial implementation of CreateDIBSection, with great thanks
to Ulrich Weigand <weigand@informatik.uni-erlangen.de> for
contributing the bulk of the patch.
Wed May 27 19:04:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [win32/kernel32.c] [if1632/thunk.c] [include/flatthunk.h]
ThunkConnect16 and related functions moved to emulator.
* [loader/ne/segment.c]
Call DllEntryPoint with correct arguments.
* [relay32/builtin32.c]
Bugfix: Relay debugging did not work for multiple processes.
* [controls/menu.c]
Bugfix: dwItemData was not set for MF_OWNERDRAW menus.
* [if1632/relay.c] [relay32/relay386.c]
Relay messages converted to use DPRINTF.
* [controls/desktop.c] [relay32/user32.spec]
Implemented PaintDesktop.
* [files/profile.c] [if1632/kernel.spec] [misc/network.c]
[misc/printdrv.c] [relay32/winspool.spec]
[win32/ordinals.c] [relay32/kernel32.spec]
Some stubs added.
* [relay32/mpr.spec]
All ordinals were off by one.
Tue May 26 13:32:57 1998 Bill Hawes <whawes@star.net>
* [misc/lstr.c] [include/casemap.h] [tools/unimap.pl]
Added Unicode case conversion routines towupper/towlower,
with mapping tables casemap.h created by tools/unimap.pl.
* [misc/ntdll.c] [include/winnls.h] [relay32/ntdll.spec]
[relay32/advapi.spec]
Minimal implementation of IsTextUnicode, just enough to get
NT4 notepad to open ascii/unicode files.
* [Make.rules.in] [resources/sysres_En.rc]
Added include file dlgs.h for building resource files, so that
resources can refer to defined values (e.g. pshHelp).
* [misc/crtdll.c] [relay32/crtdll.spec]
Use towupper/towlower for 32W case conversions.
* [memory/string.c]
Use towupper for 32W case conversions.
* [ole/ole2nls.c]
Use towupper for 32W case conversions; fix mem leak; minor cleanup
* [controls/edit.c]
Added soft break flag to edit state. Print unknown action values
for WM_VSCROLL (action 190 occurs when running NT4 notepad.)
Mon May 25 22:42:40 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [files/file.c]
Care for a pathological case in SetFilePointer.
* [graphics/x11drv/xfont.c]
Handle longer Font names in LFD_ComposeLFD and try to catch errors.
* [loader/pe_image.c]
Unload Dummymodule when PE_LoadLibraryEx32A fails with
PE_LoadImage (makes Encarta 98 installer proceed).
* [misc/registry.c]
Move a check for a special case in RegCreateKeyEx32W after the
check for existence.
Tue May 25 20:18:26 1998 Matthew Becker <mbecker@glasscity.net>
* [misc/ntdll.c]
Added some stubs, just guessing at the size of their param lists.
* [misc/registry.c]
Added stubs for RegUnLoadKey, RegSetKeySecurity, RegSaveKey,
RegRestoreKey, and RegReplaceKey
* [programs/regtest/regtest.c]
Updated registry testing program.
Sun May 24 18:11:40 1998 Alex Priem <alexp@sci.kun.nl>
* [file/profile.c]
Added flag 'return_values' to PROFILE_GetSection.
Sun May 24 13:41:10 1998 James Juran <jrj120@psu.edu>
* [misc/shell.c] [files/directory.c]
Documentation/debugging info additions.
* [*/*.c] [include/*.h]
Moved many extern function definitions to appropriate header files.
Cleaned up a few compile warnings.
If #include "debug.h" is present, removed #include <stdio.h>.
debug.h includes stdio.h, so it is not necessary to include both.
* [graphics/*.c] [if1632/signal.c] [ipc/*.c] [scheduler/*.c]
[win32/*.c] [windows/*.c]
Final patch to convert fprintf statements to new debugging interface.
Some fprintfs are still left, especially in the debugger/ directory.
However, IMHO, it's not worth the effort to change the rest.
Fri May 22 21:58:35 1998 Morten Welinder <terra@diku.dk>
* [windows/keyboard.c]
Correct handling of keys "`-=[]\;',./".
Fri May 22 12:06:00 1998 Per Lindström <pelinstr@algonet.se>
* [include/windows.h] [relay32/kernel32.spec] [win32/console.c]
Added stub for ReadConsoleOutputCharacter32A.
Thu May 21 16:45:48 1998 Pascal Cuoq <pcuoq@ens-lyon.fr>
* [ole/ole2nls.c]
Began better implementation of LCMapString32A.
Not very well tested yet, and still need improvements.
* [controls/scroll.c]
Documented functions.
Wed May 20 21:37:56 1998 Peter Hunnisett <hunnise@nortel.ca>
* [include/windows.h][misc/main.c]
Change SystemParameterInfo to support SPI_GETHIGHCONTRAST. Also
include some missing SPI_ definitions.
* [include/dsound.h][multimedia/dsound.c][relay32/dplayx.spec]
Added stubs for DirectPlayLobbyCreate[AW]. Not sure if these
should go into a new files dplayx.c? Anyone care?
* [include/winnls.h]
Added two missing flags for the CompareString32 functions.
1998-06-01 12:44:35 +02:00
|
|
|
*/
|
2022-02-08 09:55:37 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateA( HINSTANCE hinst, DWORD version, IDirectInputA **out, IUnknown *outer )
|
1999-02-22 10:52:54 +01:00
|
|
|
{
|
2022-02-08 09:55:37 +01:00
|
|
|
return DirectInputCreateEx( hinst, version, &IID_IDirectInput7A, (void **)out, outer );
|
2003-06-16 22:22:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* DirectInputCreateW (DINPUT.@)
|
|
|
|
*/
|
2022-02-08 09:55:37 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateW( HINSTANCE hinst, DWORD version, IDirectInputW **out, IUnknown *outer )
|
2003-06-16 22:22:13 +02:00
|
|
|
{
|
2022-02-08 09:55:37 +01:00
|
|
|
return DirectInputCreateEx( hinst, version, &IID_IDirectInput7W, (void **)out, outer );
|
2004-06-04 20:06:37 +02:00
|
|
|
}
|
2002-06-14 02:39:44 +02:00
|
|
|
|
2022-02-08 09:55:37 +01:00
|
|
|
static DWORD diactionformat_priorityW( DIACTIONFORMATW *action_format, DWORD genre )
|
2011-07-21 20:36:00 +02:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
DWORD priorityFlags = 0;
|
|
|
|
|
|
|
|
/* If there's at least one action for the device it's priority 1 */
|
2022-02-08 09:55:37 +01:00
|
|
|
for (i = 0; i < action_format->dwNumActions; i++)
|
|
|
|
if ((action_format->rgoAction[i].dwSemantic & genre) == genre)
|
2011-07-21 20:36:00 +02:00
|
|
|
priorityFlags |= DIEDBS_MAPPEDPRI1;
|
|
|
|
|
|
|
|
return priorityFlags;
|
|
|
|
}
|
|
|
|
|
2015-11-22 17:51:24 +01:00
|
|
|
#if defined __i386__ && defined _MSC_VER
|
|
|
|
__declspec(naked) BOOL enum_callback_wrapper(void *callback, const void *instance, void *ref)
|
|
|
|
{
|
|
|
|
__asm
|
|
|
|
{
|
|
|
|
push ebp
|
|
|
|
mov ebp, esp
|
|
|
|
push [ebp+16]
|
|
|
|
push [ebp+12]
|
|
|
|
call [ebp+8]
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#elif defined __i386__ && defined __GNUC__
|
2015-11-16 08:25:45 +01:00
|
|
|
extern BOOL enum_callback_wrapper(void *callback, const void *instance, void *ref);
|
|
|
|
__ASM_GLOBAL_FUNC( enum_callback_wrapper,
|
|
|
|
"pushl %ebp\n\t"
|
|
|
|
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
|
|
|
|
__ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
|
|
|
|
"movl %esp,%ebp\n\t"
|
|
|
|
__ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
|
|
|
|
"pushl 16(%ebp)\n\t"
|
|
|
|
"pushl 12(%ebp)\n\t"
|
|
|
|
"call *8(%ebp)\n\t"
|
|
|
|
"leave\n\t"
|
|
|
|
__ASM_CFI(".cfi_def_cfa %esp,4\n\t")
|
|
|
|
__ASM_CFI(".cfi_same_value %ebp\n\t")
|
|
|
|
"ret" )
|
|
|
|
#else
|
|
|
|
#define enum_callback_wrapper(callback, instance, ref) (callback)((instance), (ref))
|
|
|
|
#endif
|
|
|
|
|
2003-06-16 22:22:13 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* IDirectInputW_EnumDevices
|
|
|
|
*/
|
2022-02-07 09:23:28 +01:00
|
|
|
static HRESULT WINAPI dinput7_EnumDevices( IDirectInput7W *iface, DWORD type, LPDIENUMDEVICESCALLBACKW callback,
|
|
|
|
void *context, DWORD flags )
|
2003-06-16 22:22:13 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput7W( iface );
|
2021-10-26 09:17:26 +02:00
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "iface %p, type %#lx, callback %p, context %p, flags %#lx.\n", iface, type, callback, context, flags );
|
2021-10-26 09:17:26 +02:00
|
|
|
|
|
|
|
if (!callback) return DIERR_INVALIDPARAM;
|
|
|
|
|
2021-11-16 08:23:39 +01:00
|
|
|
if (type > DIDEVTYPE_JOYSTICK) return DIERR_INVALIDPARAM;
|
|
|
|
if (flags & ~(DIEDFL_ATTACHEDONLY | DIEDFL_FORCEFEEDBACK | DIEDFL_INCLUDEALIASES | DIEDFL_INCLUDEPHANTOMS))
|
2021-10-26 09:17:26 +02:00
|
|
|
return DIERR_INVALIDPARAM;
|
2021-10-26 09:17:27 +02:00
|
|
|
|
2021-11-16 08:23:39 +01:00
|
|
|
return IDirectInput8_EnumDevices( &impl->IDirectInput8W_iface, type, callback, context, flags );
|
2002-06-14 02:39:44 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static ULONG WINAPI dinput7_AddRef( IDirectInput7W *iface )
|
1999-02-22 10:52:54 +01:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput7W( iface );
|
2022-02-07 09:23:28 +01:00
|
|
|
ULONG ref = InterlockedIncrement( &impl->ref );
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "iface %p increasing refcount to %lu.\n", iface, ref );
|
2007-07-12 06:51:32 +02:00
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static ULONG WINAPI dinput7_Release( IDirectInput7W *iface )
|
1999-02-22 10:52:54 +01:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput7W( iface );
|
2022-02-07 09:23:28 +01:00
|
|
|
ULONG ref = InterlockedDecrement( &impl->ref );
|
2007-07-12 06:51:32 +02:00
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref );
|
2007-07-07 07:36:09 +02:00
|
|
|
|
2011-07-05 14:19:17 +02:00
|
|
|
if (ref == 0)
|
|
|
|
{
|
2022-02-07 09:23:28 +01:00
|
|
|
uninitialize_directinput_instance( impl );
|
|
|
|
free( impl );
|
2011-07-05 14:19:17 +02:00
|
|
|
}
|
2007-07-07 07:36:09 +02:00
|
|
|
|
2011-07-05 14:19:17 +02:00
|
|
|
return ref;
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backström <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma català).
1998-02-01 19:33:27 +01:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static HRESULT WINAPI dinput7_QueryInterface( IDirectInput7W *iface, REFIID iid, void **out )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput7W( iface );
|
2003-06-16 22:22:13 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out );
|
2007-07-12 06:51:32 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
if (!iid || !out) return E_POINTER;
|
2011-07-05 14:18:52 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
*out = NULL;
|
2019-04-30 01:13:50 +02:00
|
|
|
|
|
|
|
#if DIRECTINPUT_VERSION == 0x0700
|
2022-02-07 09:23:28 +01:00
|
|
|
if (IsEqualGUID( &IID_IDirectInputA, iid ) ||
|
|
|
|
IsEqualGUID( &IID_IDirectInput2A, iid ) ||
|
|
|
|
IsEqualGUID( &IID_IDirectInput7A, iid ))
|
|
|
|
*out = &impl->IDirectInput7A_iface;
|
|
|
|
else if (IsEqualGUID( &IID_IUnknown, iid ) ||
|
|
|
|
IsEqualGUID( &IID_IDirectInputW, iid ) ||
|
|
|
|
IsEqualGUID( &IID_IDirectInput2W, iid ) ||
|
|
|
|
IsEqualGUID( &IID_IDirectInput7W, iid ))
|
|
|
|
*out = &impl->IDirectInput7W_iface;
|
2007-07-12 06:51:32 +02:00
|
|
|
|
2019-04-30 01:13:50 +02:00
|
|
|
#else
|
2022-02-07 09:23:28 +01:00
|
|
|
if (IsEqualGUID( &IID_IDirectInput8A, iid ))
|
|
|
|
*out = &impl->IDirectInput8A_iface;
|
|
|
|
else if (IsEqualGUID( &IID_IUnknown, iid ) ||
|
|
|
|
IsEqualGUID( &IID_IDirectInput8W, iid ))
|
|
|
|
*out = &impl->IDirectInput8W_iface;
|
2007-07-12 06:51:32 +02:00
|
|
|
|
2019-04-30 01:13:50 +02:00
|
|
|
#endif
|
2007-07-12 06:51:32 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
if (IsEqualGUID( &IID_IDirectInputJoyConfig8, iid ))
|
|
|
|
*out = &impl->IDirectInputJoyConfig8_iface;
|
2011-11-26 18:30:07 +01:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
if (*out)
|
2019-04-30 01:13:50 +02:00
|
|
|
{
|
2022-02-07 09:23:28 +01:00
|
|
|
IUnknown_AddRef( (IUnknown *)*out );
|
2011-11-26 18:30:07 +01:00
|
|
|
return DI_OK;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
WARN( "Unsupported interface: %s\n", debugstr_guid( iid ) );
|
2011-07-05 14:18:52 +02:00
|
|
|
return E_NOINTERFACE;
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
|
|
|
|
2020-08-10 11:04:15 +02:00
|
|
|
static LRESULT WINAPI di_em_win_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
struct dinput_device *impl;
|
2020-08-10 11:04:15 +02:00
|
|
|
RAWINPUT ri;
|
|
|
|
UINT size = sizeof(ri);
|
|
|
|
int rim = GET_RAWINPUT_CODE_WPARAM( wparam );
|
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "%p %d %Ix %Ix\n", hwnd, msg, wparam, lparam );
|
2020-08-10 11:04:15 +02:00
|
|
|
|
|
|
|
if (msg == WM_INPUT && (rim == RIM_INPUT || rim == RIM_INPUTSINK))
|
|
|
|
{
|
|
|
|
size = GetRawInputData( (HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER) );
|
|
|
|
if (size == (UINT)-1 || size < sizeof(RAWINPUTHEADER))
|
|
|
|
WARN( "Unable to read raw input data\n" );
|
2020-08-10 11:04:16 +02:00
|
|
|
else if (ri.header.dwType == RIM_TYPEMOUSE)
|
|
|
|
{
|
|
|
|
EnterCriticalSection( &dinput_hook_crit );
|
2021-10-27 09:40:59 +02:00
|
|
|
LIST_FOR_EACH_ENTRY( impl, &acquired_rawmouse_list, struct dinput_device, entry )
|
|
|
|
dinput_mouse_rawinput_hook( &impl->IDirectInputDevice8W_iface, wparam, lparam, &ri );
|
2020-08-10 11:04:16 +02:00
|
|
|
LeaveCriticalSection( &dinput_hook_crit );
|
|
|
|
}
|
2020-08-10 11:04:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return DefWindowProcW( hwnd, msg, wparam, lparam );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void register_di_em_win_class(void)
|
|
|
|
{
|
|
|
|
WNDCLASSEXW class;
|
|
|
|
|
|
|
|
memset(&class, 0, sizeof(class));
|
|
|
|
class.cbSize = sizeof(class);
|
|
|
|
class.lpfnWndProc = di_em_win_wndproc;
|
|
|
|
class.hInstance = DINPUT_instance;
|
2021-10-11 10:10:59 +02:00
|
|
|
class.lpszClassName = L"DIEmWin";
|
2020-08-10 11:04:15 +02:00
|
|
|
|
|
|
|
if (!RegisterClassExW( &class ) && GetLastError() != ERROR_CLASS_ALREADY_EXISTS)
|
|
|
|
WARN( "Unable to register message window class\n" );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void unregister_di_em_win_class(void)
|
|
|
|
{
|
2021-10-11 10:10:59 +02:00
|
|
|
if (!UnregisterClassW( L"DIEmWin", NULL ) && GetLastError() != ERROR_CLASS_DOES_NOT_EXIST)
|
2020-08-10 11:04:15 +02:00
|
|
|
WARN( "Unable to unregister message window class\n" );
|
|
|
|
}
|
|
|
|
|
2022-02-08 09:55:36 +01:00
|
|
|
static HRESULT initialize_directinput_instance( struct dinput *impl, DWORD version )
|
2011-07-05 14:19:17 +02:00
|
|
|
{
|
2022-02-07 09:23:28 +01:00
|
|
|
if (!impl->initialized)
|
2011-07-05 14:19:17 +02:00
|
|
|
{
|
2022-02-07 09:23:28 +01:00
|
|
|
impl->dwVersion = version;
|
|
|
|
impl->evsequence = 1;
|
2011-07-05 14:19:17 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
list_init( &impl->device_players );
|
2011-07-05 14:19:17 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
impl->initialized = TRUE;
|
2011-07-05 14:19:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return DI_OK;
|
|
|
|
}
|
|
|
|
|
2022-02-08 09:55:36 +01:00
|
|
|
static void uninitialize_directinput_instance( struct dinput *impl )
|
2011-07-05 14:19:17 +02:00
|
|
|
{
|
2022-02-07 09:23:28 +01:00
|
|
|
if (impl->initialized)
|
2011-07-05 14:19:17 +02:00
|
|
|
{
|
2017-03-02 19:51:40 +01:00
|
|
|
struct DevicePlayer *device_player, *device_player2;
|
2011-07-05 14:19:17 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
LIST_FOR_EACH_ENTRY_SAFE ( device_player, device_player2, &impl->device_players, struct DevicePlayer, entry )
|
2021-10-11 10:11:00 +02:00
|
|
|
free( device_player );
|
2017-03-02 19:51:40 +01:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
impl->initialized = FALSE;
|
2011-07-05 14:19:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-05 14:18:57 +02:00
|
|
|
enum directinput_versions
|
|
|
|
{
|
|
|
|
DIRECTINPUT_VERSION_300 = 0x0300,
|
|
|
|
DIRECTINPUT_VERSION_500 = 0x0500,
|
|
|
|
DIRECTINPUT_VERSION_50A = 0x050A,
|
|
|
|
DIRECTINPUT_VERSION_5B2 = 0x05B2,
|
|
|
|
DIRECTINPUT_VERSION_602 = 0x0602,
|
|
|
|
DIRECTINPUT_VERSION_61A = 0x061A,
|
|
|
|
DIRECTINPUT_VERSION_700 = 0x0700,
|
|
|
|
};
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static HRESULT WINAPI dinput7_Initialize( IDirectInput7W *iface, HINSTANCE hinst, DWORD version )
|
2011-07-05 14:18:57 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput7W( iface );
|
2011-07-05 14:19:17 +02:00
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "iface %p, hinst %p, version %#lx.\n", iface, hinst, version );
|
2011-07-05 14:18:57 +02:00
|
|
|
|
|
|
|
if (!hinst)
|
|
|
|
return DIERR_INVALIDPARAM;
|
|
|
|
else if (version == 0)
|
|
|
|
return DIERR_NOTINITIALIZED;
|
2011-07-05 14:19:26 +02:00
|
|
|
else if (version > DIRECTINPUT_VERSION_700)
|
2011-07-05 14:18:57 +02:00
|
|
|
return DIERR_OLDDIRECTINPUTVERSION;
|
|
|
|
else if (version != DIRECTINPUT_VERSION_300 && version != DIRECTINPUT_VERSION_500 &&
|
|
|
|
version != DIRECTINPUT_VERSION_50A && version != DIRECTINPUT_VERSION_5B2 &&
|
|
|
|
version != DIRECTINPUT_VERSION_602 && version != DIRECTINPUT_VERSION_61A &&
|
|
|
|
version != DIRECTINPUT_VERSION_700 && version != DIRECTINPUT_VERSION)
|
|
|
|
return DIERR_BETADIRECTINPUTVERSION;
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
return initialize_directinput_instance( impl, version );
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static HRESULT WINAPI dinput7_GetDeviceStatus( IDirectInput7W *iface, const GUID *guid )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput7W( iface );
|
2008-05-11 21:33:17 +02:00
|
|
|
HRESULT hr;
|
2021-05-28 11:41:29 +02:00
|
|
|
IDirectInputDeviceW *device;
|
2007-07-12 06:51:32 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
TRACE( "iface %p, guid %s.\n", iface, debugstr_guid( guid ) );
|
2008-05-11 21:33:17 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
if (!guid) return E_POINTER;
|
|
|
|
if (!impl->initialized) return DIERR_NOTINITIALIZED;
|
2011-07-05 14:19:17 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
hr = IDirectInput_CreateDevice( iface, guid, &device, NULL );
|
2008-05-11 21:33:17 +02:00
|
|
|
if (hr != DI_OK) return DI_NOTATTACHED;
|
|
|
|
|
|
|
|
IUnknown_Release( device );
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2007-07-12 06:51:32 +02:00
|
|
|
return DI_OK;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static HRESULT WINAPI dinput7_RunControlPanel( IDirectInput7W *iface, HWND owner, DWORD flags )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput7W( iface );
|
2021-10-11 10:10:59 +02:00
|
|
|
WCHAR control_exe[] = {L"control.exe"};
|
2011-07-05 14:18:40 +02:00
|
|
|
STARTUPINFOW si = {0};
|
|
|
|
PROCESS_INFORMATION pi;
|
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "iface %p, owner %p, flags %#lx.\n", iface, owner, flags );
|
2011-07-05 14:18:40 +02:00
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
if (owner && !IsWindow( owner )) return E_HANDLE;
|
|
|
|
if (flags) return DIERR_INVALIDPARAM;
|
|
|
|
if (!impl->initialized) return DIERR_NOTINITIALIZED;
|
2011-07-05 14:19:17 +02:00
|
|
|
|
2021-10-11 10:10:59 +02:00
|
|
|
if (!CreateProcessW( NULL, control_exe, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi ))
|
2011-07-05 14:18:40 +02:00
|
|
|
return HRESULT_FROM_WIN32(GetLastError());
|
2007-07-12 06:51:32 +02:00
|
|
|
|
|
|
|
return DI_OK;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static HRESULT WINAPI dinput7_FindDevice( IDirectInput7W *iface, const GUID *guid, const WCHAR *name, GUID *instance_guid )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-07 09:23:28 +01:00
|
|
|
FIXME( "iface %p, guid %s, name %s, instance_guid %s stub!\n", iface, debugstr_guid( guid ),
|
|
|
|
debugstr_w(name), debugstr_guid( instance_guid ) );
|
2007-07-12 06:51:32 +02:00
|
|
|
return DI_OK;
|
2003-06-16 22:22:13 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static HRESULT WINAPI dinput7_CreateDeviceEx( IDirectInput7W *iface, const GUID *guid,
|
|
|
|
REFIID iid, void **out, IUnknown *outer )
|
2000-11-05 21:25:02 +01:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput7W( iface );
|
2021-05-31 10:23:55 +02:00
|
|
|
IDirectInputDevice8W *device;
|
|
|
|
HRESULT hr;
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
TRACE( "iface %p, guid %s, iid %s, out %p, outer %p.\n", iface, debugstr_guid( guid ),
|
2021-10-26 09:17:28 +02:00
|
|
|
debugstr_guid( iid ), out, outer );
|
2007-06-27 14:57:57 +02:00
|
|
|
|
2021-10-26 09:17:28 +02:00
|
|
|
if (!out) return E_POINTER;
|
|
|
|
*out = NULL;
|
2007-07-07 07:36:09 +02:00
|
|
|
|
2021-10-26 09:17:28 +02:00
|
|
|
if (!guid) return E_POINTER;
|
|
|
|
if (!impl->initialized) return DIERR_NOTINITIALIZED;
|
2011-07-05 14:19:17 +02:00
|
|
|
|
2021-10-26 09:17:29 +02:00
|
|
|
if (IsEqualGUID( &GUID_SysKeyboard, guid )) hr = keyboard_create_device( impl, guid, &device );
|
|
|
|
else if (IsEqualGUID( &GUID_SysMouse, guid )) hr = mouse_create_device( impl, guid, &device );
|
|
|
|
else hr = hid_joystick_create_device( impl, guid, &device );
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2021-10-26 09:17:29 +02:00
|
|
|
if (FAILED(hr)) return hr;
|
|
|
|
hr = IDirectInputDevice8_QueryInterface( device, iid, out );
|
|
|
|
IDirectInputDevice8_Release( device );
|
|
|
|
return hr;
|
2000-11-05 21:25:02 +01:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static HRESULT WINAPI dinput7_CreateDevice( IDirectInput7W *iface, const GUID *guid,
|
|
|
|
IDirectInputDeviceW **out, IUnknown *outer )
|
2007-06-27 14:57:57 +02:00
|
|
|
{
|
2022-02-07 09:23:28 +01:00
|
|
|
return IDirectInput7_CreateDeviceEx( iface, guid, &IID_IDirectInputDeviceW, (void **)out, outer );
|
2007-06-27 14:57:57 +02:00
|
|
|
}
|
|
|
|
|
2007-07-12 06:51:32 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
* DirectInput8
|
|
|
|
*/
|
2002-06-14 02:39:44 +02:00
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static ULONG WINAPI dinput8_AddRef( IDirectInput8W *iface )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( iface );
|
2022-02-07 09:23:29 +01:00
|
|
|
return IDirectInput7_AddRef( &impl->IDirectInput7W_iface );
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
2003-06-16 22:22:13 +02:00
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static HRESULT WINAPI dinput8_QueryInterface( IDirectInput8W *iface, REFIID iid, void **out )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( iface );
|
2022-02-07 09:23:29 +01:00
|
|
|
return IDirectInput7_QueryInterface( &impl->IDirectInput7W_iface, iid, out );
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static ULONG WINAPI dinput8_Release( IDirectInput8W *iface )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( iface );
|
2022-02-07 09:23:29 +01:00
|
|
|
return IDirectInput7_Release( &impl->IDirectInput7W_iface );
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static HRESULT WINAPI dinput8_CreateDevice( IDirectInput8W *iface, const GUID *guid,
|
|
|
|
IDirectInputDevice8W **out, IUnknown *outer )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( iface );
|
2022-02-07 09:23:29 +01:00
|
|
|
return IDirectInput7_CreateDeviceEx( &impl->IDirectInput7W_iface, guid,
|
|
|
|
&IID_IDirectInputDevice8W, (void **)out, outer );
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
|
|
|
|
2021-11-16 08:23:42 +01:00
|
|
|
static BOOL try_enum_device( DWORD type, LPDIENUMDEVICESCALLBACKW callback,
|
|
|
|
DIDEVICEINSTANCEW *instance, void *context, DWORD flags )
|
|
|
|
{
|
|
|
|
if (type && (instance->dwDevType & 0xff) != type) return DIENUM_CONTINUE;
|
|
|
|
if ((flags & DIEDFL_FORCEFEEDBACK) && IsEqualGUID( &instance->guidFFDriver, &GUID_NULL ))
|
|
|
|
return DIENUM_CONTINUE;
|
|
|
|
return enum_callback_wrapper( callback, instance, context );
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static HRESULT WINAPI dinput8_EnumDevices( IDirectInput8W *iface, DWORD type, LPDIENUMDEVICESCALLBACKW callback, void *context,
|
|
|
|
DWORD flags )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2021-11-16 08:23:39 +01:00
|
|
|
DIDEVICEINSTANCEW instance = {.dwSize = sizeof(DIDEVICEINSTANCEW)};
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( iface );
|
2021-11-16 08:23:42 +01:00
|
|
|
DWORD device_class = 0, device_type = 0;
|
2021-11-16 08:23:39 +01:00
|
|
|
unsigned int i = 0;
|
|
|
|
HRESULT hr;
|
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "iface %p, type %#lx, callback %p, context %p, flags %#lx.\n", iface, type, callback, context, flags );
|
2021-11-16 08:23:39 +01:00
|
|
|
|
|
|
|
if (!callback) return DIERR_INVALIDPARAM;
|
|
|
|
|
|
|
|
if ((type > DI8DEVCLASS_GAMECTRL && type < DI8DEVTYPE_DEVICE) || type > DI8DEVTYPE_SUPPLEMENTAL)
|
|
|
|
return DIERR_INVALIDPARAM;
|
|
|
|
if (flags & ~(DIEDFL_ATTACHEDONLY | DIEDFL_FORCEFEEDBACK | DIEDFL_INCLUDEALIASES |
|
|
|
|
DIEDFL_INCLUDEPHANTOMS | DIEDFL_INCLUDEHIDDEN))
|
|
|
|
return DIERR_INVALIDPARAM;
|
|
|
|
|
|
|
|
if (!impl->initialized) return DIERR_NOTINITIALIZED;
|
|
|
|
|
2021-11-16 08:23:42 +01:00
|
|
|
if (type <= DI8DEVCLASS_GAMECTRL) device_class = type;
|
|
|
|
else device_type = type;
|
|
|
|
|
|
|
|
if (device_class == DI8DEVCLASS_ALL || device_class == DI8DEVCLASS_POINTER)
|
|
|
|
{
|
|
|
|
hr = mouse_enum_device( type, flags, &instance, impl->dwVersion );
|
|
|
|
if (hr == DI_OK && try_enum_device( device_type, callback, &instance, context, flags ) == DIENUM_STOP)
|
|
|
|
return DI_OK;
|
|
|
|
}
|
2021-11-16 08:23:39 +01:00
|
|
|
|
2021-11-16 08:23:42 +01:00
|
|
|
if (device_class == DI8DEVCLASS_ALL || device_class == DI8DEVCLASS_KEYBOARD)
|
2021-11-16 08:23:39 +01:00
|
|
|
{
|
2021-11-16 08:23:42 +01:00
|
|
|
hr = keyboard_enum_device( type, flags, &instance, impl->dwVersion );
|
|
|
|
if (hr == DI_OK && try_enum_device( device_type, callback, &instance, context, flags ) == DIENUM_STOP)
|
2021-11-16 08:23:39 +01:00
|
|
|
return DI_OK;
|
2021-11-16 08:23:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (device_class == DI8DEVCLASS_ALL || device_class == DI8DEVCLASS_GAMECTRL)
|
|
|
|
{
|
|
|
|
do
|
|
|
|
{
|
|
|
|
hr = hid_joystick_enum_device( type, flags, &instance, impl->dwVersion, i++ );
|
|
|
|
if (hr == DI_OK && try_enum_device( device_type, callback, &instance, context, flags ) == DIENUM_STOP)
|
|
|
|
return DI_OK;
|
|
|
|
} while (SUCCEEDED(hr));
|
|
|
|
}
|
2021-11-16 08:23:39 +01:00
|
|
|
|
|
|
|
return DI_OK;
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static HRESULT WINAPI dinput8_GetDeviceStatus( IDirectInput8W *iface, const GUID *guid )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( iface );
|
2022-02-07 09:23:29 +01:00
|
|
|
return IDirectInput7_GetDeviceStatus( &impl->IDirectInput7W_iface, guid );
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static HRESULT WINAPI dinput8_RunControlPanel( IDirectInput8W *iface, HWND owner, DWORD flags )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( iface );
|
2022-02-07 09:23:29 +01:00
|
|
|
return IDirectInput7_RunControlPanel( &impl->IDirectInput7W_iface, owner, flags );
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static HRESULT WINAPI dinput8_Initialize( IDirectInput8W *iface, HINSTANCE hinst, DWORD version )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( iface );
|
2011-07-05 14:19:26 +02:00
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "iface %p, hinst %p, version %#lx.\n", iface, hinst, version );
|
2011-07-05 14:19:26 +02:00
|
|
|
|
|
|
|
if (!hinst)
|
|
|
|
return DIERR_INVALIDPARAM;
|
|
|
|
else if (version == 0)
|
|
|
|
return DIERR_NOTINITIALIZED;
|
|
|
|
else if (version < DIRECTINPUT_VERSION)
|
|
|
|
return DIERR_BETADIRECTINPUTVERSION;
|
|
|
|
else if (version > DIRECTINPUT_VERSION)
|
|
|
|
return DIERR_OLDDIRECTINPUTVERSION;
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
return initialize_directinput_instance( impl, version );
|
2007-07-12 06:51:32 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static HRESULT WINAPI dinput8_FindDevice( IDirectInput8W *iface, const GUID *guid, const WCHAR *name, GUID *instance_guid )
|
2007-07-12 06:51:32 +02:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( iface );
|
2022-02-07 09:23:29 +01:00
|
|
|
return IDirectInput7_FindDevice( &impl->IDirectInput7W_iface, guid, name, instance_guid );
|
2002-06-14 02:39:44 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static BOOL should_enumerate_device( const WCHAR *username, DWORD flags, struct list *device_players, const GUID *guid )
|
2017-03-02 19:51:41 +01:00
|
|
|
{
|
|
|
|
BOOL should_enumerate = TRUE;
|
|
|
|
struct DevicePlayer *device_player;
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
/* Check if user owns impl device */
|
|
|
|
if (flags & DIEDBSFL_THISUSER && username && *username)
|
2017-03-02 19:51:41 +01:00
|
|
|
{
|
|
|
|
should_enumerate = FALSE;
|
|
|
|
LIST_FOR_EACH_ENTRY(device_player, device_players, struct DevicePlayer, entry)
|
|
|
|
{
|
|
|
|
if (IsEqualGUID(&device_player->instance_guid, guid))
|
|
|
|
{
|
2021-10-11 10:10:58 +02:00
|
|
|
if (*device_player->username && !wcscmp( username, device_player->username ))
|
2017-03-02 19:51:41 +01:00
|
|
|
return TRUE; /* Device username matches */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
/* Check if impl device is not owned by anyone */
|
|
|
|
if (flags & DIEDBSFL_AVAILABLEDEVICES)
|
|
|
|
{
|
2017-03-02 19:51:41 +01:00
|
|
|
BOOL found = FALSE;
|
|
|
|
should_enumerate = FALSE;
|
|
|
|
LIST_FOR_EACH_ENTRY(device_player, device_players, struct DevicePlayer, entry)
|
|
|
|
{
|
|
|
|
if (IsEqualGUID(&device_player->instance_guid, guid))
|
|
|
|
{
|
|
|
|
if (*device_player->username)
|
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!found)
|
|
|
|
return TRUE; /* Device does not have a username */
|
|
|
|
}
|
|
|
|
|
|
|
|
return should_enumerate;
|
|
|
|
}
|
|
|
|
|
2021-11-16 08:23:41 +01:00
|
|
|
struct enum_device_by_semantics_params
|
|
|
|
{
|
|
|
|
IDirectInput8W *iface;
|
|
|
|
const WCHAR *username;
|
|
|
|
DWORD flags;
|
|
|
|
|
|
|
|
DIDEVICEINSTANCEW *instances;
|
|
|
|
DWORD instance_count;
|
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL CALLBACK enum_device_by_semantics( const DIDEVICEINSTANCEW *instance, void *context )
|
|
|
|
{
|
|
|
|
struct enum_device_by_semantics_params *params = context;
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( params->iface );
|
2021-11-16 08:23:41 +01:00
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
if (should_enumerate_device( params->username, params->flags, &impl->device_players, &instance->guidInstance ))
|
2021-11-16 08:23:41 +01:00
|
|
|
{
|
|
|
|
params->instance_count++;
|
|
|
|
params->instances = realloc( params->instances, sizeof(DIDEVICEINSTANCEW) * params->instance_count );
|
|
|
|
params->instances[params->instance_count - 1] = *instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
return DIENUM_CONTINUE;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static HRESULT WINAPI dinput8_EnumDevicesBySemantics( IDirectInput8W *iface, const WCHAR *username, DIACTIONFORMATW *action_format,
|
|
|
|
LPDIENUMDEVICESBYSEMANTICSCBW callback, void *context, DWORD flags )
|
2003-06-16 22:22:13 +02:00
|
|
|
{
|
2022-02-07 09:23:29 +01:00
|
|
|
struct enum_device_by_semantics_params params = {.iface = iface, .username = username, .flags = flags};
|
|
|
|
DWORD callbackFlags, enum_flags = DIEDFL_ATTACHEDONLY | (flags & DIEDFL_FORCEFEEDBACK);
|
|
|
|
static const GUID *guids[2] = {&GUID_SysKeyboard, &GUID_SysMouse};
|
2011-07-08 20:00:40 +02:00
|
|
|
static const DWORD actionMasks[] = { DIKEYBOARD_MASK, DIMOUSE_MASK };
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInput8W( iface );
|
2011-06-28 18:54:36 +02:00
|
|
|
DIDEVICEINSTANCEW didevi;
|
2022-02-07 09:23:29 +01:00
|
|
|
IDirectInputDevice8W *lpdid;
|
2021-10-26 09:17:30 +02:00
|
|
|
unsigned int i = 0;
|
|
|
|
HRESULT hr;
|
2017-02-08 21:07:53 +01:00
|
|
|
int remain;
|
2003-06-16 22:22:13 +02:00
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
FIXME( "iface %p, username %s, action_format %p, callback %p, context %p, flags %#lx stub!\n",
|
2022-02-07 09:23:29 +01:00
|
|
|
iface, debugstr_w(username), action_format, callback, context, flags );
|
2011-06-28 18:54:36 +02:00
|
|
|
|
|
|
|
didevi.dwSize = sizeof(didevi);
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
hr = IDirectInput8_EnumDevices( &impl->IDirectInput8W_iface, DI8DEVCLASS_GAMECTRL,
|
2021-11-16 08:23:41 +01:00
|
|
|
enum_device_by_semantics, ¶ms, enum_flags );
|
|
|
|
if (FAILED(hr))
|
2011-07-12 03:37:36 +02:00
|
|
|
{
|
2021-11-16 08:23:41 +01:00
|
|
|
free( params.instances );
|
|
|
|
return hr;
|
|
|
|
}
|
2011-07-12 03:37:36 +02:00
|
|
|
|
2021-11-16 08:23:41 +01:00
|
|
|
remain = params.instance_count;
|
2017-03-02 19:51:41 +01:00
|
|
|
/* Add keyboard and mouse to remaining device count */
|
2022-02-07 09:23:29 +01:00
|
|
|
if (!(flags & DIEDBSFL_FORCEFEEDBACK))
|
2017-03-02 19:51:41 +01:00
|
|
|
{
|
2018-10-14 23:56:43 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(guids); i++)
|
2017-03-02 19:51:41 +01:00
|
|
|
{
|
2022-02-07 09:23:29 +01:00
|
|
|
if (should_enumerate_device( username, flags, &impl->device_players, guids[i] )) remain++;
|
2017-03-02 19:51:41 +01:00
|
|
|
}
|
|
|
|
}
|
2017-02-08 21:07:53 +01:00
|
|
|
|
2021-11-16 08:23:41 +01:00
|
|
|
for (i = 0; i < params.instance_count; i++)
|
2017-02-08 21:07:53 +01:00
|
|
|
{
|
2022-02-07 09:23:29 +01:00
|
|
|
callbackFlags = diactionformat_priorityW( action_format, action_format->dwGenre );
|
2021-11-16 08:23:41 +01:00
|
|
|
IDirectInput_CreateDevice( iface, ¶ms.instances[i].guidInstance, &lpdid, NULL );
|
2017-02-08 21:07:53 +01:00
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
if (callback( ¶ms.instances[i], lpdid, callbackFlags, --remain, context ) == DIENUM_STOP)
|
2017-02-08 21:07:53 +01:00
|
|
|
{
|
2021-11-16 08:23:41 +01:00
|
|
|
free( params.instances );
|
2021-05-31 10:23:57 +02:00
|
|
|
IDirectInputDevice_Release(lpdid);
|
2017-02-08 21:07:53 +01:00
|
|
|
return DI_OK;
|
|
|
|
}
|
2021-05-31 10:23:57 +02:00
|
|
|
IDirectInputDevice_Release(lpdid);
|
2017-02-08 21:07:53 +01:00
|
|
|
}
|
|
|
|
|
2021-11-16 08:23:41 +01:00
|
|
|
free( params.instances );
|
2017-02-08 21:07:53 +01:00
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
if (flags & DIEDBSFL_FORCEFEEDBACK) return DI_OK;
|
2011-07-08 20:00:55 +02:00
|
|
|
|
2011-07-08 20:00:40 +02:00
|
|
|
/* Enumerate keyboard and mouse */
|
2018-10-14 23:56:43 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(guids); i++)
|
2011-07-08 20:00:40 +02:00
|
|
|
{
|
2022-02-07 09:23:29 +01:00
|
|
|
if (should_enumerate_device( username, flags, &impl->device_players, guids[i] ))
|
2017-03-02 19:51:41 +01:00
|
|
|
{
|
2022-02-07 09:23:29 +01:00
|
|
|
callbackFlags = diactionformat_priorityW( action_format, actionMasks[i] );
|
2011-06-28 18:54:36 +02:00
|
|
|
|
2017-03-02 19:51:41 +01:00
|
|
|
IDirectInput_CreateDevice(iface, guids[i], &lpdid, NULL);
|
|
|
|
IDirectInputDevice_GetDeviceInfo(lpdid, &didevi);
|
2011-06-28 18:54:36 +02:00
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
if (callback( &didevi, lpdid, callbackFlags, --remain, context ) == DIENUM_STOP)
|
2021-05-31 10:23:57 +02:00
|
|
|
{
|
|
|
|
IDirectInputDevice_Release(lpdid);
|
2017-03-02 19:51:41 +01:00
|
|
|
return DI_OK;
|
2021-05-31 10:23:57 +02:00
|
|
|
}
|
|
|
|
IDirectInputDevice_Release(lpdid);
|
2017-03-02 19:51:41 +01:00
|
|
|
}
|
2011-07-08 20:00:40 +02:00
|
|
|
}
|
2011-06-28 18:54:36 +02:00
|
|
|
|
|
|
|
return DI_OK;
|
2003-06-16 22:22:13 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static HRESULT WINAPI dinput8_ConfigureDevices( IDirectInput8W *iface, LPDICONFIGUREDEVICESCALLBACK callback,
|
|
|
|
DICONFIGUREDEVICESPARAMSW *params, DWORD flags, void *context )
|
2002-06-14 02:39:44 +02:00
|
|
|
{
|
2022-02-08 09:55:39 +01:00
|
|
|
FIXME( "iface %p, callback %p, params %p, flags %#lx, context %p stub!\n", iface, callback,
|
2022-02-07 09:23:29 +01:00
|
|
|
params, flags, context );
|
2011-08-22 03:26:40 +02:00
|
|
|
|
2011-09-01 20:34:35 +02:00
|
|
|
/* Call helper function in config.c to do the real work */
|
2022-02-07 09:23:29 +01:00
|
|
|
return _configure_devices( iface, callback, params, flags, context );
|
2003-06-16 22:22:13 +02:00
|
|
|
}
|
|
|
|
|
2011-11-26 18:30:07 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectInputJoyConfig8 interface
|
|
|
|
*/
|
|
|
|
|
2022-02-08 09:55:36 +01:00
|
|
|
static inline struct dinput *impl_from_IDirectInputJoyConfig8( IDirectInputJoyConfig8 *iface )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
return CONTAINING_RECORD( iface, struct dinput, IDirectInputJoyConfig8_iface );
|
2011-11-26 18:30:07 +01:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_QueryInterface( IDirectInputJoyConfig8 *iface, REFIID iid, void **out )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInputJoyConfig8( iface );
|
2022-02-07 09:23:27 +01:00
|
|
|
return IDirectInput7_QueryInterface( &impl->IDirectInput7W_iface, iid, out );
|
2011-11-26 18:30:07 +01:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static ULONG WINAPI joy_config_AddRef( IDirectInputJoyConfig8 *iface )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInputJoyConfig8( iface );
|
2022-02-07 09:23:27 +01:00
|
|
|
return IDirectInput7_AddRef( &impl->IDirectInput7W_iface );
|
2011-11-26 18:30:07 +01:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static ULONG WINAPI joy_config_Release( IDirectInputJoyConfig8 *iface )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInputJoyConfig8( iface );
|
2022-02-07 09:23:27 +01:00
|
|
|
return IDirectInput7_Release( &impl->IDirectInput7W_iface );
|
2011-11-26 18:30:07 +01:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_Acquire( IDirectInputJoyConfig8 *iface )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-07 09:23:27 +01:00
|
|
|
FIXME( "iface %p stub!\n", iface );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_Unacquire( IDirectInputJoyConfig8 *iface )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-07 09:23:27 +01:00
|
|
|
FIXME( "iface %p stub!\n", iface );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_SetCooperativeLevel( IDirectInputJoyConfig8 *iface, HWND hwnd, DWORD flags )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:39 +01:00
|
|
|
FIXME( "iface %p, hwnd %p, flags %#lx stub!\n", iface, hwnd, flags );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_SendNotify( IDirectInputJoyConfig8 *iface )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-07 09:23:27 +01:00
|
|
|
FIXME( "iface %p stub!\n", iface );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_EnumTypes( IDirectInputJoyConfig8 *iface, LPDIJOYTYPECALLBACK callback, void *context )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-07 09:23:27 +01:00
|
|
|
FIXME( "iface %p, callback %p, context %p stub!\n", iface, callback, context );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_GetTypeInfo( IDirectInputJoyConfig8 *iface, const WCHAR *name,
|
|
|
|
DIJOYTYPEINFO *info, DWORD flags )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:39 +01:00
|
|
|
FIXME( "iface %p, name %s, info %p, flags %#lx stub!\n", iface, debugstr_w(name), info, flags );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_SetTypeInfo( IDirectInputJoyConfig8 *iface, const WCHAR *name,
|
|
|
|
const DIJOYTYPEINFO *info, DWORD flags, WCHAR *new_name )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:39 +01:00
|
|
|
FIXME( "iface %p, name %s, info %p, flags %#lx, new_name %s stub!\n",
|
2022-02-07 09:23:27 +01:00
|
|
|
iface, debugstr_w(name), info, flags, debugstr_w(new_name) );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_DeleteType( IDirectInputJoyConfig8 *iface, const WCHAR *name )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-07 09:23:27 +01:00
|
|
|
FIXME( "iface %p, name %s stub!\n", iface, debugstr_w(name) );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2021-11-16 08:23:40 +01:00
|
|
|
struct find_device_from_index_params
|
|
|
|
{
|
|
|
|
UINT index;
|
|
|
|
DIDEVICEINSTANCEW instance;
|
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL CALLBACK find_device_from_index( const DIDEVICEINSTANCEW *instance, void *context )
|
|
|
|
{
|
|
|
|
struct find_device_from_index_params *params = context;
|
|
|
|
params->instance = *instance;
|
|
|
|
if (!params->index--) return DIENUM_STOP;
|
|
|
|
return DIENUM_CONTINUE;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_GetConfig( IDirectInputJoyConfig8 *iface, UINT id, DIJOYCONFIG *info, DWORD flags )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:36 +01:00
|
|
|
struct dinput *impl = impl_from_IDirectInputJoyConfig8( iface );
|
2021-11-16 08:23:40 +01:00
|
|
|
struct find_device_from_index_params params = {.index = id};
|
2021-10-26 09:17:31 +02:00
|
|
|
HRESULT hr;
|
2012-08-14 01:36:56 +02:00
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
FIXME( "iface %p, id %u, info %p, flags %#lx stub!\n", iface, id, info, flags );
|
2012-08-14 01:36:56 +02:00
|
|
|
|
|
|
|
#define X(x) if (flags & x) FIXME("\tflags |= "#x"\n");
|
|
|
|
X(DIJC_GUIDINSTANCE)
|
|
|
|
X(DIJC_REGHWCONFIGTYPE)
|
|
|
|
X(DIJC_GAIN)
|
|
|
|
X(DIJC_CALLOUT)
|
|
|
|
#undef X
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
hr = IDirectInput8_EnumDevices( &impl->IDirectInput8W_iface, DI8DEVCLASS_GAMECTRL,
|
|
|
|
find_device_from_index, ¶ms, 0 );
|
2021-11-16 08:23:40 +01:00
|
|
|
if (FAILED(hr)) return hr;
|
|
|
|
if (params.index != ~0) return DIERR_NOMOREITEMS;
|
|
|
|
if (flags & DIJC_GUIDINSTANCE) info->guidInstance = params.instance.guidInstance;
|
|
|
|
return DI_OK;
|
2011-11-26 18:30:07 +01:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_SetConfig( IDirectInputJoyConfig8 *iface, UINT id, const DIJOYCONFIG *info, DWORD flags )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:39 +01:00
|
|
|
FIXME( "iface %p, id %u, info %p, flags %#lx stub!\n", iface, id, info, flags );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_DeleteConfig( IDirectInputJoyConfig8 *iface, UINT id )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-07 09:23:27 +01:00
|
|
|
FIXME( "iface %p, id %u stub!\n", iface, id );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_GetUserValues( IDirectInputJoyConfig8 *iface, DIJOYUSERVALUES *info, DWORD flags )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:39 +01:00
|
|
|
FIXME( "iface %p, info %p, flags %#lx stub!\n", iface, info, flags );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_SetUserValues( IDirectInputJoyConfig8 *iface, const DIJOYUSERVALUES *info, DWORD flags )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:39 +01:00
|
|
|
FIXME( "iface %p, info %p, flags %#lx stub!\n", iface, info, flags );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_AddNewHardware( IDirectInputJoyConfig8 *iface, HWND hwnd, const GUID *guid )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-07 09:23:27 +01:00
|
|
|
FIXME( "iface %p, hwnd %p, guid %s stub!\n", iface, hwnd, debugstr_guid( guid ) );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_OpenTypeKey( IDirectInputJoyConfig8 *iface, const WCHAR *name, DWORD security, HKEY *key )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-08 09:55:39 +01:00
|
|
|
FIXME( "iface %p, name %s, security %lu, key %p stub!\n", iface, debugstr_w(name), security, key );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static HRESULT WINAPI joy_config_OpenAppStatusKey( IDirectInputJoyConfig8 *iface, HKEY *key )
|
2011-11-26 18:30:07 +01:00
|
|
|
{
|
2022-02-07 09:23:27 +01:00
|
|
|
FIXME( "iface %p, key %p stub!\n", iface, key );
|
2011-11-26 18:30:07 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:28 +01:00
|
|
|
static const IDirectInput7WVtbl dinput7_vtbl =
|
|
|
|
{
|
|
|
|
dinput7_QueryInterface,
|
|
|
|
dinput7_AddRef,
|
|
|
|
dinput7_Release,
|
|
|
|
dinput7_CreateDevice,
|
|
|
|
dinput7_EnumDevices,
|
|
|
|
dinput7_GetDeviceStatus,
|
|
|
|
dinput7_RunControlPanel,
|
|
|
|
dinput7_Initialize,
|
|
|
|
dinput7_FindDevice,
|
|
|
|
dinput7_CreateDeviceEx,
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backström <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma català).
1998-02-01 19:33:27 +01:00
|
|
|
};
|
1998-12-10 10:08:48 +01:00
|
|
|
|
2022-02-07 09:23:29 +01:00
|
|
|
static const IDirectInput8WVtbl dinput8_vtbl =
|
|
|
|
{
|
|
|
|
dinput8_QueryInterface,
|
|
|
|
dinput8_AddRef,
|
|
|
|
dinput8_Release,
|
|
|
|
dinput8_CreateDevice,
|
|
|
|
dinput8_EnumDevices,
|
|
|
|
dinput8_GetDeviceStatus,
|
|
|
|
dinput8_RunControlPanel,
|
|
|
|
dinput8_Initialize,
|
|
|
|
dinput8_FindDevice,
|
|
|
|
dinput8_EnumDevicesBySemantics,
|
|
|
|
dinput8_ConfigureDevices,
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backström <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma català).
1998-02-01 19:33:27 +01:00
|
|
|
};
|
2000-04-24 20:03:54 +02:00
|
|
|
|
2022-02-07 09:23:27 +01:00
|
|
|
static const IDirectInputJoyConfig8Vtbl joy_config_vtbl =
|
|
|
|
{
|
|
|
|
joy_config_QueryInterface,
|
|
|
|
joy_config_AddRef,
|
|
|
|
joy_config_Release,
|
|
|
|
joy_config_Acquire,
|
|
|
|
joy_config_Unacquire,
|
|
|
|
joy_config_SetCooperativeLevel,
|
|
|
|
joy_config_SendNotify,
|
|
|
|
joy_config_EnumTypes,
|
|
|
|
joy_config_GetTypeInfo,
|
|
|
|
joy_config_SetTypeInfo,
|
|
|
|
joy_config_DeleteType,
|
|
|
|
joy_config_GetConfig,
|
|
|
|
joy_config_SetConfig,
|
|
|
|
joy_config_DeleteConfig,
|
|
|
|
joy_config_GetUserValues,
|
|
|
|
joy_config_SetUserValues,
|
|
|
|
joy_config_AddNewHardware,
|
|
|
|
joy_config_OpenTypeKey,
|
|
|
|
joy_config_OpenAppStatusKey,
|
2011-11-26 18:30:07 +01:00
|
|
|
};
|
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
struct class_factory
|
2003-04-30 00:43:48 +02:00
|
|
|
{
|
2010-12-05 15:15:18 +01:00
|
|
|
IClassFactory IClassFactory_iface;
|
2022-02-07 09:23:26 +01:00
|
|
|
};
|
2003-04-30 00:43:48 +02:00
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
static inline struct class_factory *impl_from_IClassFactory( IClassFactory *iface )
|
2010-12-05 15:15:18 +01:00
|
|
|
{
|
2022-02-07 09:23:26 +01:00
|
|
|
return CONTAINING_RECORD( iface, struct class_factory, IClassFactory_iface );
|
2010-12-05 15:15:18 +01:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
static HRESULT WINAPI class_factory_QueryInterface( IClassFactory *iface, REFIID iid, void **out )
|
|
|
|
{
|
|
|
|
struct class_factory *impl = impl_from_IClassFactory(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
|
2003-04-30 00:43:48 +02:00
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
if (IsEqualGUID(iid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(iid, &IID_IClassFactory))
|
|
|
|
*out = &impl->IClassFactory_iface;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*out = NULL;
|
|
|
|
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown *)*out);
|
|
|
|
return S_OK;
|
2003-04-30 00:43:48 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
static ULONG WINAPI class_factory_AddRef( IClassFactory *iface )
|
|
|
|
{
|
|
|
|
return 2;
|
2003-04-30 00:43:48 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
static ULONG WINAPI class_factory_Release( IClassFactory *iface )
|
|
|
|
{
|
|
|
|
return 1;
|
2003-04-30 00:43:48 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
static HRESULT WINAPI class_factory_CreateInstance( IClassFactory *iface, IUnknown *outer, REFIID iid, void **out )
|
|
|
|
{
|
|
|
|
IUnknown *unknown;
|
|
|
|
HRESULT hr;
|
2003-04-30 00:43:48 +02:00
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
TRACE( "iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid( iid ), out );
|
|
|
|
|
|
|
|
if (outer) return CLASS_E_NOAGGREGATION;
|
2003-04-30 00:43:48 +02:00
|
|
|
|
2022-02-08 09:55:38 +01:00
|
|
|
if (FAILED(hr = dinput_create( &unknown ))) return hr;
|
2022-02-07 09:23:26 +01:00
|
|
|
hr = IUnknown_QueryInterface( unknown, iid, out );
|
|
|
|
IUnknown_Release( unknown );
|
|
|
|
|
|
|
|
return hr;
|
2003-04-30 00:43:48 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
static HRESULT WINAPI class_factory_LockServer( IClassFactory *iface, BOOL lock )
|
|
|
|
{
|
|
|
|
FIXME( "iface %p, lock %d stub!\n", iface, lock );
|
|
|
|
return S_OK;
|
2003-04-30 00:43:48 +02:00
|
|
|
}
|
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
static const IClassFactoryVtbl class_factory_vtbl =
|
|
|
|
{
|
|
|
|
class_factory_QueryInterface,
|
|
|
|
class_factory_AddRef,
|
|
|
|
class_factory_Release,
|
|
|
|
class_factory_CreateInstance,
|
|
|
|
class_factory_LockServer,
|
2003-04-30 00:43:48 +02:00
|
|
|
};
|
2022-02-07 09:23:26 +01:00
|
|
|
|
|
|
|
static struct class_factory class_factory = {{&class_factory_vtbl}};
|
2003-04-30 00:43:48 +02:00
|
|
|
|
2000-04-24 20:03:54 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* DllGetClassObject (DINPUT.@)
|
|
|
|
*/
|
2022-02-07 09:23:26 +01:00
|
|
|
HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **out )
|
2000-04-24 20:03:54 +02:00
|
|
|
{
|
2022-02-07 09:23:26 +01:00
|
|
|
TRACE( "clsid %s, iid %s, out %p.\n", debugstr_guid( clsid ), debugstr_guid( iid ), out );
|
|
|
|
|
|
|
|
#if DIRECTINPUT_VERSION == 0x0700
|
|
|
|
if (IsEqualCLSID( &CLSID_DirectInput, clsid ))
|
|
|
|
return IClassFactory_QueryInterface( &class_factory.IClassFactory_iface, iid, out );
|
|
|
|
#else
|
|
|
|
if (IsEqualCLSID( &CLSID_DirectInput8, clsid ))
|
|
|
|
return IClassFactory_QueryInterface( &class_factory.IClassFactory_iface, iid, out );
|
|
|
|
#endif
|
2000-04-24 20:03:54 +02:00
|
|
|
|
2022-02-07 09:23:26 +01:00
|
|
|
WARN( "%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid( clsid ) );
|
2000-04-24 20:03:54 +02:00
|
|
|
return CLASS_E_CLASSNOTAVAILABLE;
|
|
|
|
}
|
2006-09-11 00:47:39 +02:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* DInput hook thread
|
|
|
|
*/
|
|
|
|
|
2007-07-07 07:36:30 +02:00
|
|
|
static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam )
|
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
struct dinput_device *impl;
|
2009-02-01 21:11:46 +01:00
|
|
|
int skip = 0;
|
2007-07-07 07:36:30 +02:00
|
|
|
|
|
|
|
if (code != HC_ACTION) return CallNextHookEx( 0, code, wparam, lparam );
|
|
|
|
|
|
|
|
EnterCriticalSection( &dinput_hook_crit );
|
2021-10-27 09:40:59 +02:00
|
|
|
LIST_FOR_EACH_ENTRY( impl, &acquired_mouse_list, struct dinput_device, entry )
|
2007-07-07 07:36:30 +02:00
|
|
|
{
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "calling dinput_mouse_hook (%p %Ix %Ix)\n", impl, wparam, lparam );
|
2021-10-27 09:40:59 +02:00
|
|
|
skip |= dinput_mouse_hook( &impl->IDirectInputDevice8W_iface, wparam, lparam );
|
2020-06-08 09:47:09 +02:00
|
|
|
}
|
2021-10-27 09:40:59 +02:00
|
|
|
LIST_FOR_EACH_ENTRY( impl, &acquired_keyboard_list, struct dinput_device, entry )
|
2020-06-08 09:47:09 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
if (impl->use_raw_input) continue;
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "calling dinput_keyboard_hook (%p %Ix %Ix)\n", impl, wparam, lparam );
|
2021-10-27 09:40:59 +02:00
|
|
|
skip |= dinput_keyboard_hook( &impl->IDirectInputDevice8W_iface, wparam, lparam );
|
2007-07-07 07:36:30 +02:00
|
|
|
}
|
|
|
|
LeaveCriticalSection( &dinput_hook_crit );
|
|
|
|
|
2009-02-01 21:11:46 +01:00
|
|
|
return skip ? 1 : CallNextHookEx( 0, code, wparam, lparam );
|
2007-07-07 07:36:30 +02:00
|
|
|
}
|
|
|
|
|
2007-07-15 18:40:00 +02:00
|
|
|
static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam )
|
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
struct dinput_device *impl, *next;
|
2007-07-15 18:40:00 +02:00
|
|
|
CWPSTRUCT *msg = (CWPSTRUCT *)lparam;
|
|
|
|
HWND foreground;
|
|
|
|
|
2007-07-23 06:17:09 +02:00
|
|
|
if (code != HC_ACTION || (msg->message != WM_KILLFOCUS &&
|
|
|
|
msg->message != WM_ACTIVATEAPP && msg->message != WM_ACTIVATE))
|
2007-07-15 18:40:00 +02:00
|
|
|
return CallNextHookEx( 0, code, wparam, lparam );
|
|
|
|
|
|
|
|
foreground = GetForegroundWindow();
|
|
|
|
|
|
|
|
EnterCriticalSection( &dinput_hook_crit );
|
2021-10-27 09:40:59 +02:00
|
|
|
LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_device_list, struct dinput_device, entry )
|
2007-07-15 18:40:00 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
if (msg->hwnd == impl->win && msg->hwnd != foreground)
|
2007-07-15 18:40:00 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
TRACE( "%p window is not foreground - unacquiring %p\n", impl->win, impl );
|
|
|
|
dinput_device_internal_unacquire( &impl->IDirectInputDevice8W_iface );
|
2007-07-15 18:40:00 +02:00
|
|
|
}
|
|
|
|
}
|
2021-10-27 09:40:59 +02:00
|
|
|
LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_mouse_list, struct dinput_device, entry )
|
2020-06-08 09:47:09 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
if (msg->hwnd == impl->win && msg->hwnd != foreground)
|
2020-06-08 09:47:09 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
TRACE( "%p window is not foreground - unacquiring %p\n", impl->win, impl );
|
|
|
|
dinput_device_internal_unacquire( &impl->IDirectInputDevice8W_iface );
|
2020-06-08 09:47:09 +02:00
|
|
|
}
|
|
|
|
}
|
2021-10-27 09:40:59 +02:00
|
|
|
LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_rawmouse_list, struct dinput_device, entry )
|
2020-08-10 11:04:17 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
if (msg->hwnd == impl->win && msg->hwnd != foreground)
|
2020-08-10 11:04:17 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
TRACE( "%p window is not foreground - unacquiring %p\n", impl->win, impl );
|
|
|
|
dinput_device_internal_unacquire( &impl->IDirectInputDevice8W_iface );
|
2020-08-10 11:04:17 +02:00
|
|
|
}
|
|
|
|
}
|
2021-10-27 09:40:59 +02:00
|
|
|
LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_keyboard_list, struct dinput_device, entry )
|
2020-06-08 09:47:09 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
if (msg->hwnd == impl->win && msg->hwnd != foreground)
|
2020-06-08 09:47:09 +02:00
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
TRACE( "%p window is not foreground - unacquiring %p\n", impl->win, impl );
|
|
|
|
dinput_device_internal_unacquire( &impl->IDirectInputDevice8W_iface );
|
2020-06-08 09:47:09 +02:00
|
|
|
}
|
|
|
|
}
|
2007-07-15 18:40:00 +02:00
|
|
|
LeaveCriticalSection( &dinput_hook_crit );
|
|
|
|
|
|
|
|
return CallNextHookEx( 0, code, wparam, lparam );
|
|
|
|
}
|
|
|
|
|
2021-12-10 09:44:44 +01:00
|
|
|
static DWORD WINAPI dinput_thread_proc( void *params )
|
2006-09-11 00:47:39 +02:00
|
|
|
{
|
2021-12-10 09:44:44 +01:00
|
|
|
HANDLE events[128], start_event = params;
|
2006-09-11 00:47:39 +02:00
|
|
|
static HHOOK kbd_hook, mouse_hook;
|
2021-10-27 09:40:59 +02:00
|
|
|
struct dinput_device *impl, *next;
|
2021-08-27 12:45:20 +02:00
|
|
|
SIZE_T events_count = 0;
|
|
|
|
HANDLE finished_event;
|
|
|
|
DWORD ret;
|
2007-07-15 18:38:05 +02:00
|
|
|
MSG msg;
|
|
|
|
|
2021-10-11 10:10:59 +02:00
|
|
|
di_em_win = CreateWindowW( L"DIEmWin", L"DIEmWin", 0, 0, 0, 0, 0, HWND_MESSAGE, 0, DINPUT_instance, NULL );
|
2020-08-10 11:04:15 +02:00
|
|
|
|
2007-07-15 18:38:05 +02:00
|
|
|
/* Force creation of the message queue */
|
|
|
|
PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE );
|
2021-12-10 09:44:44 +01:00
|
|
|
SetEvent( start_event );
|
2006-09-11 00:47:39 +02:00
|
|
|
|
2021-08-27 12:45:20 +02:00
|
|
|
while ((ret = MsgWaitForMultipleObjectsEx( events_count, events, INFINITE, QS_ALLINPUT, 0 )) <= events_count)
|
2006-09-11 00:47:39 +02:00
|
|
|
{
|
2007-07-15 18:38:05 +02:00
|
|
|
UINT kbd_cnt = 0, mice_cnt = 0;
|
|
|
|
|
2021-08-27 12:45:20 +02:00
|
|
|
if (ret < events_count)
|
2006-09-11 00:47:39 +02:00
|
|
|
{
|
2021-08-27 12:45:20 +02:00
|
|
|
EnterCriticalSection( &dinput_hook_crit );
|
2021-10-27 09:40:59 +02:00
|
|
|
LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_device_list, struct dinput_device, entry )
|
2021-08-27 12:45:20 +02:00
|
|
|
{
|
|
|
|
if (impl->read_event == events[ret])
|
|
|
|
{
|
2022-01-24 12:02:47 +01:00
|
|
|
if (FAILED( impl->vtbl->read( &impl->IDirectInputDevice8W_iface ) ))
|
|
|
|
{
|
|
|
|
dinput_device_internal_unacquire( &impl->IDirectInputDevice8W_iface );
|
|
|
|
impl->status = STATUS_UNPLUGGED;
|
|
|
|
}
|
2021-08-27 12:45:20 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LeaveCriticalSection( &dinput_hook_crit );
|
|
|
|
}
|
|
|
|
|
|
|
|
while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
|
|
|
|
{
|
|
|
|
if (msg.message != WM_USER+0x10)
|
|
|
|
{
|
|
|
|
TranslateMessage(&msg);
|
|
|
|
DispatchMessageW(&msg);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
finished_event = (HANDLE)msg.lParam;
|
2007-07-07 07:36:30 +02:00
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "Processing hook change notification wparam %#Ix, lparam %#Ix.\n", msg.wParam, msg.lParam );
|
2007-07-15 18:38:05 +02:00
|
|
|
|
2020-04-17 20:35:06 +02:00
|
|
|
if (!msg.wParam)
|
2006-09-11 00:47:39 +02:00
|
|
|
{
|
2007-07-15 18:38:05 +02:00
|
|
|
if (kbd_hook) UnhookWindowsHookEx( kbd_hook );
|
|
|
|
if (mouse_hook) UnhookWindowsHookEx( mouse_hook );
|
|
|
|
kbd_hook = mouse_hook = NULL;
|
2021-08-27 12:45:20 +02:00
|
|
|
goto done;
|
2006-09-11 00:47:39 +02:00
|
|
|
}
|
2007-07-07 07:36:30 +02:00
|
|
|
|
|
|
|
EnterCriticalSection( &dinput_hook_crit );
|
2020-06-08 09:47:09 +02:00
|
|
|
kbd_cnt = list_count( &acquired_keyboard_list );
|
|
|
|
mice_cnt = list_count( &acquired_mouse_list );
|
2007-07-07 07:36:30 +02:00
|
|
|
LeaveCriticalSection( &dinput_hook_crit );
|
|
|
|
|
|
|
|
if (kbd_cnt && !kbd_hook)
|
|
|
|
kbd_hook = SetWindowsHookExW( WH_KEYBOARD_LL, LL_hook_proc, DINPUT_instance, 0 );
|
|
|
|
else if (!kbd_cnt && kbd_hook)
|
2006-09-11 00:47:39 +02:00
|
|
|
{
|
2007-07-07 07:36:30 +02:00
|
|
|
UnhookWindowsHookEx( kbd_hook );
|
|
|
|
kbd_hook = NULL;
|
2006-09-11 00:47:39 +02:00
|
|
|
}
|
2007-07-07 07:36:30 +02:00
|
|
|
|
|
|
|
if (mice_cnt && !mouse_hook)
|
|
|
|
mouse_hook = SetWindowsHookExW( WH_MOUSE_LL, LL_hook_proc, DINPUT_instance, 0 );
|
|
|
|
else if (!mice_cnt && mouse_hook)
|
2006-09-11 00:47:39 +02:00
|
|
|
{
|
2007-07-07 07:36:30 +02:00
|
|
|
UnhookWindowsHookEx( mouse_hook );
|
2006-09-11 00:47:39 +02:00
|
|
|
mouse_hook = NULL;
|
|
|
|
}
|
2020-04-17 20:35:06 +02:00
|
|
|
|
2021-10-13 09:21:19 +02:00
|
|
|
SetEvent(finished_event);
|
2006-09-11 00:47:39 +02:00
|
|
|
}
|
2021-12-22 14:46:15 +01:00
|
|
|
|
|
|
|
events_count = 0;
|
|
|
|
EnterCriticalSection( &dinput_hook_crit );
|
|
|
|
LIST_FOR_EACH_ENTRY( impl, &acquired_device_list, struct dinput_device, entry )
|
|
|
|
{
|
|
|
|
if (!impl->read_event || !impl->vtbl->read) continue;
|
|
|
|
if (events_count >= ARRAY_SIZE(events)) break;
|
|
|
|
events[events_count++] = impl->read_event;
|
|
|
|
}
|
|
|
|
LeaveCriticalSection( &dinput_hook_crit );
|
2006-09-11 00:47:39 +02:00
|
|
|
}
|
|
|
|
|
2022-02-08 09:55:39 +01:00
|
|
|
if (ret != events_count) ERR("Unexpected termination, ret %#lx\n", ret);
|
2021-12-22 14:46:15 +01:00
|
|
|
|
2021-08-27 12:45:20 +02:00
|
|
|
done:
|
2020-08-10 11:04:15 +02:00
|
|
|
DestroyWindow( di_em_win );
|
|
|
|
di_em_win = NULL;
|
2021-12-10 09:44:44 +01:00
|
|
|
return 0;
|
2006-09-11 00:47:39 +02:00
|
|
|
}
|
|
|
|
|
2021-12-10 09:44:44 +01:00
|
|
|
static BOOL WINAPI dinput_thread_start_once( INIT_ONCE *once, void *param, void **context )
|
2006-09-11 00:47:39 +02:00
|
|
|
{
|
2021-12-10 09:44:44 +01:00
|
|
|
HANDLE start_event;
|
2006-09-11 00:47:39 +02:00
|
|
|
|
2021-12-10 09:44:44 +01:00
|
|
|
start_event = CreateEventW( NULL, FALSE, FALSE, NULL );
|
2022-02-08 09:55:39 +01:00
|
|
|
if (!start_event) ERR( "failed to create start event, error %lu\n", GetLastError() );
|
2007-07-15 18:38:05 +02:00
|
|
|
|
2021-12-10 09:44:44 +01:00
|
|
|
dinput_thread = CreateThread( NULL, 0, dinput_thread_proc, start_event, 0, &dinput_thread_id );
|
2022-02-08 09:55:39 +01:00
|
|
|
if (!dinput_thread) ERR( "failed to create internal thread, error %lu\n", GetLastError() );
|
2006-10-05 17:45:45 +02:00
|
|
|
|
2021-12-10 09:44:44 +01:00
|
|
|
WaitForSingleObject( start_event, INFINITE );
|
|
|
|
CloseHandle( start_event );
|
2007-07-15 18:38:05 +02:00
|
|
|
|
2021-12-10 09:44:44 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
2007-07-07 07:36:18 +02:00
|
|
|
|
2021-12-10 09:44:44 +01:00
|
|
|
static void dinput_thread_start(void)
|
|
|
|
{
|
|
|
|
static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
|
|
|
|
InitOnceExecuteOnce( &init_once, dinput_thread_start_once, NULL, NULL );
|
|
|
|
}
|
2021-03-26 18:36:01 +01:00
|
|
|
|
2021-12-10 09:44:44 +01:00
|
|
|
static void dinput_thread_stop(void)
|
|
|
|
{
|
|
|
|
PostThreadMessageW( dinput_thread_id, WM_USER + 0x10, 0, 0 );
|
2022-01-06 10:51:47 +01:00
|
|
|
if (WaitForSingleObject( dinput_thread, 500 ) == WAIT_TIMEOUT)
|
|
|
|
WARN("Timeout while waiting for internal thread\n");
|
2021-12-10 09:44:44 +01:00
|
|
|
CloseHandle( dinput_thread );
|
2006-09-11 00:47:39 +02:00
|
|
|
}
|
|
|
|
|
2021-10-27 09:40:59 +02:00
|
|
|
void check_dinput_hooks( IDirectInputDevice8W *iface, BOOL acquired )
|
2006-09-11 00:47:39 +02:00
|
|
|
{
|
2007-07-15 18:40:00 +02:00
|
|
|
static HHOOK callwndproc_hook;
|
|
|
|
static ULONG foreground_cnt;
|
2021-10-27 09:40:59 +02:00
|
|
|
struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
|
2020-04-17 20:35:06 +02:00
|
|
|
HANDLE hook_change_finished_event = NULL;
|
2007-07-15 18:40:00 +02:00
|
|
|
|
2021-12-10 09:44:44 +01:00
|
|
|
dinput_thread_start();
|
|
|
|
|
2006-09-13 08:06:15 +02:00
|
|
|
EnterCriticalSection(&dinput_hook_crit);
|
2007-07-15 18:40:00 +02:00
|
|
|
|
2021-10-27 09:40:59 +02:00
|
|
|
if (impl->dwCoopLevel & DISCL_FOREGROUND)
|
2007-07-15 18:40:00 +02:00
|
|
|
{
|
2019-04-08 05:48:16 +02:00
|
|
|
if (acquired)
|
2007-07-15 18:40:00 +02:00
|
|
|
foreground_cnt++;
|
|
|
|
else
|
|
|
|
foreground_cnt--;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (foreground_cnt && !callwndproc_hook)
|
|
|
|
callwndproc_hook = SetWindowsHookExW( WH_CALLWNDPROC, callwndproc_proc,
|
|
|
|
DINPUT_instance, GetCurrentThreadId() );
|
|
|
|
else if (!foreground_cnt && callwndproc_hook)
|
|
|
|
{
|
|
|
|
UnhookWindowsHookEx( callwndproc_hook );
|
|
|
|
callwndproc_hook = NULL;
|
|
|
|
}
|
|
|
|
|
2021-10-27 09:40:59 +02:00
|
|
|
if (impl->use_raw_input)
|
2020-08-10 11:04:15 +02:00
|
|
|
{
|
|
|
|
if (acquired)
|
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
impl->raw_device.dwFlags = 0;
|
|
|
|
if (impl->dwCoopLevel & DISCL_BACKGROUND)
|
|
|
|
impl->raw_device.dwFlags |= RIDEV_INPUTSINK;
|
|
|
|
if (impl->dwCoopLevel & DISCL_EXCLUSIVE)
|
|
|
|
impl->raw_device.dwFlags |= RIDEV_NOLEGACY;
|
|
|
|
if ((impl->dwCoopLevel & DISCL_EXCLUSIVE) && impl->raw_device.usUsage == 2)
|
|
|
|
impl->raw_device.dwFlags |= RIDEV_CAPTUREMOUSE;
|
|
|
|
if ((impl->dwCoopLevel & DISCL_EXCLUSIVE) && impl->raw_device.usUsage == 6)
|
|
|
|
impl->raw_device.dwFlags |= RIDEV_NOHOTKEYS;
|
|
|
|
impl->raw_device.hwndTarget = di_em_win;
|
2020-08-10 11:04:15 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-27 09:40:59 +02:00
|
|
|
impl->raw_device.dwFlags = RIDEV_REMOVE;
|
|
|
|
impl->raw_device.hwndTarget = NULL;
|
2020-08-10 11:04:15 +02:00
|
|
|
}
|
|
|
|
|
2021-10-27 09:40:59 +02:00
|
|
|
if (!RegisterRawInputDevices( &impl->raw_device, 1, sizeof(RAWINPUTDEVICE) ))
|
|
|
|
WARN( "Unable to (un)register raw device %x:%x\n", impl->raw_device.usUsagePage, impl->raw_device.usUsage );
|
2020-08-10 11:04:15 +02:00
|
|
|
}
|
|
|
|
|
2021-10-13 09:21:19 +02:00
|
|
|
hook_change_finished_event = CreateEventW( NULL, FALSE, FALSE, NULL );
|
2021-12-10 09:44:44 +01:00
|
|
|
PostThreadMessageW( dinput_thread_id, WM_USER + 0x10, 1, (LPARAM)hook_change_finished_event );
|
2007-07-15 18:40:00 +02:00
|
|
|
|
2006-09-13 08:06:15 +02:00
|
|
|
LeaveCriticalSection(&dinput_hook_crit);
|
2020-04-17 20:35:06 +02:00
|
|
|
|
2021-10-13 09:21:19 +02:00
|
|
|
WaitForSingleObject(hook_change_finished_event, INFINITE);
|
|
|
|
CloseHandle(hook_change_finished_event);
|
2006-09-11 00:47:39 +02:00
|
|
|
}
|
2011-11-16 16:31:26 +01:00
|
|
|
|
2015-11-05 15:57:29 +01:00
|
|
|
void check_dinput_events(void)
|
|
|
|
{
|
|
|
|
/* Windows does not do that, but our current implementation of winex11
|
|
|
|
* requires periodic event polling to forward events to the wineserver.
|
|
|
|
*
|
|
|
|
* We have to call this function from multiple places, because:
|
|
|
|
* - some games do not explicitly poll for mouse events
|
|
|
|
* (for example Culpa Innata)
|
|
|
|
* - some games only poll the device, and neither keyboard nor mouse
|
|
|
|
* (for example Civilization: Call to Power 2)
|
2021-11-08 09:34:57 +01:00
|
|
|
* - some games do not explicitly poll for keyboard events
|
|
|
|
* (for example Morrowind in its key binding page)
|
2015-11-05 15:57:29 +01:00
|
|
|
*/
|
|
|
|
MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0);
|
|
|
|
}
|
|
|
|
|
2022-02-08 09:55:37 +01:00
|
|
|
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
|
2011-11-16 16:31:26 +01:00
|
|
|
{
|
2022-02-08 09:55:39 +01:00
|
|
|
TRACE( "inst %p, reason %lu, reserved %p.\n", inst, reason, reserved );
|
2022-02-08 09:55:37 +01:00
|
|
|
|
2011-11-16 16:31:26 +01:00
|
|
|
switch(reason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(inst);
|
|
|
|
DINPUT_instance = inst;
|
2020-08-10 11:04:15 +02:00
|
|
|
register_di_em_win_class();
|
2011-11-16 16:31:26 +01:00
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
2013-05-16 12:53:07 +02:00
|
|
|
if (reserved) break;
|
2021-12-10 09:44:44 +01:00
|
|
|
dinput_thread_stop();
|
2020-08-10 11:04:15 +02:00
|
|
|
unregister_di_em_win_class();
|
2011-11-16 16:31:26 +01:00
|
|
|
DeleteCriticalSection(&dinput_hook_crit);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|