consolodate windows error handling functions to improve error reporting quality
Windows uses a common error code system across most APIs (not sure about WMME wave* functions). PortAudio error reporting could be improved by providing standard functions for translating these error codes into PA errors.
Solution: create a pa_win_error.c/h module with routines for translating Windows error codes to PA error codes. Including support for translating unexpected host errors.
pa_win_wmme.c contains a function PaMme_SetLastSystemError that could be used as a basis.
Function signature would be something like:
Solution: create a pa_win_error.c/h module with routines for translating Windows error codes to PA error codes. Including support for translating unexpected host errors.
pa_win_wmme.c contains a function PaMme_SetLastSystemError that could be used as a basis.
Function signature would be something like:
/**
Convert a Windows error code into a PaError. Sets the host-api specific error
information if needed.
@param hostApiType The calling host api type. Used when reporting paUnanticipatedHostError
@param winError A Windows error code.
*/
PaError PaWinUtil_ConvertSystemError( PaHostApiTypeId hostApiType, DWORD winError );
Leave a comment