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 IDirectSoundBuffer::Restoremethod restores the memory allocation for a lost sound buffer for the specified DirectSoundBuffer object.
HRESULT Restore();
Parameters
None
Return Values
If the method succeeds, the return value is DS_OK.
If the method fails, the return value may be one of the following error values:
Remarks
If the application does not have the input focus, IDirectSoundBuffer::Restoremight not succeed. For example, if the application with the input focus has the DSSCL_WRITEPRIMARY cooperative level, no other application will be able to restore its buffers. Similarly, an application with the DSSCL_WRITEPRIMARY cooperative level must have the input focus to restore its primary sound buffer.
Once DirectSound restores the buffer memory, the application must rewrite the buffer with valid sound data. DirectSound cannot restore the contents of the memory, only the memory itself.
The application can receive notification that a buffer is lost when it specifies that buffer in a call to the IDirectSoundBuffer::Lockor IDirectSoundBuffer::Playmethod. These methods return DSERR_BUFFERLOSTto indicate a lost buffer. The IDirectSoundBuffer::GetStatusmethod can also be used to retrieve the status of the sound buffer and test for the DSBSTATUS_BUFFERLOST flag.
On Windows CE, no buffers are lost and it is never necessary to call Restore. This method always returns DS_OK.
Requirements
Runs On | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 2.12 or later. Version 2.12 requires DXPAK 1.0 or later. | dsound.h | dsound.lib |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
IDirectSoundBuffer, IDirectSoundBuffer::Lock, IDirectSoundBuffer::Play, IDirectSoundBuffer::GetStatus