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.

104 lines
2.1 KiB

  1. static char s_aszModule[] = __FILE__; /* For error report */
  2. #include <mvopsys.h>
  3. #ifndef _MAC
  4. #include <dos.h>
  5. #endif
  6. #if 0
  7. #include <winmm.h>
  8. #else
  9. #include <mmsystem.h>
  10. #endif // _NT
  11. #include <orkin.h>
  12. #include <iterror.h>
  13. #include <misc.h>
  14. #include <wrapstor.h>
  15. #include <_mvutil.h>
  16. /* Put all functions into the same segment to avoid memory fragmentation
  17. * and load time surplus for the MAC
  18. */
  19. // #pragma code_seg ("MVFS")
  20. #ifndef _MAC
  21. /***************************************************************************
  22. *
  23. * Global Data
  24. *
  25. ***************************************************************************/
  26. /* these arrays get indexed by wRead and wWrite |ed together */
  27. WORD _rgwOpenMode[] = {
  28. (WORD)-1,
  29. OF_READ,
  30. OF_WRITE,
  31. OF_READWRITE,
  32. };
  33. WORD _rgwPerm[] =
  34. {
  35. (WORD)-1,
  36. _A_RDONLY,
  37. _A_NORMAL,
  38. _A_NORMAL,
  39. };
  40. /*****************************************************************************
  41. *
  42. * RcFromLoadLibErr
  43. *
  44. * This table maps errors from Window's LoadLibrary to HRESULT values.
  45. *
  46. *****************************************************************************/
  47. HRESULT RcFromLoadLibErr[HINSTANCE_ERROR] = {
  48. E_BADVERSION, //0
  49. E_FAIL, //1
  50. E_NOTEXIST, //2
  51. E_NOTEXIST, //3
  52. E_FAIL, //4
  53. E_NOPERMISSION, //5
  54. E_FAIL, //6
  55. E_FAIL, //7
  56. E_OUTOFMEMORY, //8
  57. E_FAIL, //9
  58. E_BADVERSION, //10
  59. E_BADVERSION, //11
  60. E_BADVERSION, //12
  61. E_BADVERSION, //13
  62. E_BADVERSION, //14
  63. E_BADVERSION, //15
  64. E_BADVERSION, //16
  65. E_FAIL, //17
  66. E_FAIL, //18
  67. E_BADVERSION, //19
  68. E_BADVERSION, //20
  69. E_BADVERSION, //21
  70. E_FAIL, //22
  71. E_FAIL, //23
  72. E_FAIL, //24
  73. E_FAIL, //25
  74. E_FAIL, //26
  75. E_FAIL, //27
  76. E_FAIL, //28
  77. E_FAIL, //29
  78. E_FAIL, //30
  79. E_FAIL //31
  80. };
  81. #endif
  82. WORD _rgwShare[] =
  83. {
  84. OF_SHARE_EXCLUSIVE,
  85. OF_SHARE_DENY_WRITE,
  86. OF_SHARE_DENY_READ,
  87. OF_SHARE_DENY_NONE,
  88. };
  89. HANDLE hMmsysLib = NULL; // handle to the loaded mmio library