Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
The IDsCaptureDriver::CreateCaptureBuffermethod is called only when the device has been opened by DirectSound through a call to IDsCaptureDriver::Open. DirectSound calls this method to request the driver to create a hardware sound capture buffer with specific attributes. If the driver is able to create the sound buffer and allocate the required resources, it returns a pointer to an IDsCaptureDriverBufferinterface that DirectSound uses to control the sound capture buffer. Otherwise the driver fails the request by returning an error code.
HRESULT CreateCaptureBuffer( LPWAVEFORMATEX pwfx , DWORD dwFlags , DWORD dwCardAddress , LPDWORD pdwcbBufferSize , LPBYTE * ppbBuffer , LPVOID * ppvObj );
Parameters
Return Values
Returns DS_OK if successful, or one of the following error values otherwise:
Remarks
The requested size of the buffer is passed in a doubleword pointed to by the lpdwRequestedSizeparameter. If the driver does not specify the DSDDESC_USESYSTEMMEMORY flag, no memory is allocated and the ppbBufferparameter points to a NULL pointer. The driver should allocate the required buffer memory and return a pointer to this memory in the value pointed to by ppbBuffer.
If the device has onboard sound memory and the driver requests that DirectSound or DirectDraw manage the heap (that is, the driver fills in the dwMemStartAddressand dwMemEndAddressmembers and specifies the DSDHEAP_CREATEHEAP or DSDHEAP_USEDIRECTDRAWHEAP flags in the DSDRIVERDESCstructure), this method points to the card address of the sound memory to be used by this buffer. DirectSound guarantees that this memory is free and is large enough to contain the buffer. Otherwise this parameter is set to zero.
Due to internal contention-management code in DirectSound, drivers should always make sure that the buffer memory for primary buffers is page-locked.
Last updated on Tuesday, July 13, 2004