- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
[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 "winuser.h"
9 #include "driver.h"
10 #include "mmddk.h"
11 #include "oss.h"
12
13 static  struct WINE_OSS* oss = NULL;
14
15 /**************************************************************************
16  *                              OSS_drvOpen                     [internal]      
17  */
18 static  DWORD   OSS_drvOpen(LPSTR str)
19 {
20     if (oss)
21         return 0;
22     
23     /* I know, this is ugly, but who cares... */
24     oss = (struct WINE_OSS*)1;
25     return 1;
26 }
27
28 /**************************************************************************
29  *                              OSS_drvClose                    [internal]      
30  */
31 static  DWORD   OSS_drvClose(DWORD dwDevID)
32 {
33     if (oss) {
34         oss = NULL;
35         return 1;
36     }
37     return 0;
38 }
39
40 /**************************************************************************
41  *                              OSS_DriverProc                  [internal]
42  */
43 LONG CALLBACK   OSS_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, 
44                                DWORD dwParam1, DWORD dwParam2)
45 {
46 /* EPP     TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n",  */
47 /* EPP    dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
48     
49     switch(wMsg) {
50     case DRV_LOAD:              return 1;
51     case DRV_FREE:              return 1;
52     case DRV_OPEN:              return OSS_drvOpen((LPSTR)dwParam1);
53     case DRV_CLOSE:             return OSS_drvClose(dwDevID);
54     case DRV_ENABLE:            return 1;
55     case DRV_DISABLE:           return 1;
56     case DRV_QUERYCONFIGURE:    return 1;
57     case DRV_CONFIGURE:         MessageBoxA(0, "OSS MultiMedia Driver !", "OSS Driver", MB_OK); return 1;
58     case DRV_INSTALL:           return DRVCNF_RESTART;
59     case DRV_REMOVE:            return DRVCNF_RESTART;
60     default:
61         return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
62     }
63 }
64
65