richedit: Empty text should result in a scroll range of 0. Tests for this behavior.
[wine] / dlls / wineoss.drv / 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  * 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.
11  *
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.
16  *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 #include "config.h"
23
24 #include <stdarg.h>
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winuser.h"
30 #include "mmddk.h"
31 #include "oss.h"
32 #include "wine/debug.h"
33
34 WINE_DEFAULT_DEBUG_CHANNEL(wave);
35
36 #ifdef HAVE_OSS
37
38 /**************************************************************************
39  *                              OSS_drvLoad                     [internal]
40  */
41 static LRESULT OSS_drvLoad(void)
42 {
43     TRACE("()\n");
44     OSS_WaveInit();
45     OSS_MidiInit();
46     OSS_MixerInit();
47     OSS_AuxInit();
48     return 1;
49 }
50
51 /**************************************************************************
52  *                              OSS_drvFree                     [internal]
53  */
54 static LRESULT OSS_drvFree(void)
55 {
56     TRACE("()\n");
57     OSS_WaveExit();
58     OSS_MidiExit();
59     OSS_MixerExit();
60     OSS_AuxExit();
61     return 1;
62 }
63
64 /**************************************************************************
65  *                              OSS_drvOpen                     [internal]
66  */
67 static LRESULT OSS_drvOpen(LPSTR str)
68 {
69     TRACE("(%s)\n", str);
70     return 1;
71 }
72
73 /**************************************************************************
74  *                              OSS_drvClose                    [internal]
75  */
76 static LRESULT OSS_drvClose(DWORD_PTR dwDevID)
77 {
78     TRACE("(%08lx)\n", dwDevID);
79     return 1;
80 }
81
82 #endif
83
84
85 /**************************************************************************
86  *                              DriverProc (WINEOSS.1)
87  */
88 LRESULT CALLBACK OSS_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
89                                 LPARAM dwParam1, LPARAM dwParam2)
90 {
91      TRACE("(%08lX, %p, %08X, %08lX, %08lX)\n",
92            dwDevID, hDriv, wMsg, dwParam1, dwParam2);
93
94     switch(wMsg) {
95 #ifdef HAVE_OSS
96     case DRV_LOAD:              return OSS_drvLoad();
97     case DRV_FREE:              return OSS_drvFree();
98     case DRV_OPEN:              return OSS_drvOpen((LPSTR)dwParam1);
99     case DRV_CLOSE:             return OSS_drvClose(dwDevID);
100     case DRV_ENABLE:            return 1;
101     case DRV_DISABLE:           return 1;
102     case DRV_QUERYCONFIGURE:    return 1;
103     case DRV_CONFIGURE:         MessageBoxA(0, "OSS MultiMedia Driver !", "OSS Driver", MB_OK); return 1;
104     case DRV_INSTALL:           return DRVCNF_RESTART;
105     case DRV_REMOVE:            return DRVCNF_RESTART;
106 #endif
107     default:
108         return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
109     }
110 }