Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c7a59d11
Commit
c7a59d11
authored
Dec 08, 2005
by
Robert Reif
Committed by
Alexandre Julliard
Dec 08, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss: Fix device probing.
- Fix device probing at driver load time. - Fix memory leaks at driver exit time.
parent
db50e2d9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
113 additions
and
24 deletions
+113
-24
audio.c
dlls/winmm/wineoss/audio.c
+28
-1
midi.c
dlls/winmm/wineoss/midi.c
+26
-7
mixer.c
dlls/winmm/wineoss/mixer.c
+2
-4
mmaux.c
dlls/winmm/wineoss/mmaux.c
+11
-4
oss.c
dlls/winmm/wineoss/oss.c
+35
-6
oss.h
dlls/winmm/wineoss/oss.h
+11
-2
No files found.
dlls/winmm/wineoss/audio.c
View file @
c7a59d11
...
...
@@ -1078,7 +1078,7 @@ static char* StrDup(const char* str, const char* def)
*
* Initialize internal structures from OSS information
*/
L
ONG
OSS_WaveInit
(
void
)
L
RESULT
OSS_WaveInit
(
void
)
{
char
*
str
;
int
i
;
...
...
@@ -1159,6 +1159,33 @@ LONG OSS_WaveInit(void)
}
/******************************************************************
* OSS_WaveExit
*
* Delete/clear internal structures of OSS information
*/
LRESULT
OSS_WaveExit
(
void
)
{
int
i
;
TRACE
(
"()
\n
"
);
for
(
i
=
0
;
i
<
MAX_WAVEDRV
;
++
i
)
{
HeapFree
(
GetProcessHeap
(),
0
,
OSS_Devices
[
i
].
dev_name
);
HeapFree
(
GetProcessHeap
(),
0
,
OSS_Devices
[
i
].
mixer_name
);
HeapFree
(
GetProcessHeap
(),
0
,
OSS_Devices
[
i
].
interface_name
);
}
ZeroMemory
(
OSS_Devices
,
sizeof
(
OSS_Devices
));
ZeroMemory
(
WOutDev
,
sizeof
(
WOutDev
));
ZeroMemory
(
WInDev
,
sizeof
(
WInDev
));
numOutDev
=
0
;
numInDev
=
0
;
return
0
;
}
/******************************************************************
* OSS_InitRingMessage
*
* Initialize the ring of messages for passing between driver's caller and playback/record
...
...
dlls/winmm/wineoss/midi.c
View file @
c7a59d11
...
...
@@ -176,7 +176,7 @@ static int MIDI_UnixToWindowsDeviceType(int type)
*
* Initializes the MIDI devices information variables
*/
BOOL
OSS_MidiInit
(
void
)
LRESULT
OSS_MidiInit
(
void
)
{
int
i
,
status
,
numsynthdevs
=
255
,
nummididevs
=
255
;
struct
synth_info
sinfo
;
...
...
@@ -184,14 +184,14 @@ BOOL OSS_MidiInit(void)
static
BOOL
bInitDone
=
FALSE
;
if
(
bInitDone
)
return
TRUE
;
return
0
;
TRACE
(
"Initializing the MIDI variables.
\n
"
);
bInitDone
=
TRUE
;
bInitDone
=
0
;
/* try to open device */
if
(
midiOpenSeq
()
==
-
1
)
{
return
TRUE
;
return
-
1
;
}
/* find how many Synth devices are there in the system */
...
...
@@ -200,7 +200,7 @@ BOOL OSS_MidiInit(void)
if
(
status
==
-
1
)
{
ERR
(
"ioctl for nr synth failed.
\n
"
);
midiCloseSeq
();
return
TRUE
;
return
-
1
;
}
if
(
numsynthdevs
>
MAX_MIDIOUTDRV
)
{
...
...
@@ -374,7 +374,26 @@ BOOL OSS_MidiInit(void)
/* close file and exit */
midiCloseSeq
();
return
TRUE
;
return
0
;
}
/**************************************************************************
* OSS_MidiExit [internal]
*
* Release the MIDI devices information variables
*/
LRESULT
OSS_MidiExit
(
void
)
{
TRACE
(
"()
\n
"
);
ZeroMemory
(
MidiInDev
,
sizeof
(
MidiInDev
));
ZeroMemory
(
MidiOutDev
,
sizeof
(
MidiOutDev
));
MODM_NumDevs
=
0
;
MODM_NumFMSynthDevs
=
0
;
MIDM_NumDevs
=
0
;
return
0
;
}
/**************************************************************************
...
...
@@ -1657,7 +1676,7 @@ static DWORD modReset(WORD wDevID)
#else
/* HAVE_OSS_MIDI */
BOOL
OSS_MidiInit
(
void
)
LRESULT
OSS_MidiInit
(
void
)
{
return
FALSE
;
}
...
...
dlls/winmm/wineoss/mixer.c
View file @
c7a59d11
...
...
@@ -1437,7 +1437,7 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd,
/**************************************************************************
* MIX_Init [internal]
*/
static
DWORD
MIX_
Init
(
void
)
LRESULT
OSS_Mixer
Init
(
void
)
{
int
i
,
mixer
;
...
...
@@ -1489,7 +1489,7 @@ static DWORD MIX_Init(void)
/**************************************************************************
* MIX_Exit [internal]
*/
static
DWORD
MIX_
Exit
(
void
)
LRESULT
OSS_Mixer
Exit
(
void
)
{
int
i
;
...
...
@@ -1528,9 +1528,7 @@ DWORD WINAPI OSS_mxdMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
switch
(
wMsg
)
{
case
DRVM_INIT
:
return
MIX_Init
();
case
DRVM_EXIT
:
return
MIX_Exit
();
case
DRVM_ENABLE
:
case
DRVM_DISABLE
:
/* FIXME: Pretend this is supported */
...
...
dlls/winmm/wineoss/mmaux.c
View file @
c7a59d11
...
...
@@ -49,9 +49,10 @@ static int NumDev = 6;
/*-----------------------------------------------------------------------*/
static
int
AUXDRV_
Init
(
void
)
LRESULT
OSS_Aux
Init
(
void
)
{
int
mixer
;
TRACE
(
"()
\n
"
);
if
((
mixer
=
open
(
MIXER_DEV
,
O_RDWR
))
<
0
)
{
WARN
(
"mixer device not available !
\n
"
);
...
...
@@ -60,7 +61,15 @@ static int AUXDRV_Init(void)
close
(
mixer
);
NumDev
=
6
;
}
return
NumDev
;
return
0
;
}
/*-----------------------------------------------------------------------*/
LRESULT
OSS_AuxExit
(
void
)
{
TRACE
(
"()
\n
"
);
return
0
;
}
/**************************************************************************
...
...
@@ -219,8 +228,6 @@ DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
#ifdef HAVE_OSS
switch
(
wMsg
)
{
case
DRVM_INIT
:
AUXDRV_Init
();
/* fall through */
case
DRVM_EXIT
:
case
DRVM_ENABLE
:
case
DRVM_DISABLE
:
...
...
dlls/winmm/wineoss/oss.c
View file @
c7a59d11
...
...
@@ -29,14 +29,44 @@
#include "winuser.h"
#include "mmddk.h"
#include "oss.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wave
);
#ifdef HAVE_OSS
/**************************************************************************
* OSS_drvLoad [internal]
*/
static
LRESULT
OSS_drvLoad
(
void
)
{
TRACE
(
"()
\n
"
);
OSS_WaveInit
();
OSS_MidiInit
();
OSS_MixerInit
();
OSS_AuxInit
();
return
1
;
}
/**************************************************************************
* OSS_drvFree [internal]
*/
static
LRESULT
OSS_drvFree
(
void
)
{
TRACE
(
"()
\n
"
);
OSS_WaveExit
();
OSS_MidiExit
();
OSS_MixerExit
();
OSS_AuxExit
();
return
1
;
}
/**************************************************************************
* OSS_drvOpen [internal]
*/
static
LRESULT
OSS_drvOpen
(
LPSTR
str
)
{
TRACE
(
"(%s)
\n
"
,
str
);
return
1
;
}
...
...
@@ -45,6 +75,7 @@ static LRESULT OSS_drvOpen(LPSTR str)
*/
static
LRESULT
OSS_drvClose
(
DWORD_PTR
dwDevID
)
{
TRACE
(
"(%08lx)
\n
"
,
dwDevID
);
return
1
;
}
...
...
@@ -57,15 +88,13 @@ static LRESULT OSS_drvClose(DWORD_PTR dwDevID)
LRESULT
CALLBACK
OSS_DriverProc
(
DWORD_PTR
dwDevID
,
HDRVR
hDriv
,
UINT
wMsg
,
LPARAM
dwParam1
,
LPARAM
dwParam2
)
{
/* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */
/* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
TRACE
(
"(%08lX, %p, %08X, %08lX, %08lX)
\n
"
,
dwDevID
,
hDriv
,
wMsg
,
dwParam1
,
dwParam2
);
switch
(
wMsg
)
{
#ifdef HAVE_OSS
case
DRV_LOAD
:
OSS_WaveInit
();
OSS_MidiInit
();
return
1
;
case
DRV_FREE
:
return
1
;
case
DRV_LOAD
:
return
OSS_drvLoad
();
case
DRV_FREE
:
return
OSS_drvFree
();
case
DRV_OPEN
:
return
OSS_drvOpen
((
LPSTR
)
dwParam1
);
case
DRV_CLOSE
:
return
OSS_drvClose
(
dwDevID
);
case
DRV_ENABLE
:
return
1
;
...
...
dlls/winmm/wineoss/oss.h
View file @
c7a59d11
...
...
@@ -38,5 +38,14 @@
# define HAVE_OSS
#endif
extern
LONG
OSS_WaveInit
(
void
);
extern
BOOL
OSS_MidiInit
(
void
);
LRESULT
OSS_WaveInit
(
void
);
LRESULT
OSS_WaveExit
(
void
);
LRESULT
OSS_MidiInit
(
void
);
LRESULT
OSS_MidiExit
(
void
);
LRESULT
OSS_MixerInit
(
void
);
LRESULT
OSS_MixerExit
(
void
);
LRESULT
OSS_AuxInit
(
void
);
LRESULT
OSS_AuxExit
(
void
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment