Skip to content

Commit acd8b06

Browse files
committed
- Partially sync winmm
- Remove unused code - Fix function headers svn path=/trunk/; revision=43747
1 parent 8fd3137 commit acd8b06

18 files changed

+1206
-8695
lines changed

reactos/dll/win32/winmm/driver.c

Lines changed: 158 additions & 98 deletions
Large diffs are not rendered by default.

reactos/dll/win32/winmm/joystick.c

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* You should have received a copy of the GNU Lesser General Public
2020
* License along with this library; if not, write to the Free Software
21-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
2222
*/
2323

2424
#include "config.h"
@@ -35,21 +35,21 @@
3535
#include <sys/ioctl.h>
3636
#endif
3737

38+
#include "winemm.h"
3839
#include "windef.h"
3940
#include "winbase.h"
4041
#include "mmsystem.h"
4142
#include "wingdi.h"
4243
#include "winuser.h"
4344
#include "winnls.h"
44-
#include "winemm.h"
4545

4646
#include "mmddk.h"
4747

4848
#include "wine/debug.h"
4949

5050
WINE_DEFAULT_DEBUG_CHANNEL(winmm);
5151

52-
#define MAXJOYSTICK (JOYSTICKID2 + 1)
52+
#define MAXJOYSTICK (JOYSTICKID2 + 30)
5353
#define JOY_PERIOD_MIN (10) /* min Capture time period */
5454
#define JOY_PERIOD_MAX (1000) /* max Capture time period */
5555

@@ -74,14 +74,14 @@ static BOOL JOY_LoadDriver(DWORD dwJoyID)
7474
if (JOY_Sticks[dwJoyID].hDriver)
7575
return TRUE;
7676

77-
JOY_Sticks[dwJoyID].hDriver = OpenDriverA("joystick.drv", 0, dwJoyID);
77+
JOY_Sticks[dwJoyID].hDriver = OpenDriverA("winejoystick.drv", 0, dwJoyID);
7878
return (JOY_Sticks[dwJoyID].hDriver != 0);
7979
}
8080

8181
/**************************************************************************
8282
* JOY_Timer [internal]
8383
*/
84-
static void CALLBACK JOY_Timer(HWND hWnd, UINT wMsg, UINT wTimer, DWORD dwTime)
84+
static void CALLBACK JOY_Timer(HWND hWnd, UINT wMsg, UINT_PTR wTimer, DWORD dwTime)
8585
{
8686
int i;
8787
WINE_JOYSTICK* joy;
@@ -121,6 +121,19 @@ static void CALLBACK JOY_Timer(HWND hWnd, UINT wMsg, UINT wTimer, DWORD dwTime)
121121
}
122122
}
123123

124+
/**************************************************************************
125+
* joyConfigChanged [WINMM.@]
126+
*/
127+
MMRESULT WINAPI joyConfigChanged(DWORD flags)
128+
{
129+
FIXME("(%x) - stub\n", flags);
130+
131+
if (flags)
132+
return JOYERR_PARMS;
133+
134+
return JOYERR_NOERROR;
135+
}
136+
124137
/**************************************************************************
125138
* joyGetNumDevs [WINMM.@]
126139
*/
@@ -131,7 +144,7 @@ UINT WINAPI joyGetNumDevs(void)
131144

132145
for (i = 0; i < MAXJOYSTICK; i++) {
133146
if (JOY_LoadDriver(i)) {
134-
ret += SendDriverMessage(JOY_Sticks[i].hDriver, JDD_GETNUMDEVS, 0L, 0L);
147+
ret += SendDriverMessage(JOY_Sticks[i].hDriver, JDD_GETNUMDEVS, 0, 0);
135148
}
136149
}
137150
return ret;
@@ -148,7 +161,7 @@ MMRESULT WINAPI joyGetDevCapsW(UINT_PTR wID, LPJOYCAPSW lpCaps, UINT wSize)
148161
lpCaps->wPeriodMin = JOY_PERIOD_MIN; /* FIXME */
149162
lpCaps->wPeriodMax = JOY_PERIOD_MAX; /* FIXME (same as MS Joystick Driver) */
150163

151-
return SendDriverMessage(JOY_Sticks[wID].hDriver, JDD_GETDEVCAPS, (DWORD)lpCaps, wSize);
164+
return SendDriverMessage(JOY_Sticks[wID].hDriver, JDD_GETDEVCAPS, (LPARAM)lpCaps, wSize);
152165
}
153166

154167
/**************************************************************************
@@ -222,7 +235,7 @@ MMRESULT WINAPI joyGetPosEx(UINT wID, LPJOYINFOEX lpInfo)
222235
lpInfo->dwReserved1 = 0;
223236
lpInfo->dwReserved2 = 0;
224237

225-
return SendDriverMessage(JOY_Sticks[wID].hDriver, JDD_GETPOSEX, (DWORD)lpInfo, 0L);
238+
return SendDriverMessage(JOY_Sticks[wID].hDriver, JDD_GETPOSEX, (LPARAM)lpInfo, 0);
226239
}
227240

228241
/**************************************************************************
@@ -240,7 +253,7 @@ MMRESULT WINAPI joyGetPos(UINT wID, LPJOYINFO lpInfo)
240253
lpInfo->wZpos = 0;
241254
lpInfo->wButtons = 0;
242255

243-
return SendDriverMessage(JOY_Sticks[wID].hDriver, JDD_GETPOS, (DWORD)lpInfo, 0L);
256+
return SendDriverMessage(JOY_Sticks[wID].hDriver, JDD_GETPOS, (LPARAM)lpInfo, 0);
244257
}
245258

246259
/**************************************************************************

0 commit comments

Comments
 (0)