diff options
author | Christopher Faylor <me@cgf.cx> | 2001-04-16 03:27:16 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-04-16 03:27:16 +0000 |
commit | b0a50cf34c1646ca943983d7a34c57360ce062c1 (patch) | |
tree | a8f3a9042adc69c81af40cc88548e288c02d5b8f /winsup/cygwin/autoload.cc | |
parent | 9f42525632f6edb1ff93fba5a724b927dd983a19 (diff) | |
download | cygnal-b0a50cf34c1646ca943983d7a34c57360ce062c1.tar.gz cygnal-b0a50cf34c1646ca943983d7a34c57360ce062c1.tar.bz2 cygnal-b0a50cf34c1646ca943983d7a34c57360ce062c1.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/autoload.cc')
-rw-r--r-- | winsup/cygwin/autoload.cc | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index 831414b6d..8a99ea5d7 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -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) } } |