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
bf4481d3
Commit
bf4481d3
authored
Jul 19, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Merge the DirectSound create functions.
parent
8978a4b5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
77 deletions
+25
-77
dsound.c
dlls/dsound/dsound.c
+20
-72
dsound_main.c
dlls/dsound/dsound_main.c
+2
-2
dsound_private.h
dlls/dsound/dsound_private.h
+2
-2
duplex.c
dlls/dsound/duplex.c
+1
-1
No files found.
dlls/dsound/dsound.c
View file @
bf4481d3
...
@@ -583,9 +583,12 @@ static HRESULT IDirectSound8_IDirectSound8_Create(
...
@@ -583,9 +583,12 @@ static HRESULT IDirectSound8_IDirectSound8_Create(
return
DS_OK
;
return
DS_OK
;
}
}
static
HRESULT
IDirectSoundImpl_Create
(
void
**
ppv
,
BOOL
has_ds8
)
static
HRESULT
IDirectSoundImpl_Create
(
REFIID
riid
,
void
**
ppv
,
BOOL
has_ds8
)
{
{
IDirectSoundImpl
*
obj
;
IDirectSoundImpl
*
obj
;
HRESULT
hr
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
*
ppv
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
));
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
));
...
@@ -594,48 +597,28 @@ static HRESULT IDirectSoundImpl_Create(void **ppv, BOOL has_ds8)
...
@@ -594,48 +597,28 @@ static HRESULT IDirectSoundImpl_Create(void **ppv, BOOL has_ds8)
return
DSERR_OUTOFMEMORY
;
return
DSERR_OUTOFMEMORY
;
}
}
setup_dsound_options
();
obj
->
IUnknown_iface
.
lpVtbl
=
&
unk_vtbl
;
obj
->
IUnknown_iface
.
lpVtbl
=
&
unk_vtbl
;
obj
->
ref
=
0
;
obj
->
ref
=
1
;
obj
->
numIfaces
=
0
;
obj
->
numIfaces
=
1
;
obj
->
device
=
NULL
;
obj
->
device
=
NULL
;
obj
->
has_ds8
=
has_ds8
;
obj
->
has_ds8
=
has_ds8
;
*
ppv
=
obj
;
hr
=
IUnknown_QueryInterface
(
&
obj
->
IUnknown_iface
,
riid
,
ppv
);
return
DS_OK
;
IUnknown_Release
(
&
obj
->
IUnknown_iface
);
return
hr
;
}
}
HRESULT
DSOUND_Create
(
HRESULT
DSOUND_Create
(
REFIID
riid
,
void
**
ppv
)
REFIID
riid
,
LPDIRECTSOUND
*
ppDS
)
{
{
LPDIRECTSOUND8
pDS
;
return
IDirectSoundImpl_Create
(
riid
,
ppv
,
FALSE
);
HRESULT
hr
;
}
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppDS
);
if
(
!
IsEqualIID
(
riid
,
&
IID_IUnknown
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDirectSound
))
{
*
ppDS
=
0
;
return
E_NOINTERFACE
;
}
/* Get dsound configuration */
setup_dsound_options
();
hr
=
IDirectSoundImpl_Create
((
void
**
)
&
pDS
,
FALSE
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSound_IDirectSound_Create
(
pDS
,
ppDS
);
if
(
*
ppDS
)
IDirectSound_IDirectSound_AddRef
(
*
ppDS
);
else
{
WARN
(
"IDirectSound_IDirectSound_Create failed
\n
"
);
IDirectSound8_Release
(
pDS
);
}
}
else
{
WARN
(
"IDirectSoundImpl_Create failed
\n
"
);
*
ppDS
=
0
;
}
return
hr
;
HRESULT
DSOUND_Create8
(
REFIID
riid
,
void
**
ppv
)
{
return
IDirectSoundImpl_Create
(
riid
,
ppv
,
TRUE
);
}
}
/*******************************************************************************
/*******************************************************************************
...
@@ -674,7 +657,7 @@ HRESULT WINAPI DirectSoundCreate(
...
@@ -674,7 +657,7 @@ HRESULT WINAPI DirectSoundCreate(
return
DSERR_INVALIDPARAM
;
return
DSERR_INVALIDPARAM
;
}
}
hr
=
DSOUND_Create
(
&
IID_IDirectSound
,
&
pDS
);
hr
=
DSOUND_Create
(
&
IID_IDirectSound
,
(
void
**
)
&
pDS
);
if
(
hr
==
DS_OK
)
{
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSound_Initialize
(
pDS
,
lpcGUID
);
hr
=
IDirectSound_Initialize
(
pDS
,
lpcGUID
);
if
(
hr
!=
DS_OK
)
{
if
(
hr
!=
DS_OK
)
{
...
@@ -691,41 +674,6 @@ HRESULT WINAPI DirectSoundCreate(
...
@@ -691,41 +674,6 @@ HRESULT WINAPI DirectSoundCreate(
return
hr
;
return
hr
;
}
}
HRESULT
DSOUND_Create8
(
REFIID
riid
,
LPDIRECTSOUND8
*
ppDS
)
{
LPDIRECTSOUND8
pDS
;
HRESULT
hr
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppDS
);
if
(
!
IsEqualIID
(
riid
,
&
IID_IUnknown
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDirectSound
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDirectSound8
))
{
*
ppDS
=
0
;
return
E_NOINTERFACE
;
}
/* Get dsound configuration */
setup_dsound_options
();
hr
=
IDirectSoundImpl_Create
((
void
**
)
&
pDS
,
TRUE
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSound8_IDirectSound8_Create
(
pDS
,
ppDS
);
if
(
*
ppDS
)
IDirectSound8_IDirectSound8_AddRef
(
*
ppDS
);
else
{
WARN
(
"IDirectSound8_IDirectSound8_Create failed
\n
"
);
IDirectSound8_Release
(
pDS
);
}
}
else
{
WARN
(
"IDirectSoundImpl_Create failed
\n
"
);
*
ppDS
=
0
;
}
return
hr
;
}
/*******************************************************************************
/*******************************************************************************
* DirectSoundCreate8 (DSOUND.11)
* DirectSoundCreate8 (DSOUND.11)
*
*
...
@@ -762,7 +710,7 @@ HRESULT WINAPI DirectSoundCreate8(
...
@@ -762,7 +710,7 @@ HRESULT WINAPI DirectSoundCreate8(
return
DSERR_INVALIDPARAM
;
return
DSERR_INVALIDPARAM
;
}
}
hr
=
DSOUND_Create8
(
&
IID_IDirectSound8
,
&
pDS
);
hr
=
DSOUND_Create8
(
&
IID_IDirectSound8
,
(
void
**
)
&
pDS
);
if
(
hr
==
DS_OK
)
{
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSound8_Initialize
(
pDS
,
lpcGUID
);
hr
=
IDirectSound8_Initialize
(
pDS
,
lpcGUID
);
if
(
hr
!=
DS_OK
)
{
if
(
hr
!=
DS_OK
)
{
...
...
dlls/dsound/dsound_main.c
View file @
bf4481d3
...
@@ -719,8 +719,8 @@ static const IClassFactoryVtbl DSCF_Vtbl = {
...
@@ -719,8 +719,8 @@ static const IClassFactoryVtbl DSCF_Vtbl = {
};
};
static
IClassFactoryImpl
DSOUND_CF
[]
=
{
static
IClassFactoryImpl
DSOUND_CF
[]
=
{
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSound
,
(
FnCreateInstance
)
DSOUND_Create
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSound
,
DSOUND_Create
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSound8
,
(
FnCreateInstance
)
DSOUND_Create8
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSound8
,
DSOUND_Create8
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundCapture
,
(
FnCreateInstance
)
DSOUND_CaptureCreate
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundCapture
,
(
FnCreateInstance
)
DSOUND_CaptureCreate
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundCapture8
,
(
FnCreateInstance
)
DSOUND_CaptureCreate8
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundCapture8
,
(
FnCreateInstance
)
DSOUND_CaptureCreate8
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundFullDuplex
,
(
FnCreateInstance
)
DSOUND_FullDuplexCreate
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundFullDuplex
,
(
FnCreateInstance
)
DSOUND_FullDuplexCreate
},
...
...
dlls/dsound/dsound_private.h
View file @
bf4481d3
...
@@ -264,8 +264,8 @@ HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, IKsPropertySet **piks) DEC
...
@@ -264,8 +264,8 @@ HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, IKsPropertySet **piks) DEC
/* dsound.c */
/* dsound.c */
HRESULT
DSOUND_Create
(
REFIID
riid
,
LPDIRECTSOUND
*
ppDS
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_Create
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_Create8
(
REFIID
riid
,
LPDIRECTSOUND8
*
ppDS
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_Create8
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
/* primary.c */
/* primary.c */
...
...
dlls/dsound/duplex.c
View file @
bf4481d3
...
@@ -557,7 +557,7 @@ IDirectSoundFullDuplexImpl_Initialize(
...
@@ -557,7 +557,7 @@ IDirectSoundFullDuplexImpl_Initialize(
return
DSERR_ALREADYINITIALIZED
;
return
DSERR_ALREADYINITIALIZED
;
}
}
hr
=
DSOUND_Create8
(
&
IID_IDirectSound8
,
&
This
->
renderer_device
);
hr
=
DSOUND_Create8
(
&
IID_IDirectSound8
,
(
void
**
)
&
This
->
renderer_device
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
hr
=
IDirectSound_Initialize
(
This
->
renderer_device
,
pRendererGuid
);
hr
=
IDirectSound_Initialize
(
This
->
renderer_device
,
pRendererGuid
);
if
(
hr
!=
DS_OK
)
{
if
(
hr
!=
DS_OK
)
{
...
...
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