Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
18 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dpvxerr.cpp
  6. * Content: Useful Error utility functions lib for sample apps
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 10/07/99 rodtoll Created It
  12. * 11/17/99 rodtoll Adding new error codes
  13. * 12/07/99 rodtoll Bug #122628 Make error messages silent when running in silent mode
  14. * Added option to error display to have it be silent.
  15. * 12/16/99 rodtoll Bug #119584 - Error code cleanup - Renamed runsetup error
  16. * 02/08/2000 rodtoll Updated for API changes (overdue)
  17. *
  18. ***************************************************************************/
  19. #include "dpvxlibpch.h"
  20. DPVDXLIB_ErrorInfo eiDirectPlayVoiceErrors[] =
  21. {
  22. DPVDXLIB_ErrorInfo( DV_OK, _T("DV_OK"), _T("") ),
  23. DPVDXLIB_ErrorInfo( DVERR_OUTOFMEMORY, _T("DVERR_OUTOFMEMORY"), _T("Out of memory") ),
  24. DPVDXLIB_ErrorInfo( DVERR_PENDING, _T("DVERR_PENDING"), _T("Operation is pending") ),
  25. DPVDXLIB_ErrorInfo( DVERR_NOTSUPPORTED, _T("DVERR_UNSUPPORTED"), _T("Operation is not supported") ),
  26. DPVDXLIB_ErrorInfo( DVERR_NOINTERFACE, _T("DVERR_NOINTERFACE"), _T("Specified interface is not supported, Wrong Version of Dplay?") ),
  27. DPVDXLIB_ErrorInfo( DVERR_INVALIDPARAM, _T("DVERR_INVALIDPARAM"), _T("One or more of the specified parameters is not valid") ),
  28. DPVDXLIB_ErrorInfo( DVERR_GENERIC, _T("DVERR_GENERIC"), _T("An undefined error condition occured.") ),
  29. DPVDXLIB_ErrorInfo( DV_FULLDUPLEX, _T("DV_FULLDUPLEX"), _T("Your soundcard is capable of full duplex operation." )),
  30. DPVDXLIB_ErrorInfo( DV_HALFDUPLEX, _T("DV_HALFDUPLEX"), _T("Your soundcard can only run in half duplex mode.") ),
  31. DPVDXLIB_ErrorInfo( DVERR_BUFFERTOOSMALL, _T("DVERR_BUFFERTOOSMALL"), _T("The supplied buffer is not large enough to contain the requested data.") ),
  32. DPVDXLIB_ErrorInfo( DVERR_EXCEPTION, _T("DVERR_EXCEPTION"), _T("An exception occured when processing the request.") ),
  33. DPVDXLIB_ErrorInfo( DVERR_INVALIDFLAGS, _T("DVERR_INVALIDFLAGS"), _T("The flags passed to this method are invalid.") ),
  34. DPVDXLIB_ErrorInfo( DVERR_INVALIDOBJECT, _T("DVERR_INVALIDOBJECT"), _T("The DirectPlayVoice pointer is invalid.") ),
  35. DPVDXLIB_ErrorInfo( DVERR_INVALIDPLAYER, _T("DVERR_INVALIDPLAYER"), _T("The player ID is not recognized as a valid ID for this voice session.") ),
  36. DPVDXLIB_ErrorInfo( DVERR_INVALIDGROUP, _T("DVERR_INVALIDGROUP"), _T("The group ID is not recognized as a valid group ID for the transport session.") ),
  37. DPVDXLIB_ErrorInfo( DVERR_INVALIDHANDLE, _T("DVERR_INVALIDHANDLE"), _T("The specified handle is not valid.") ),
  38. DPVDXLIB_ErrorInfo( DVERR_SESSIONLOST, _T("DVERR_SESSIONLOST"), _T("The transport has lost the connection to the session.") ),
  39. DPVDXLIB_ErrorInfo( DVERR_NOVOICESESSION, _T("DVERR_NOVOICESESSION"), _T("") ),
  40. DPVDXLIB_ErrorInfo( DVERR_CONNECTIONLOST, _T("DVERR_CONNECTIONLOST"), _T("") ),
  41. DPVDXLIB_ErrorInfo( DVERR_NOTINITIALIZED, _T("DVERR_NOTINITIALIZED"), _T("Initialize() must be called before using this method.") ),
  42. DPVDXLIB_ErrorInfo( DVERR_CONNECTED, _T("DVERR_CONNECTED"), _T("The DirectPlayVoice object is connected.") ),
  43. DPVDXLIB_ErrorInfo( DVERR_NOTCONNECTED, _T("DVERR_NOTCONNECTED"), _T("The DirectPlayVoice object is not connected.") ),
  44. DPVDXLIB_ErrorInfo( DVERR_CONNECTABORTING, _T("DVERR_CONNECTABORTING"), _T("The connection is being disconnected.") ),
  45. DPVDXLIB_ErrorInfo( DVERR_NOTALLOWED, _T("DVERR_NOTALLOWED"), _T("The object does not have the permission to perform this operation.") ),
  46. DPVDXLIB_ErrorInfo( DVERR_INVALIDTARGET, _T("DVERR_INVALIDTARGET"), _T("The specified target is not a valid player ID or group ID for this voice session.") ),
  47. DPVDXLIB_ErrorInfo( DVERR_TRANSPORTNOTHOST, _T("DVERR_NOTTRANSPORTHOST"), _T("The object is not the host of the voice session.") ),
  48. DPVDXLIB_ErrorInfo( DVERR_COMPRESSIONNOTSUPPORTED, _T("DVERR_COMPRESSIONNOTSUPPORTED"), _T("The specified compression type is not supported on the local machine.") ),
  49. DPVDXLIB_ErrorInfo( DVERR_ALREADYPENDING, _T("DVERR_ALREADYPENDING"), _T("An ASYNC call of this type is already pending.") ),
  50. DPVDXLIB_ErrorInfo( DVERR_SOUNDINITFAILURE, _T("DVERR_SOUNDINITFAILURE"), _T("A failure was encountered initializing your soundcard.") ),
  51. DPVDXLIB_ErrorInfo( DVERR_TIMEOUT, _T("DVERR_TIMEOUT"), _T("The operation could not be performed in the specified time.") ),
  52. DPVDXLIB_ErrorInfo( DVERR_CONNECTABORTED, _T("DVERR_CONNECTABORTED"), _T("The connection was aborted.") ),
  53. DPVDXLIB_ErrorInfo( DVERR_NO3DSOUND, _T("DVERR_NO3DSOUND"), _T("The local machine does not support 3D sound.") ),
  54. DPVDXLIB_ErrorInfo( DVERR_ALREADYBUFFERED, _T("DVERR_ALREADYBUFFERED"), _T("There is already a UserBuffer for the specified ID.") ),
  55. DPVDXLIB_ErrorInfo( DVERR_NOTBUFFERED, _T("DVERR_NOTBUFFERED"), _T("There is no UserBuffer for the specified ID.") ),
  56. DPVDXLIB_ErrorInfo( DVERR_HOSTING, _T("DVERR_HOSTING"), _T("The object is the host of the session.") ),
  57. DPVDXLIB_ErrorInfo( DVERR_NOTHOSTING, _T("DVERR_NOTHOSTING"), _T("The object is not the host of the session.") ),
  58. DPVDXLIB_ErrorInfo( DVERR_INVALIDDEVICE, _T("DVERR_INVALIDDEVICE"), _T("The specified device is not valid.") ),
  59. DPVDXLIB_ErrorInfo( DVERR_RECORDSYSTEMERROR, _T("DVERR_RECORDSYSTEMERROR"), _T("An error in the recording system has occured.") ),
  60. DPVDXLIB_ErrorInfo( DVERR_PLAYBACKSYSTEMERROR, _T("DVERR_PLAYBACKSYSTEMERROR"), _T("An error in the playback system has occured.") ),
  61. DPVDXLIB_ErrorInfo( DVERR_SENDERROR, _T("DVERR_SENDERROR"), _T("An error occured while sending data.") ),
  62. DPVDXLIB_ErrorInfo( DVERR_USERCANCEL, _T("DVERR_USERCANCEL"), _T("") ),
  63. DPVDXLIB_ErrorInfo( DVERR_RUNSETUP,_T( "DVERR_RUNSETUP"), _T("") ),
  64. DPVDXLIB_ErrorInfo( DVERR_NOTRANSPORT,_T( "DVERR_NOTRANSPORT"), _T("The specified object is not a valid transport") ),
  65. DPVDXLIB_ErrorInfo( DVERR_NOCALLBACK,_T( "DVERR_NOCALLBACK"), _T("This operation cannot be performed because no callback function was specified") ),
  66. DPVDXLIB_ErrorInfo( DVERR_TRANSPORTNOTINIT,_T( "DVERR_TRANSPORTNOTINIT"), _T("Specified transport is not yet initialized") ),
  67. DPVDXLIB_ErrorInfo( DVERR_TRANSPORTNOSESSION,_T( "DVERR_TRANSPORTNOSESSION"), _T("Specified transport is valid but is not connected/hosting") ),
  68. DPVDXLIB_ErrorInfo( DVERR_TRANSPORTNOPLAYER,_T( "DVERR_TRANSPORTNOPLAYER"), _T("Specified transport is connected/hosting but no local player exists") ),
  69. DPVDXLIB_ErrorInfo( 0xFFFFFFFF, _T(""), _T("") )
  70. };
  71. DPVDXLIB_ErrorInfo eiDirectPlayErrors[] =
  72. {
  73. DPVDXLIB_ErrorInfo( DP_OK , _T("DP_OK"), _T("The request completed successfully.") ),
  74. DPVDXLIB_ErrorInfo( DPERR_ABORTED , _T("DPERR_ABORTED"), _T("The operation was canceled before it could be completed.") ),
  75. DPVDXLIB_ErrorInfo( DPERR_ACCESSDENIED , _T("DPERR_ACCESSDENIED"), _T("The session is full, or an incorrect password was supplied.") ),
  76. DPVDXLIB_ErrorInfo( DPERR_ACTIVEPLAYERS , _T("DPERR_ACTIVEPLAYERS"), _T("The requested operation cannot be performed because there are existing active players.") ),
  77. DPVDXLIB_ErrorInfo( DPERR_ALREADYINITIALIZED, _T("DPERR_ALREADYINITIALIZED"), _T("This object is already initialized.") ),
  78. DPVDXLIB_ErrorInfo( DPERR_APPNOTSTARTED, _T("DPERR_APPNOTSTARTED"), _T("The application has not been started yet. ") ),
  79. DPVDXLIB_ErrorInfo( DPERR_AUTHENTICATIONFAILED, _T("DPERR_AUTHENTICATIONFAILED"), _T("The password or credentials supplied could not be authenticated.") ),
  80. DPVDXLIB_ErrorInfo( DPERR_BUFFERTOOLARGE, _T("DPERR_BUFFERTOOLARGE"), _T("The data buffer is too large to store.") ),
  81. DPVDXLIB_ErrorInfo( DPERR_BUFFERTOOSMALL, _T("DPERR_BUFFERTOOSMALL"), _T("The supplied buffer is not large enough to contain the requested data.") ),
  82. DPVDXLIB_ErrorInfo( DPERR_BUSY, _T("DPERR_BUSY"), _T("A message cannot be sent because the transmission medium is busy.") ),
  83. DPVDXLIB_ErrorInfo( DPERR_CANCELFAILED, _T("DPERR_CANCELFAILED"), _T("The message could not be canceled, possibly because it is a group message that has already been to sent to one or more members of the group.") ),
  84. DPVDXLIB_ErrorInfo( DPERR_CANCELLED, _T("DPERR_CANCELLED"), _T("The operation was canceled.") ),
  85. DPVDXLIB_ErrorInfo( DPERR_CANNOTCREATESERVER, _T("DPERR_CANNOTCREATESERVER"), _T("The server cannot be created for the new session.") ),
  86. DPVDXLIB_ErrorInfo( DPERR_CANTADDPLAYER, _T("DPERR_CANTADDPLAYER"), _T("The player cannot be added to the session.") ),
  87. DPVDXLIB_ErrorInfo( DPERR_CANTCREATEGROUP, _T("DPERR_CANTCREATEGROUP"), _T("A new group cannot be created.") ),
  88. DPVDXLIB_ErrorInfo( DPERR_CANTCREATEPLAYER, _T("DPERR_CANTCREATEPLAYER"), _T("A new player cannot be created.") ),
  89. DPVDXLIB_ErrorInfo( DPERR_CANTCREATEPROCESS, _T("DPERR_CANTCREATEPROCESS"), _T("Cannot start the application.") ),
  90. DPVDXLIB_ErrorInfo( DPERR_CANTCREATESESSION, _T("DPERR_CANTCREATESESSION"), _T("A new session cannot be created.") ),
  91. DPVDXLIB_ErrorInfo( DPERR_CANTLOADCAPI, _T("DPERR_CANTLOADCAPI"), _T("No credentials were supplied and the CryptoAPI package (CAPI) to use for cryptography services cannot be loaded.") ),
  92. DPVDXLIB_ErrorInfo( DPERR_CANTLOADSECURITYPACKAGE, _T("DPERR_CANTLOADSECURITYPACKAGE"), _T("The software security package cannot be loaded.") ),
  93. DPVDXLIB_ErrorInfo( DPERR_CANTLOADSSPI, _T("DPERR_CANTLOADSSPI"), _T("No credentials were supplied, and the Security Support Provider Interface (SSPI) that will prompt for credentials cannot be loaded.") ),
  94. DPVDXLIB_ErrorInfo( DPERR_CAPSNOTAVAILABLEYET, _T("DPERR_CAPSNOTAVAILABLEYET"), _T("The capabilities of the DirectPlay object have not been determined yet. This error will occur if the DirectPlay object is implemented on a connectivity solution that requires polling to determine available bandwidth and latency.") ),
  95. DPVDXLIB_ErrorInfo( DPERR_CONNECTING, _T("DPERR_CONNECTING"), _T("The method is in the process of connecting to the network. The application should keep using the method until it returns DP_OK, indicating successful completion, or until it returns a different error.") ),
  96. DPVDXLIB_ErrorInfo( DPERR_CONNECTIONLOST, _T("DPERR_CONNECTIONLOST"), _T("The service provider connection was reset while data was being sent.") ),
  97. DPVDXLIB_ErrorInfo( DPERR_ENCRYPTIONFAILED, _T("DPERR_ENCRYPTIONFAILED"), _T("The requested information could not be digitally encrypted. Encryption is used for message privacy. This error is only relevant in a secure session.") ),
  98. DPVDXLIB_ErrorInfo( DPERR_ENCRYPTIONNOTSUPPORTED, _T("DPERR_ENCRYPTIONNOTSUPPORTED"), _T("The type of encryption requested in the DPSECURITYDESC structure is not available. This error is only relevant in a secure session.") ),
  99. DPVDXLIB_ErrorInfo( DPERR_EXCEPTION, _T("DPERR_EXCEPTION"), _T("An exception occurred when processing the request.") ),
  100. DPVDXLIB_ErrorInfo( DPERR_GENERIC, _T("DPERR_GENERIC"), _T("An undefined error condition occurred.") ),
  101. DPVDXLIB_ErrorInfo( DPERR_INVALIDFLAGS, _T("DPERR_INVALIDFLAGS"), _T("The flags passed to this method are invalid.") ),
  102. DPVDXLIB_ErrorInfo( DPERR_INVALIDGROUP, _T("DPERR_INVALIDGROUP"), _T("The group ID is not recognized as a valid group ID for this game session.") ),
  103. DPVDXLIB_ErrorInfo( DPERR_INVALIDINTERFACE, _T("DPERR_INVALIDINTERFACE"), _T("The interface parameter is invalid.") ),
  104. DPVDXLIB_ErrorInfo( DPERR_INVALIDOBJECT, _T("DPERR_INVALIDOBJECT"), _T("The DirectPlay object pointer is invalid.") ),
  105. DPVDXLIB_ErrorInfo( DPERR_INVALIDPARAMS, _T("DPERR_INVALIDPARAMS"), _T("One or more of the parameters passed to the method are invalid.") ),
  106. DPVDXLIB_ErrorInfo( DPERR_INVALIDPASSWORD, _T("DPERR_INVALIDPASSWORD"), _T("An invalid password was supplied when attempting to join a session that requires a password.") ),
  107. DPVDXLIB_ErrorInfo( DPERR_INVALIDPLAYER, _T("DPERR_INVALIDPLAYER"), _T("The player ID is not recognized as a valid player ID for this game session.") ),
  108. DPVDXLIB_ErrorInfo( DPERR_INVALIDPRIORITY, _T("DPERR_INVALIDPRIORITY"), _T("The specified priority is not within the range of allowed priorities, which is inclusively 0-65535.") ),
  109. DPVDXLIB_ErrorInfo( DPERR_LOGONDENIED, _T("DPERR_LOGONDENIED"), _T("The session could not be opened because credentials are required, and either no credentials were supplied, or the credentials were invalid.") ),
  110. DPVDXLIB_ErrorInfo( DPERR_NOCAPS, _T("DPERR_NOCAPS"), _T("The communication link that DirectPlay is attempting to use is not capable of this function.") ),
  111. DPVDXLIB_ErrorInfo( DPERR_NOCONNECTION, _T("DPERR_NOCONNECTION"), _T("No communication link was established.") ),
  112. DPVDXLIB_ErrorInfo( DPERR_NOINTERFACE, _T("DPERR_NOINTERFACE"), _T("The interface is not supported.") ),
  113. DPVDXLIB_ErrorInfo( DPERR_NOMESSAGES, _T("DPERR_NOMESSAGES"), _T("There are no messages in the receive queue.") ),
  114. DPVDXLIB_ErrorInfo( DPERR_NONAMESERVERFOUND, _T("DPERR_NONAMESERVERFOUND"), _T("No name server (host) could be found or created. A host must exist to create a player.") ),
  115. DPVDXLIB_ErrorInfo( DPERR_NONEWPLAYERS, _T("DPERR_NONEWPLAYERS"), _T("The session is not accepting any new players.") ),
  116. DPVDXLIB_ErrorInfo( DPERR_NOPLAYERS, _T("DPERR_NOPLAYERS"), _T("There are no active players in the session.") ),
  117. DPVDXLIB_ErrorInfo( DPERR_NOSESSIONS, _T("DPERR_NOSESSIONS"), _T("There are no existing sessions for this game.") ),
  118. DPVDXLIB_ErrorInfo( DPERR_NOTLOBBIED, _T("DPERR_NOTLOBBIED"), _T("Returned by the IDirectPlayLobby3::Connect method if the application was not started by using the IDirectPlayLobby3::RunApplication") ),
  119. DPVDXLIB_ErrorInfo( DPERR_NOTLOGGEDIN, _T("DPERR_NOTLOGGEDIN"), _T("An action cannot be performed because a player or client application is not logged on. Returned by the IDirectPlay4::Send method when the client application tries to send a secure message without being logged on.") ),
  120. DPVDXLIB_ErrorInfo( DPERR_OUTOFMEMORY, _T("DPERR_OUTOFMEMORY"), _T("There is insufficient memory to perform the requested operation.") ),
  121. DPVDXLIB_ErrorInfo( DPERR_PENDING, _T("DPERR_PENDING"), _T("Aync send has been queued") ),
  122. DPVDXLIB_ErrorInfo( DPERR_PLAYERLOST, _T("DPERR_PLAYERLOST"), _T("A player has lost the connection to the session.") ),
  123. DPVDXLIB_ErrorInfo( DPERR_SENDTOOBIG, _T("DPERR_SENDTOOBIG"), _T("The message being sent by the IDirectPlay4::Send method is too large. ") ),
  124. DPVDXLIB_ErrorInfo( DPERR_SESSIONLOST, _T("DPERR_SESSIONLOST"), _T("The connection to the session has been lost. ") ),
  125. DPVDXLIB_ErrorInfo( DPERR_SIGNFAILED, _T("DPERR_SIGNFAILED"), _T("The requested information could not be digitally signed. Digital signatures ") ),
  126. DPVDXLIB_ErrorInfo( DPERR_TIMEOUT, _T("DPERR_TIMEOUT"), _T("The operation could not be completed in the specified time.") ),
  127. DPVDXLIB_ErrorInfo( DPERR_UNAVAILABLE, _T("DPERR_UNAVAILABLE"), _T("The requested function is not available at this time.") ),
  128. DPVDXLIB_ErrorInfo( DPERR_UNINITIALIZED, _T("DPERR_UNINITIALIZED"), _T("The requested object has not been initialized.") ),
  129. DPVDXLIB_ErrorInfo( DPERR_UNKNOWNAPPLICATION, _T("DPERR_UNKNOWNAPPLICATION"), _T("An unknown application was specified. ") ),
  130. DPVDXLIB_ErrorInfo( DPERR_UNKNOWNMESSAGE, _T("DPERR_UNKNOWNMESSAGE"), _T("The message ID isn't valid. Returned from IDirectPlay4::CancelMessage if the ID of the message to be canceled is invalid. ") ),
  131. DPVDXLIB_ErrorInfo( DPERR_USERCANCEL , _T("DPERR_USERCANCEL"), _T("Can be returned in two ways. 1) The user canceled the connection process during a call to the IDirectPlay4::Open method. 2) The user clicked Cancel in one of the DirectPlay service provider dialog boxes during a call to IDirectPlay4::EnumSessions. ") ),
  132. DPVDXLIB_ErrorInfo( 0xFFFFFFFF, _T(""), _T("") )
  133. };
  134. HRESULT DPVDX_ERRDisplay( HRESULT hrError, LPTSTR lpstrCaption, DPVDXLIB_ErrorInfo *lpeiInfo, BOOL fSilent )
  135. {
  136. if( lpeiInfo == NULL )
  137. return E_POINTER;
  138. LPTSTR lpstrTextString;
  139. DWORD dwLength;
  140. dwLength = _tcsclen( lpeiInfo->lpstrName ) + _tcsclen( lpeiInfo->lpstrDescription ) + _tcsclen( lpstrCaption );
  141. dwLength += 4;
  142. lpstrTextString = new TCHAR[dwLength];
  143. if( lpstrTextString == NULL )
  144. return DVERR_OUTOFMEMORY;
  145. _tcscpy( lpstrTextString, lpstrCaption );
  146. _tcscat( lpstrTextString, _T("\n\n") );
  147. _tcscat( lpstrTextString, lpeiInfo->lpstrName );
  148. _tcscat( lpstrTextString, _T(":") );
  149. _tcscat( lpstrTextString, lpeiInfo->lpstrDescription );
  150. if( fSilent )
  151. {
  152. OutputDebugString( lpstrTextString );
  153. }
  154. else
  155. {
  156. MessageBox( NULL, lpstrTextString, _T("Error"), MB_OK );
  157. }
  158. delete [] lpstrTextString;
  159. return DV_OK;
  160. }
  161. HRESULT DPVDX_DVERRDisplay( HRESULT hrError, LPTSTR lpstrCaption, BOOL fSilent )
  162. {
  163. HRESULT hr;
  164. DPVDXLIB_ErrorInfo eiErrorInfo(0x00,_T(""),_T(""));
  165. hr = DPVDX_DVERR2String( hrError, &eiErrorInfo );
  166. if( FAILED( hr ) )
  167. {
  168. return hr;
  169. }
  170. return DPVDX_ERRDisplay( hrError, lpstrCaption, &eiErrorInfo, fSilent );
  171. }
  172. HRESULT DPVDX_DPERRDisplay( HRESULT hrError, LPTSTR lpstrCaption, BOOL fSilent )
  173. {
  174. HRESULT hr;
  175. DPVDXLIB_ErrorInfo eiErrorInfo(0x00,_T(""),_T(""));
  176. hr = DPVDX_DPERR2String( hrError, &eiErrorInfo );
  177. if( FAILED( hr ) )
  178. {
  179. return hr;
  180. }
  181. return DPVDX_ERRDisplay( hrError, lpstrCaption, &eiErrorInfo, fSilent );
  182. }
  183. HRESULT DPVDX_ERR2String( DPVDXLIB_ErrorInfo *lpeiInfo, HRESULT hrError, DPVDXLIB_ErrorInfo *lpeiResult )
  184. {
  185. DWORD dwIndex = 0;
  186. BOOL fBufferTooSmall = FALSE;
  187. while( 1 )
  188. {
  189. if( lpeiInfo[dwIndex].hrValue == 0xFFFFFFFF )
  190. {
  191. return DVERR_GENERIC;
  192. }
  193. else if( lpeiInfo[dwIndex].hrValue == hrError )
  194. {
  195. memcpy( lpeiResult, &lpeiInfo[dwIndex], sizeof( DPVDXLIB_ErrorInfo ) );
  196. return DV_OK;
  197. }
  198. dwIndex++;
  199. }
  200. return DV_OK;
  201. }
  202. // Error Functions
  203. HRESULT DPVDX_DVERR2String( HRESULT hrError, DPVDXLIB_ErrorInfo *lpeiResult )
  204. {
  205. return DPVDX_ERR2String( eiDirectPlayVoiceErrors, hrError, lpeiResult);
  206. }
  207. HRESULT DPVDX_DPERR2String( HRESULT hrError, DPVDXLIB_ErrorInfo *lpeiResult )
  208. {
  209. return DPVDX_ERR2String( eiDirectPlayErrors, hrError, lpeiResult );
  210. }