Fix all drivers DriverProc to conform to the DRIVERPROC definition.
[wine.git] / dlls / winmm / winenas / nas.c
blob9b7b02652bfce092c6bf8a30d3e51338474280f7
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
2 /*
4 * Wine Driver for NAS Network Audio System
5 * http://radscan.com/nas.html
7 * Copyright 2002 Nicolas Escuder <n.escuder@alineanet.com>
9 * Code massively copied from Eric Pouech's OSS driver
10 * and Chris Morgan aRts driver
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "config.h"
29 #include <stdarg.h>
31 #include "windef.h"
32 #include "winbase.h"
33 #include "wingdi.h"
34 #include "winuser.h"
35 #include "mmddk.h"
36 #include "nas.h"
38 #ifdef HAVE_NAS
39 static int nas = 0;
41 /**************************************************************************
42 * NAS_drvOpen [internal]
44 static LRESULT NAS_drvOpen(LPSTR str)
46 if (nas)
47 return 0;
49 /* I know, this is ugly, but who cares... */
50 nas = 1;
51 return 1;
54 /**************************************************************************
55 * NAS_drvClose [internal]
57 static LRESULT NAS_drvClose(DWORD_PTR dwDevID)
59 if (nas) {
60 nas = 0;
61 return 1;
63 return 0;
65 #endif /* #ifdef HAVE_NAS */
68 /**************************************************************************
69 * DriverProc (WINENAS.@)
71 LRESULT CALLBACK NAS_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
72 LPARAM dwParam1, LPARAM dwParam2)
74 /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */
75 /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
77 switch(wMsg) {
78 #ifdef HAVE_NAS
79 case DRV_LOAD: NAS_WaveInit();
80 /* NAS_MidiInit(); FIXME: no midi */
81 return 1;
82 case DRV_FREE: return NAS_WaveClose();
83 case DRV_OPEN: return NAS_drvOpen((LPSTR)dwParam1);
84 case DRV_CLOSE: return NAS_drvClose(dwDevID);
85 case DRV_ENABLE: return 1;
86 case DRV_DISABLE: return 1;
87 case DRV_QUERYCONFIGURE: return 1;
88 case DRV_CONFIGURE: MessageBoxA(0, "NAS MultiMedia Driver !", "NAS Driver", MB_OK); return 1;
89 case DRV_INSTALL: return DRVCNF_RESTART;
90 case DRV_REMOVE: return DRVCNF_RESTART;
91 #endif
92 default:
93 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);