Removed a few dependencies on kernel32 functions.
[wine] / dlls / winmm / wineoss / oss.c
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
2 /*                                 
3  * Wine Driver for Open Sound System
4  *
5  * Copyright    1999 Eric Pouech
6  */
7
8 #include "windef.h"
9 #include "wingdi.h"
10 #include "winuser.h"
11 #include "mmddk.h"
12 #include "oss.h"
13
14 static  struct WINE_OSS* oss = NULL;
15
16 /**************************************************************************
17  *                              OSS_drvOpen                     [internal]      
18  */
19 static  DWORD   OSS_drvOpen(LPSTR str)
20 {
21     if (oss)
22         return 0;
23     
24     /* I know, this is ugly, but who cares... */
25     oss = (struct WINE_OSS*)1;
26     return 1;
27 }
28
29 /**************************************************************************
30  *                              OSS_drvClose                    [internal]      
31  */
32 static  DWORD   OSS_drvClose(DWORD dwDevID)
33 {
34     if (oss) {
35         oss = NULL;
36         return 1;
37     }
38     return 0;
39 }
40
41 /**************************************************************************
42  *                              OSS_DriverProc                  [internal]
43  */
44 LONG CALLBACK   OSS_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, 
45                                DWORD dwParam1, DWORD dwParam2)
46 {
47 /* EPP     TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n",  */
48 /* EPP    dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
49     
50     switch(wMsg) {
51     case DRV_LOAD:              OSS_WaveInit(); OSS_MidiInit(); return 1;
52     case DRV_FREE:              return 1;
53     case DRV_OPEN:              return OSS_drvOpen((LPSTR)dwParam1);
54     case DRV_CLOSE:             return OSS_drvClose(dwDevID);
55     case DRV_ENABLE:            return 1;
56     case DRV_DISABLE:           return 1;
57     case DRV_QUERYCONFIGURE:    return 1;
58     case DRV_CONFIGURE:         MessageBoxA(0, "OSS MultiMedia Driver !", "OSS Driver", MB_OK); return 1;
59     case DRV_INSTALL:           return DRVCNF_RESTART;
60     case DRV_REMOVE:            return DRVCNF_RESTART;
61     default:
62         return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
63     }
64 }
65
66