Fixed some issues found by winapi_check.
[wine/testsucceed.git] / dlls / winmm / winealsa / alsa.c
blob91df60eba1b2aba18a691a2d7b33e5aecf9b1dbc
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
2 /*
3 * Wine Driver for ALSA
5 * Copyright 2002 Eric Pouech
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "config.h"
24 #include "windef.h"
25 #include "winbase.h"
26 #include "wingdi.h"
27 #include "winuser.h"
28 #include "mmddk.h"
29 #include "alsa.h"
31 #ifdef HAVE_ALSA
33 static struct WINE_ALSA* alsa = NULL;
35 /**************************************************************************
36 * ALSA_drvOpen [internal]
38 static DWORD ALSA_drvOpen(LPSTR str)
40 if (alsa)
41 return 0;
43 /* I know, this is ugly, but who cares... */
44 alsa = (struct WINE_ALSA*)1;
45 return 1;
48 /**************************************************************************
49 * ALSA_drvClose [internal]
51 static DWORD ALSA_drvClose(DWORD dwDevID)
53 if (alsa) {
54 alsa = NULL;
55 return 1;
57 return 0;
60 #endif
63 /**************************************************************************
64 * DriverProc (WINEALSA.@)
66 LONG CALLBACK ALSA_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
67 DWORD dwParam1, DWORD dwParam2)
69 /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */
70 /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
72 switch(wMsg) {
73 #ifdef HAVE_ALSA
74 case DRV_LOAD: ALSA_WaveInit();
75 return 1;
76 case DRV_FREE: return 1;
77 case DRV_OPEN: return ALSA_drvOpen((LPSTR)dwParam1);
78 case DRV_CLOSE: return ALSA_drvClose(dwDevID);
79 case DRV_ENABLE: return 1;
80 case DRV_DISABLE: return 1;
81 case DRV_QUERYCONFIGURE: return 1;
82 case DRV_CONFIGURE: MessageBoxA(0, "ALSA MultiMedia Driver !", "ALSA Driver", MB_OK); return 1;
83 case DRV_INSTALL: return DRVCNF_RESTART;
84 case DRV_REMOVE: return DRVCNF_RESTART;
85 #endif
86 default:
87 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);