2 * Copyright 1998, Luiz Otavio L. Zorzella
5 * Purpose: multimedia declarations (internal to WINMM & MMSYSTEM DLLs)
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include <wine/config.h>
31 #define COM_NO_WINDOWS_H
33 #define NONAMELESSUNION
34 #define NONAMELESSSTRUCT
42 #include <wine/debug.h>
43 #include <wine/exception.h>
44 #include <wine/unicode.h>
46 #define WINE_DEFAULT_WINMM_DRIVER "alsa,oss,coreaudio,esd"
47 #define WINE_DEFAULT_WINMM_MAPPER "msacm32.drv"
48 #define WINE_DEFAULT_WINMM_MIDI "midimap.dll"
50 /* Who said goofy boy ? */
51 #define WINE_DI_MAGIC 0x900F1B01
53 typedef struct tagWINE_DRIVER
56 /* as usual LPWINE_DRIVER == hDriver32 */
61 struct tagWINE_DRIVER
* lpPrevItem
;
62 struct tagWINE_DRIVER
* lpNextItem
;
63 } WINE_DRIVER
, *LPWINE_DRIVER
;
65 typedef DWORD (CALLBACK
*WINEMM_msgFunc32
)(UINT
, UINT
, DWORD_PTR
, DWORD_PTR
, DWORD_PTR
);
67 /* for each loaded driver and each known type of driver, this structure contains
68 * the information needed to access it
70 typedef struct tagWINE_MM_DRIVER_PART
{
71 int nIDMin
; /* lower bound of global indexes for this type */
72 int nIDMax
; /* hhigher bound of global indexes for this type */
73 WINEMM_msgFunc32 fnMessage32
; /* pointer to function */
74 } WINE_MM_DRIVER_PART
;
78 #define MMDRV_MIDIIN 2
79 #define MMDRV_MIDIOUT 3
80 #define MMDRV_WAVEIN 4
81 #define MMDRV_WAVEOUT 5
84 /* each low-level .drv will be associated with an instance of this structure */
85 typedef struct tagWINE_MM_DRIVER
{
87 LPSTR drvname
; /* name of the driver */
88 unsigned bIsMapper
: 1; /* TRUE if mapper */
89 WINE_MM_DRIVER_PART parts
[MMDRV_MAX
];/* Information for all known types */
90 } WINE_MM_DRIVER
, *LPWINE_MM_DRIVER
;
92 typedef struct tagWINE_MLD
{
93 /* EPP struct tagWINE_MLD* lpNext; */ /* not used so far */
96 UINT mmdIndex
; /* index to low-level driver in MMDrvs table */
97 DWORD_PTR dwDriverInstance
; /* this value is driver related, as opposed to
98 * opendesc.dwInstance which is client (callback) related */
100 DWORD_PTR dwCallback
;
101 DWORD_PTR dwClientInstance
;
102 } WINE_MLD
, *LPWINE_MLD
;
106 } WINE_WAVE
, *LPWINE_WAVE
;
110 MIDIOPENDESC mod
; /* FIXME: should be removed */
111 } WINE_MIDI
, *LPWINE_MIDI
;
115 } WINE_MIXER
, *LPWINE_MIXER
;
117 typedef struct tagWINE_MCIDRIVER
{
120 LPWSTR lpstrElementName
;
121 LPWSTR lpstrDeviceType
;
125 YIELDPROC lpfnYieldProc
;
129 UINT uSpecificCmdTable
;
130 struct tagWINE_MCIDRIVER
*lpNext
;
131 } WINE_MCIDRIVER
, *LPWINE_MCIDRIVER
;
135 struct IOProcList
*pNext
; /* Next item in linked list */
136 FOURCC fourCC
; /* four-character code identifying IOProc */
137 LPMMIOPROC pIOProc
; /* pointer to IProc */
138 BOOL is_unicode
; /* 32A or 32W */
139 int count
; /* number of objects linked to it */
142 typedef struct tagWINE_MMIO
{
144 struct tagWINE_MMIO
* lpNext
;
145 struct IOProcList
* ioProc
;
146 unsigned bTmpIOProc
: 1,
149 } WINE_MMIO
, *LPWINE_MMIO
;
151 /* function prototypes */
152 BOOL
WINMM_CheckForMMSystem(void);
153 LPWINE_DRIVER
DRIVER_FindFromHDrvr(HDRVR hDrvr
);
154 BOOL
DRIVER_GetLibName(LPCWSTR keyName
, LPCWSTR sectName
, LPWSTR buf
, int sz
);
155 LPWINE_DRIVER
DRIVER_TryOpenDriver32(LPCWSTR fn
, LPARAM lParam2
);
156 void DRIVER_UnloadAll(void);
157 HDRVR WINAPI
OpenDriverA(LPCSTR lpDriverName
, LPCSTR lpSectionName
, LPARAM lParam
);
158 BOOL
MMDRV_Install(LPCSTR drvRegName
, LPCSTR drvFileName
, BOOL bIsMapper
);
159 BOOL
LoadRegistryMMEDrivers(char* key
);
160 BOOL
MMDRV_Init(void);
161 void MMDRV_Exit(void);
162 UINT
MMDRV_GetNum(UINT
);
163 LPWINE_MLD
MMDRV_Alloc(UINT size
, UINT type
, LPHANDLE hndl
, DWORD
* dwFlags
,
164 DWORD_PTR
* dwCallback
, DWORD_PTR
* dwInstance
);
165 void MMDRV_Free(HANDLE hndl
, LPWINE_MLD mld
);
166 DWORD
MMDRV_Open(LPWINE_MLD mld
, UINT wMsg
, DWORD_PTR dwParam1
, DWORD dwParam2
);
167 DWORD
MMDRV_Close(LPWINE_MLD mld
, UINT wMsg
);
168 LPWINE_MLD
MMDRV_Get(HANDLE hndl
, UINT type
, BOOL bCanBeID
);
169 LPWINE_MLD
MMDRV_GetRelated(HANDLE hndl
, UINT srcType
, BOOL bSrcCanBeID
, UINT dstTyped
);
170 DWORD
MMDRV_Message(LPWINE_MLD mld
, UINT wMsg
, DWORD_PTR dwParam1
, DWORD_PTR dwParam2
);
171 UINT
MMDRV_PhysicalFeatures(LPWINE_MLD mld
, UINT uMsg
, DWORD_PTR dwParam1
, DWORD_PTR dwParam2
);
173 const char* MCI_MessageToString(UINT wMsg
);
174 DWORD
MCI_SendCommand(UINT wDevID
, UINT16 wMsg
, DWORD_PTR dwParam1
, DWORD_PTR dwParam2
);
175 LPWSTR
MCI_strdupAtoW(LPCSTR str
);
176 LPSTR
MCI_strdupWtoA(LPCWSTR str
);
178 const char* WINMM_ErrorToString(MMRESULT error
);
180 void TIME_MMTimeStop(void);
182 MMRESULT
WINMM_CheckCallback(DWORD_PTR dwCallback
, DWORD fdwOpen
, BOOL mixer
) DECLSPEC_HIDDEN
;
184 /* Global variables */
185 extern CRITICAL_SECTION WINMM_cs
;
186 extern HINSTANCE hWinMM32Instance
;
187 extern HANDLE psLastEvent
;
188 extern HANDLE psStopEvent
;
190 /* GetDriverFlags() returned bits is not documented (nor the call itself)
191 * Here are Wine only definitions of the bits
193 #define WINE_GDF_EXIST 0x80000000
194 #define WINE_GDF_EXTERNAL_MASK 0xF0000000
195 #define WINE_GDF_SESSION 0x00000001
198 /* Modification to take into account Windows NT's registry format */
200 #define NT_MME_DRIVERS32_KEY \
201 "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32"
203 #define NT_MME_DRIVERS_KEY \
204 "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers"
206 INT
LoadRegistryMMEDrivers(char* key
);
208 #endif /* _WINEMM_H_ */