ReactOS 0.4.15-dev-8102-g108db8f
winemm.h
Go to the documentation of this file.
1/*
2 * Copyright 1998, Luiz Otavio L. Zorzella
3 * 1999, Eric Pouech
4 *
5 * Purpose: multimedia declarations (internal to WINMM & MMSYSTEM DLLs)
6 *
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.
11 *
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.
16 *
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
20 */
21
22#ifndef _WINEMM_H_
23#define _WINEMM_H_
24
25#include <wine/config.h>
26
27#include <assert.h>
28#include <stdio.h>
29
30#define _INC_WINDOWS
31#define COM_NO_WINDOWS_H
32
33#define NONAMELESSUNION
34#define NONAMELESSSTRUCT
35
36#include <windef.h>
37#include <winbase.h>
38#include <winuser.h>
39#include <winreg.h>
40#include <mmddk.h>
41
42#include <wine/debug.h>
43#include <wine/exception.h>
44#include <wine/unicode.h>
45
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"
49
50/* Who said goofy boy ? */
51#define WINE_DI_MAGIC 0x900F1B01
52
53typedef struct tagWINE_DRIVER
54{
56 /* as usual LPWINE_DRIVER == hDriver32 */
64
66
67/* for each loaded driver and each known type of driver, this structure contains
68 * the information needed to access it
69 */
70typedef 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 */
75
76#define MMDRV_AUX 0
77#define MMDRV_MIXER 1
78#define MMDRV_MIDIIN 2
79#define MMDRV_MIDIOUT 3
80#define MMDRV_WAVEIN 4
81#define MMDRV_WAVEOUT 5
82#define MMDRV_MAX 6
83
84/* each low-level .drv will be associated with an instance of this structure */
85typedef struct tagWINE_MM_DRIVER {
86 HDRVR hDriver;
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 */
91
92typedef 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 */
103
104typedef struct {
107
108typedef struct {
110 MIDIOPENDESC mod; /* FIXME: should be removed */
112
113typedef struct {
116
117typedef struct tagWINE_MCIDRIVER {
123 HDRVR hDriver;
132
134{
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 */
140};
141
142typedef struct tagWINE_MMIO {
146 unsigned bTmpIOProc : 1,
150
151/* function prototypes */
154BOOL DRIVER_GetLibName(LPCWSTR keyName, LPCWSTR sectName, LPWSTR buf, int sz);
156void DRIVER_UnloadAll(void);
157HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam);
158BOOL MMDRV_Install(LPCSTR drvRegName, LPCSTR drvFileName, BOOL bIsMapper);
160BOOL MMDRV_Init(void);
161void MMDRV_Exit(void);
164 DWORD_PTR* dwCallback, DWORD_PTR* dwInstance);
165void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld);
166DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwParam2);
168LPWINE_MLD MMDRV_Get(HANDLE hndl, UINT type, BOOL bCanBeID);
169LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType, BOOL bSrcCanBeID, UINT dstTyped);
170DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
171UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
172
173DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
175
177
178void TIME_MMTimeStop(void);
179
181
182/* Global variables */
185extern HANDLE psLastEvent;
186extern HANDLE psStopEvent;
187
188/* GetDriverFlags() returned bits is not documented (nor the call itself)
189 * Here are Wine only definitions of the bits
190 */
191#define WINE_GDF_EXIST 0x80000000
192#define WINE_GDF_EXTERNAL_MASK 0xF0000000
193#define WINE_GDF_SESSION 0x00000001
194
195
196/* Modification to take into account Windows NT's registry format */
197
198#define NT_MME_DRIVERS32_KEY \
199 "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32"
200
201#define NT_MME_DRIVERS_KEY \
202 "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers"
203
205
206// REACTOS:
207#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
208#define wcsnicmp strncmpiW
209#define swprintf snprintfW
210
211#endif /* _WINEMM_H_ */
unsigned short UINT16
LPARAM lParam
Definition: combotst.c:139
#define DECLSPEC_HIDDEN
Definition: precomp.h:8
#define CALLBACK
Definition: compat.h:35
DWORD FOURCC
Definition: dmdls.h:25
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define error(str)
Definition: mkdosfs.c:1605
UINT(CALLBACK * YIELDPROC)(MCIDEVICEID, DWORD)
Definition: mmsystem.h:960
UINT MMRESULT
Definition: mmsystem.h:962
LRESULT(CALLBACK * DRIVERPROC)(DWORD_PTR, HDRVR, UINT, LPARAM, LPARAM)
Definition: mmsystem.h:1001
MMIOPROC * LPMMIOPROC
Definition: mmsystem.h:1483
unsigned int UINT
Definition: ndis.h:50
#define DWORD
Definition: nt_native.h:44
const WCHAR * str
BOOL is_unicode
Definition: winemm.h:138
LPMMIOPROC pIOProc
Definition: winemm.h:137
int count
Definition: winemm.h:139
struct IOProcList * pNext
Definition: winemm.h:135
FOURCC fourCC
Definition: winemm.h:136
WINE_MLD mld
Definition: winemm.h:109
MIDIOPENDESC mod
Definition: winemm.h:110
WINE_MLD mld
Definition: winemm.h:114
WINE_MLD mld
Definition: winemm.h:105
Definition: copy.c:22
DWORD dwMagic
Definition: winemm.h:55
struct tagWINE_DRIVER * lpPrevItem
Definition: winemm.h:61
HMODULE hModule
Definition: winemm.h:58
DRIVERPROC lpDrvProc
Definition: winemm.h:59
DWORD_PTR dwDriverID
Definition: winemm.h:60
DWORD dwFlags
Definition: winemm.h:57
struct tagWINE_DRIVER * lpNextItem
Definition: winemm.h:62
DWORD CreatorThread
Definition: winemm.h:127
LPWSTR lpstrElementName
Definition: winemm.h:120
DWORD_PTR dwPrivate
Definition: winemm.h:124
UINT uSpecificCmdTable
Definition: winemm.h:129
DWORD dwYieldData
Definition: winemm.h:126
LPWSTR lpstrDeviceType
Definition: winemm.h:121
LPWSTR lpstrAlias
Definition: winemm.h:122
YIELDPROC lpfnYieldProc
Definition: winemm.h:125
UINT uTypeCmdTable
Definition: winemm.h:128
struct tagWINE_MCIDRIVER * lpNext
Definition: winemm.h:130
DWORD_PTR dwCallback
Definition: winemm.h:100
WORD dwFlags
Definition: winemm.h:99
DWORD_PTR dwClientInstance
Definition: winemm.h:101
UINT mmdIndex
Definition: winemm.h:96
DWORD_PTR dwDriverInstance
Definition: winemm.h:97
UINT type
Definition: winemm.h:95
UINT uDeviceID
Definition: winemm.h:94
DWORD dwFileSize
Definition: winemm.h:148
unsigned bBufferLoaded
Definition: winemm.h:147
struct IOProcList * ioProc
Definition: winemm.h:145
MMIOINFO info
Definition: winemm.h:143
unsigned bTmpIOProc
Definition: winemm.h:146
struct tagWINE_MMIO * lpNext
Definition: winemm.h:144
WINEMM_msgFunc32 fnMessage32
Definition: winemm.h:73
WINE_MM_DRIVER_PART parts[MMDRV_MAX]
Definition: winemm.h:89
LPSTR drvname
Definition: winemm.h:87
unsigned bIsMapper
Definition: winemm.h:88
HDRVR hDriver
Definition: winemm.h:86
#define DWORD_PTR
Definition: treelist.c:76
uint32_t DWORD_PTR
Definition: typedefs.h:65
int32_t INT
Definition: typedefs.h:58
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
#define WINAPI
Definition: msvc.h:6
LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr)
Definition: driver.c:89
struct tagWINE_MLD * LPWINE_MLD
struct tagWINE_MMIO WINE_MMIO
DWORD MMDRV_Close(LPWINE_MLD mld, UINT wMsg)
Definition: lolvldrv.c:228
struct tagWINE_MCIDRIVER WINE_MCIDRIVER
HANDLE psLastEvent
Definition: winmm.c:51
UINT MMDRV_GetNum(UINT)
Definition: lolvldrv.c:61
struct WINE_MIDI * LPWINE_MIDI
LPSTR MCI_strdupWtoA(LPCWSTR str)
void MMDRV_Exit(void)
Definition: lolvldrv.c:611
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
BOOL MMDRV_Install(LPCSTR drvRegName, LPCSTR drvFileName, BOOL bIsMapper)
Definition: lolvldrv.c:440
struct tagWINE_MCIDRIVER * LPWINE_MCIDRIVER
BOOL MMDRV_Init(void)
Definition: lolvldrv.c:530
struct tagWINE_MM_DRIVER WINE_MM_DRIVER
HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam)
Definition: driver.c:365
LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType, BOOL bSrcCanBeID, UINT dstTyped)
Definition: lolvldrv.c:285
void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld)
Definition: lolvldrv.c:165
void DRIVER_UnloadAll(void)
Definition: driver.c:658
LPWINE_MLD MMDRV_Get(HANDLE hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMDRV_MAX
Definition: winemm.h:82
LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD *dwFlags, DWORD_PTR *dwCallback, DWORD_PTR *dwInstance)
Definition: lolvldrv.c:123
void TIME_MMTimeStop(void)
Definition: time.c:271
struct tagWINE_DRIVER WINE_DRIVER
DWORD(CALLBACK * WINEMM_msgFunc32)(UINT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR)
Definition: winemm.h:65
BOOL DRIVER_GetLibName(LPCWSTR keyName, LPCWSTR sectName, LPWSTR buf, int sz)
Definition: driver.c:233
HINSTANCE hWinMM32Instance
Definition: winmm.c:50
UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:303
LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCWSTR fn, LPARAM lParam2)
Definition: driver.c:273
struct tagWINE_DRIVER * LPWINE_DRIVER
struct tagWINE_MM_DRIVER_PART WINE_MM_DRIVER_PART
struct tagWINE_MLD WINE_MLD
struct WINE_WAVE * LPWINE_WAVE
BOOL LoadRegistryMMEDrivers(char *key)
Definition: registry.c:23
HANDLE psStopEvent
struct WINE_MIXER * LPWINE_MIXER
MMRESULT WINMM_CheckCallback(DWORD_PTR dwCallback, DWORD fdwOpen, BOOL mixer) DECLSPEC_HIDDEN
Definition: winmm.c:193
BOOL WINMM_CheckForMMSystem(void)
Definition: winmm.c:86
CRITICAL_SECTION WINMM_cs
Definition: winmm.c:53
struct tagWINE_MM_DRIVER * LPWINE_MM_DRIVER
const char * WINMM_ErrorToString(MMRESULT error)
Definition: winmm.c:110
struct tagWINE_MMIO * LPWINE_MMIO
DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: mci.c:2075
DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwParam2)
Definition: lolvldrv.c:183
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185