Don't return from overlapped ReadFile on EAGAIN and other non-fatal
[wine/gsoc_dplay.git] / dlls / winmm / wineoss / oss.c
blobbf8367e8e408001371284e6173c45fe10f5703c4
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
2 /*
3 * Wine Driver for Open Sound System
5 * Copyright 1999 Eric Pouech
6 */
8 #include "config.h"
10 #include "windef.h"
11 #include "winbase.h"
12 #include "wingdi.h"
13 #include "winuser.h"
14 #include "mmddk.h"
15 #include "oss.h"
17 #ifdef HAVE_OSS
19 static struct WINE_OSS* oss = NULL;
21 /**************************************************************************
22 * OSS_drvOpen [internal]
24 static DWORD OSS_drvOpen(LPSTR str)
26 if (oss)
27 return 0;
29 /* I know, this is ugly, but who cares... */
30 oss = (struct WINE_OSS*)1;
31 return 1;
34 /**************************************************************************
35 * OSS_drvClose [internal]
37 static DWORD OSS_drvClose(DWORD dwDevID)
39 if (oss) {
40 oss = NULL;
41 return 1;
43 return 0;
46 #endif
49 /**************************************************************************
50 * DriverProc (WINEOSS.1)
52 LONG CALLBACK OSS_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
53 DWORD dwParam1, DWORD dwParam2)
55 /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */
56 /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
58 switch(wMsg) {
59 #ifdef HAVE_OSS
60 case DRV_LOAD: OSS_WaveInit();
61 #ifdef HAVE_OSS_MIDI
62 OSS_MidiInit();
63 #endif
64 return 1;
65 case DRV_FREE: return 1;
66 case DRV_OPEN: return OSS_drvOpen((LPSTR)dwParam1);
67 case DRV_CLOSE: return OSS_drvClose(dwDevID);
68 case DRV_ENABLE: return 1;
69 case DRV_DISABLE: return 1;
70 case DRV_QUERYCONFIGURE: return 1;
71 case DRV_CONFIGURE: MessageBoxA(0, "OSS MultiMedia Driver !", "OSS Driver", MB_OK); return 1;
72 case DRV_INSTALL: return DRVCNF_RESTART;
73 case DRV_REMOVE: return DRVCNF_RESTART;
74 #endif
75 default:
76 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);