Subversion Repositories pentevo

Rev

Rev 796 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include "std.h"
  2.  
  3. #include "emul.h"
  4. #include "vars.h"
  5. #include "dxerr.h"
  6. #include "util.h"
  7.  
  8. #ifdef EMUL_DEBUG
  9. #include "dxerr9.h"
  10. void printrdd(const char *pr, HRESULT r)
  11. {
  12.    color(CONSCLR_ERROR);
  13.    printf("%s: %s\n", pr, DXGetErrorString(r));
  14.  
  15. #ifdef _DEBUG
  16.    OutputDebugString(pr);
  17.    OutputDebugString(": ");
  18.    OutputDebugString(DXGetErrorString(r));
  19.    OutputDebugString("\n");
  20. #endif
  21. }
  22.  
  23. void printrdi(const char *pr, HRESULT r)
  24. {
  25.    color(CONSCLR_ERROR);
  26.    printf("%s: %s\n", pr, DXGetErrorString(r));
  27.  
  28. #ifdef _DEBUG
  29.    OutputDebugString(pr);
  30.    OutputDebugString(": ");
  31.    OutputDebugString(DXGetErrorString(r));
  32.    OutputDebugString("\n");
  33. #endif
  34. }
  35.  
  36. void printrmm(const char *pr, MMRESULT r)
  37. {
  38.    char buf[200]; sprintf(buf, "unknown error (%08X)", r);
  39.    const char *str = buf;
  40.    switch (r)
  41.    {
  42.       case MMSYSERR_NOERROR: str = "ok"; break;
  43.       case MMSYSERR_INVALHANDLE: str = "MMSYSERR_INVALHANDLE"; break;
  44.       case MMSYSERR_NODRIVER: str = "MMSYSERR_NODRIVER"; break;
  45.       case WAVERR_UNPREPARED: str = "WAVERR_UNPREPARED"; break;
  46.       case MMSYSERR_NOMEM: str = "MMSYSERR_NOMEM"; break;
  47.       case MMSYSERR_ALLOCATED: str = "MMSYSERR_ALLOCATED"; break;
  48.       case WAVERR_BADFORMAT: str = "WAVERR_BADFORMAT"; break;
  49.       case WAVERR_SYNC: str = "WAVERR_SYNC"; break;
  50.       case MMSYSERR_INVALFLAG: str = "MMSYSERR_INVALFLAG"; break;
  51.    }
  52.    color(CONSCLR_ERROR);
  53.    printf("%s: %s\n", pr, str);
  54. }
  55.  
  56. void printrds(const char *pr, HRESULT r)
  57. {
  58.    color(CONSCLR_ERROR);
  59.    printf("%s: 0x%lX, %s\n", pr, r, DXGetErrorString(r));
  60. }
  61. #else
  62. #define printrdd(x,y)
  63. #define printrdi(x,y)
  64. #define printrds(x,y)
  65. #define printrmm(x,y)
  66. #endif
  67.