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
6a7c2f66
Commit
6a7c2f66
authored
Oct 17, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Oct 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Don't make the capture buffer object address public until it is prepared.
parent
c60583ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
capture.c
dlls/dsound/capture.c
+8
-15
No files found.
dlls/dsound/capture.c
View file @
6a7c2f66
...
@@ -680,6 +680,7 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
...
@@ -680,6 +680,7 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
LPCDSCBUFFERDESC
lpcDSCBufferDesc
)
LPCDSCBUFFERDESC
lpcDSCBufferDesc
)
{
{
LPWAVEFORMATEX
wfex
;
LPWAVEFORMATEX
wfex
;
IDirectSoundCaptureBufferImpl
*
This
;
TRACE
(
"(%p,%p,%p)
\n
"
,
device
,
ppobj
,
lpcDSCBufferDesc
);
TRACE
(
"(%p,%p,%p)
\n
"
,
device
,
ppobj
,
lpcDSCBufferDesc
);
if
(
ppobj
==
NULL
)
{
if
(
ppobj
==
NULL
)
{
...
@@ -687,15 +688,15 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
...
@@ -687,15 +688,15 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
return
DSERR_INVALIDPARAM
;
return
DSERR_INVALIDPARAM
;
}
}
*
ppobj
=
NULL
;
if
(
!
device
)
{
if
(
!
device
)
{
WARN
(
"not initialized
\n
"
);
WARN
(
"not initialized
\n
"
);
*
ppobj
=
NULL
;
return
DSERR_UNINITIALIZED
;
return
DSERR_UNINITIALIZED
;
}
}
if
(
lpcDSCBufferDesc
==
NULL
)
{
if
(
lpcDSCBufferDesc
==
NULL
)
{
WARN
(
"invalid parameter: lpcDSCBufferDesc == NULL
\n
"
);
WARN
(
"invalid parameter: lpcDSCBufferDesc == NULL
\n
"
);
*
ppobj
=
NULL
;
return
DSERR_INVALIDPARAM
;
return
DSERR_INVALIDPARAM
;
}
}
...
@@ -704,7 +705,6 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
...
@@ -704,7 +705,6 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
(
lpcDSCBufferDesc
->
dwBufferBytes
==
0
)
||
(
lpcDSCBufferDesc
->
dwBufferBytes
==
0
)
||
(
lpcDSCBufferDesc
->
lpwfxFormat
==
NULL
)
)
{
/* FIXME: DSERR_BADFORMAT ? */
(
lpcDSCBufferDesc
->
lpwfxFormat
==
NULL
)
)
{
/* FIXME: DSERR_BADFORMAT ? */
WARN
(
"invalid lpcDSCBufferDesc
\n
"
);
WARN
(
"invalid lpcDSCBufferDesc
\n
"
);
*
ppobj
=
NULL
;
return
DSERR_INVALIDPARAM
;
return
DSERR_INVALIDPARAM
;
}
}
...
@@ -717,23 +717,19 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
...
@@ -717,23 +717,19 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
wfex
->
wBitsPerSample
,
wfex
->
cbSize
);
wfex
->
wBitsPerSample
,
wfex
->
cbSize
);
device
->
pwfx
=
DSOUND_CopyFormat
(
wfex
);
device
->
pwfx
=
DSOUND_CopyFormat
(
wfex
);
if
(
device
->
pwfx
==
NULL
)
{
if
(
device
->
pwfx
==
NULL
)
*
ppobj
=
NULL
;
return
DSERR_OUTOFMEMORY
;
return
DSERR_OUTOFMEMORY
;
}
*
ppobj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectSoundCaptureBufferImpl
));
sizeof
(
IDirectSoundCaptureBufferImpl
));
if
(
*
ppobj
==
NULL
)
{
if
(
This
==
NULL
)
{
WARN
(
"out of memory
\n
"
);
WARN
(
"out of memory
\n
"
);
*
ppobj
=
NULL
;
return
DSERR_OUTOFMEMORY
;
return
DSERR_OUTOFMEMORY
;
}
else
{
}
else
{
HRESULT
err
=
DS_OK
;
HRESULT
err
=
DS_OK
;
LPBYTE
newbuf
;
LPBYTE
newbuf
;
DWORD
buflen
;
DWORD
buflen
;
IDirectSoundCaptureBufferImpl
*
This
=
*
ppobj
;
This
->
ref
=
1
;
This
->
ref
=
1
;
This
->
device
=
device
;
This
->
device
=
device
;
...
@@ -749,7 +745,6 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
...
@@ -749,7 +745,6 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
WARN
(
"no memory
\n
"
);
WARN
(
"no memory
\n
"
);
This
->
device
->
capture_buffer
=
0
;
This
->
device
->
capture_buffer
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
*
ppobj
=
NULL
;
return
DSERR_OUTOFMEMORY
;
return
DSERR_OUTOFMEMORY
;
}
}
...
@@ -762,7 +757,6 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
...
@@ -762,7 +757,6 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pdscbd
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pdscbd
);
This
->
device
->
capture_buffer
=
0
;
This
->
device
->
capture_buffer
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
*
ppobj
=
NULL
;
return
err
;
return
err
;
}
}
...
@@ -776,7 +770,6 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
...
@@ -776,7 +770,6 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pdscbd
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pdscbd
);
This
->
device
->
capture_buffer
=
0
;
This
->
device
->
capture_buffer
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
*
ppobj
=
NULL
;
return
err
;
return
err
;
}
}
...
@@ -789,7 +782,6 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
...
@@ -789,7 +782,6 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pdscbd
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pdscbd
);
This
->
device
->
capture_buffer
=
0
;
This
->
device
->
capture_buffer
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
*
ppobj
=
NULL
;
return
err
;
return
err
;
}
}
...
@@ -807,13 +799,14 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
...
@@ -807,13 +799,14 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pdscbd
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pdscbd
);
This
->
device
->
capture_buffer
=
0
;
This
->
device
->
capture_buffer
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
*
ppobj
=
NULL
;
return
DSERR_OUTOFMEMORY
;
return
DSERR_OUTOFMEMORY
;
}
}
device
->
buffer
=
newbuf
;
device
->
buffer
=
newbuf
;
device
->
buflen
=
buflen
;
device
->
buflen
=
buflen
;
}
}
*
ppobj
=
This
;
TRACE
(
"returning DS_OK
\n
"
);
TRACE
(
"returning DS_OK
\n
"
);
return
DS_OK
;
return
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