Real implementation of SHRestricted(), clarified SHInitRestricted()'s
[wine/wine64.git] / multimedia / winemm.h
blob6287d5f775f875496583be9eb55d06c18dfca1aa
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
3 /*****************************************************************************
4 * Copyright 1998, Luiz Otavio L. Zorzella
5 * 1999, Eric Pouech
7 * File: winemm.h
8 * Purpose: multimedia declarations (internal to WINMM & MMSYSTEM DLLs)
10 *****************************************************************************
13 #include "mmddk.h"
15 typedef DWORD WINAPI (*MessageProc16)(UINT16 wDevID, UINT16 wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
16 typedef DWORD WINAPI (*MessageProc32)(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
18 typedef struct tagWINE_MLD {
19 /* EPP struct tagWINE_MLD* lpNext; */ /* not used so far */
20 UINT uDeviceID;
21 UINT type;
22 UINT mmdIndex; /* index to low-level driver in MMDrvs table */
23 DWORD dwDriverInstance; /* this value is driver related, as opposed to
24 * opendesc.dwInstance which is client (callback) related */
25 WORD bFrom32;
26 WORD dwFlags;
27 DWORD dwCallback;
28 DWORD dwClientInstance;
29 } WINE_MLD, *LPWINE_MLD;
31 typedef struct {
32 WINE_MLD mld;
33 } WINE_WAVE, *LPWINE_WAVE;
35 typedef struct {
36 WINE_MLD mld;
37 MIDIOPENDESC mod; /* FIXME: should be removed */
38 } WINE_MIDI, *LPWINE_MIDI;
40 typedef struct {
41 WINE_MLD mld;
42 } WINE_MIXER, *LPWINE_MIXER;
44 extern BOOL MMDRV_Init(void);
45 extern UINT MMDRV_GetNum(UINT);
46 extern LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags,
47 DWORD* dwCallback, DWORD* dwInstance, BOOL bFrom32);
48 extern void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld);
49 extern DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD dwParam1, DWORD dwParam2);
50 extern DWORD MMDRV_Close(LPWINE_MLD mld, UINT wMsg);
51 extern LPWINE_MLD MMDRV_Get(HANDLE hndl, UINT type, BOOL bCanBeID);
52 extern LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType, BOOL bSrcCanBeID, UINT dstTyped);
53 extern DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32);
54 extern UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, DWORD dwParam2);
56 #define MMDRV_AUX 0
57 #define MMDRV_MIXER 1
58 #define MMDRV_MIDIIN 2
59 #define MMDRV_MIDIOUT 3
60 #define MMDRV_WAVEIN 4
61 #define MMDRV_WAVEOUT 5
62 #define MMDRV_MAX 6
64 #define WINE_MMTHREAD_CREATED 0x4153494C /* "BSIL" */
65 #define WINE_MMTHREAD_DELETED 0xDEADDEAD
67 typedef struct {
68 DWORD dwSignature; /* 00 "BSIL" when ok, 0xDEADDEAD when being deleted */
69 DWORD dwCounter; /* 04 > 1 when in mmThread functions */
70 HANDLE hThread; /* 08 hThread */
71 DWORD dwThreadID; /* 0C */
72 FARPROC16 fpThread; /* 10 address of thread proc (segptr or lin depending on dwFlags) */
73 DWORD dwThreadPmt; /* 14 parameter to be passed upon thread creation to fpThread */
74 DWORD dwSignalCount; /* 18 counter used for signaling */
75 HANDLE hEvent; /* 1C event */
76 HANDLE hVxD; /* 20 return from OpenVxDHandle */
77 DWORD dwStatus; /* 24 0x00, 0x10, 0x20, 0x30 */
78 DWORD dwFlags; /* 28 dwFlags upon creation */
79 HANDLE16 hTask; /* 2C handle to created task */
80 } WINE_MMTHREAD;
82 typedef struct tagWINE_MCIDRIVER {
83 UINT wDeviceID;
84 UINT wType;
85 LPSTR lpstrElementName;
86 LPSTR lpstrDeviceType;
87 LPSTR lpstrAlias;
88 HDRVR hDrv;
89 DRIVERPROC16 driverProc;
90 DWORD dwPrivate;
91 YIELDPROC lpfnYieldProc;
92 DWORD dwYieldData;
93 BOOL bIs32;
94 HTASK16 hCreatorTask;
95 UINT uTypeCmdTable;
96 UINT uSpecificCmdTable;
97 struct tagWINE_MCIDRIVER*lpNext;
98 } WINE_MCIDRIVER, *LPWINE_MCIDRIVER;
100 #define WINE_TIMER_IS32 0x80
102 typedef struct tagTIMERENTRY {
103 UINT wDelay;
104 UINT wResol;
105 FARPROC16 lpFunc;
106 DWORD dwUser;
107 UINT16 wFlags;
108 UINT16 wTimerID;
109 UINT uCurTime;
110 struct tagTIMERENTRY* lpNext;
111 } WINE_TIMERENTRY, *LPWINE_TIMERENTRY;
113 typedef struct tagWINE_MM_IDATA {
114 /* iData reference */
115 DWORD dwThisProcess;
116 struct tagWINE_MM_IDATA* lpNextIData;
117 /* winmm part */
118 HANDLE hWinMM32Instance;
119 HANDLE hWinMM16Instance;
120 HANDLE h16Module32;
121 CRITICAL_SECTION cs;
122 /* mm timer part */
123 HANDLE hMMTimer;
124 DWORD mmSysTimeMS;
125 LPWINE_TIMERENTRY lpTimerList;
126 int nSizeLpTimers;
127 LPWINE_TIMERENTRY lpTimers;
128 /* mci part */
129 LPWINE_MCIDRIVER lpMciDrvs;
130 /* low level drivers (unused yet) */
131 /* LPWINE_WAVE lpWave; */
132 /* LPWINE_MIDI lpMidi; */
133 /* LPWINE_MIXER lpMixer; */
134 } WINE_MM_IDATA, *LPWINE_MM_IDATA;
136 /* function prototypes */
138 typedef LONG (*MCIPROC16)(DWORD, HDRVR16, WORD, DWORD, DWORD);
139 typedef LONG (*MCIPROC)(DWORD, HDRVR, DWORD, DWORD, DWORD);
141 extern LPWINE_MCIDRIVER MCI_GetDriver(UINT16 uDevID);
142 extern UINT MCI_GetDriverFromString(LPCSTR str);
143 extern DWORD MCI_WriteString(LPSTR lpDstStr, DWORD dstSize, LPCSTR lpSrcStr);
144 extern const char* MCI_MessageToString(UINT16 wMsg);
146 extern UINT16 WINAPI MCI_DefYieldProc(UINT16 wDevID, DWORD data);
148 extern LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2, BOOL bIs32);
150 extern DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32);
151 extern DWORD MCI_SendCommandFrom32(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2);
152 extern DWORD MCI_SendCommandFrom16(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2);
153 extern DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2, UINT size);
155 void CALLBACK WINE_mmThreadEntryPoint(DWORD _pmt);
157 void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32, const MMTIME16* mmt16);
158 void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32);
160 BOOL MULTIMEDIA_MciInit(void);
161 LPWINE_MM_IDATA MULTIMEDIA_GetIData(void);