* autoload.cc: Add winmm functions needed by fhandler_dsp.cc.

* fhandler_dsp.cc: New file.  Implements OSS like /dev/dsp.
* include/sys/soundcard.h: New file.  User land includes for OSS /dev/dsp.
* fhandler.h: Add new class fhandler_dev_dsp and a FH_OSS_DSP definition.
* dtable.cc (dtable::build_fhandler): Allow creation of the /dev/dsp device.
* path.cc (windows_device_names): Add /dev/dsp into list of device names.
* Makefile.in (DLL_OFILES): Add fhandler_dsp.o.
This commit is contained in:
Christopher Faylor
2001-04-16 03:27:16 +00:00
parent 9f42525632
commit b0a50cf34c
8 changed files with 1979 additions and 11 deletions

View File

@ -102,6 +102,8 @@ LoadDLLinitfunc (netapi32)
netapi32_handle = h;
else if (! netapi32_handle)
api_fatal ("could not load netapi32.dll. %d", GetLastError ());
InterlockedDecrement (&here);
return 0;
}
@ -228,19 +230,38 @@ LoadDLLinitfunc (ole32)
LoadDLLinitfunc (kernel32)
{
extern void wsock_init ();
HANDLE h;
if ((h = LoadLibrary ("kernel32.dll")) != NULL)
kernel32_handle = h;
else if (!kernel32_handle)
api_fatal ("could not load wsock32.dll. Is TCP/IP installed?");
api_fatal ("could not load kernel32.dll, %E");
else
return 0; /* Already done by another thread? */
return 0;
}
LoadDLLinitfunc (winmm)
{
HANDLE h;
static NO_COPY LONG here = -1L;
while (InterlockedIncrement (&here))
{
InterlockedDecrement (&here);
Sleep (0);
}
if ((h = LoadLibrary ("winmm.dll")) != NULL)
winmm_handle = h;
else if (! winmm_handle)
api_fatal ("could not load winmm.dll. %d", GetLastError ());
InterlockedDecrement (&here);
return 0;
}
static void __stdcall dummy_autoload (void) __attribute__ ((unused));
static void __stdcall
dummy_autoload (void)
@ -396,5 +417,16 @@ LoadDLLfunc (CoCreateInstance, 20, ole32)
LoadDLLinit (kernel32)
LoadDLLfuncEx (SignalObjectAndWait, 16, kernel32, 1)
LoadDLLinit (winmm)
LoadDLLfuncEx (waveOutGetNumDevs, 0, winmm, 1)
LoadDLLfuncEx (waveOutOpen, 24, winmm, 1)
LoadDLLfuncEx (waveOutReset, 4, winmm, 1)
LoadDLLfuncEx (waveOutClose, 4, winmm, 1)
LoadDLLfuncEx (waveOutGetVolume, 8, winmm, 1)
LoadDLLfuncEx (waveOutSetVolume, 8, winmm, 1)
LoadDLLfuncEx (waveOutUnprepareHeader, 12, winmm, 1)
LoadDLLfuncEx (waveOutPrepareHeader, 12, winmm, 1)
LoadDLLfuncEx (waveOutWrite, 12, winmm, 1)
}
}