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.

153 lines
3.0 KiB

  1. //
  2. // These are bit value flags
  3. //
  4. typedef enum AudioAllocateMemoryFlags {
  5. DEFAULT_MEMORY = 0x00, // Standard ExAllocatePool call
  6. ZERO_FILL_MEMORY = 0x01, // Zero the memory
  7. QUOTA_MEMORY = 0x02, // ExAllocatePoolWithQuota call
  8. LIMIT_MEMORY = 0x04, // Never allocation more then 1/4 Meg
  9. FIXED_MEMORY = 0x08, // Use locked memory
  10. PAGED_MEMORY = 0x10 // use pageable memory
  11. } AAMFLAGS;
  12. /*
  13. #define DEFAULT_MEMORY 0x00 // Standard ExAllocatePool call
  14. #define ZERO_FILL_MEMORY 0x01 // Zero the memory
  15. #define QUOTA_MEMORY 0x02 // ExAllocatePoolWithQuota call
  16. #define LIMIT_MEMORY 0x04 // Never allocation more then 1/4 Meg
  17. #define FIXED_MEMORY 0x08 // Use locked memory
  18. #define PAGED_MEMORY 0x10 // use pageable memory
  19. */
  20. #define AudioAllocateMemory_Fixed(b,t,f,p) AudioAllocateMemory(b,t,f|FIXED_MEMORY,p)
  21. #define AudioAllocateMemory_Paged(b,t,f,p) AudioAllocateMemory(b,t,f|PAGED_MEMORY,p)
  22. NTSTATUS
  23. AudioAllocateMemory(
  24. IN SIZE_T bytes,
  25. IN ULONG tag,
  26. IN AAMFLAGS dwFlags,
  27. OUT PVOID *pptr
  28. );
  29. #define UNKNOWN_SIZE MAXULONG_PTR
  30. #define AudioFreeMemory_Unknown(pMem) AudioFreeMemory(UNKNOWN_SIZE, pMem)
  31. void
  32. AudioFreeMemory(
  33. IN SIZE_T bytes,
  34. OUT PVOID *pptr
  35. );
  36. //
  37. // Validation routines
  38. //
  39. #define AUDIO_BUGCHECK_CODE 0x000000AD
  40. #define AUDIO_NOT_AT_PASSIVE_LEVEL 0x00000000
  41. #define AUDIO_NOT_BELOW_DISPATCH_LEVEL 0x00000001
  42. #define AUDIO_INVALID_IRQL_LEVEL 0x00000002
  43. //
  44. // BugCheck AD
  45. // Param1: AUDIO_STRUCTURE_VALIDATION
  46. // Param2: ptr
  47. // Param3: ntstatus code
  48. //
  49. #define AUDIO_STRUCTURE_VALIDATION 0x00000003
  50. //
  51. // BugCheck AD
  52. // Param1: AUDIO_MEMORY_ALLOCATION_OVERWRITE
  53. // Param2: ptr
  54. //
  55. #define AUDIO_MEMORY_ALLOCATION_OVERWRITE 0x00000004
  56. //
  57. // BugCheck AD
  58. // Param1: AUDIO_NESTED_MUTEX_SITUATION
  59. // Param2: pkmutex
  60. // Param3: lMutexState
  61. //
  62. #define AUDIO_NESTED_MUTEX_SITUATION 0x00000005
  63. //
  64. // BugCheck AD
  65. // Param1: AUDIO_ABSURD_ALLOCATION_ATTEMPTED
  66. // Param2:
  67. // Param3:
  68. //
  69. #define AUDIO_ABSURD_ALLOCATION_ATTEMPTED 0x00000006
  70. //
  71. // Used to smoke out pre-emption issues on the checked build.
  72. //
  73. NTSYSAPI NTSTATUS NTAPI ZwYieldExecution (VOID);
  74. void
  75. PagedCode(
  76. void
  77. );
  78. #define PagedData PagedCode
  79. void
  80. ValidatePassiveLevel(
  81. void
  82. );
  83. void
  84. AudioPerformYield(
  85. void
  86. );
  87. #define AudioEnterMutex_Exclusive(pmutex) AudioEnterMutex(pmutex,TRUE)
  88. #define AudioEnterMutex_Nestable(pmutex) AudioEnterMutex(pmutex,FALSE)
  89. NTSTATUS
  90. AudioEnterMutex(
  91. IN PKMUTEX pmutex,
  92. IN BOOL bExclusive
  93. );
  94. void
  95. AudioLeaveMutex(
  96. IN PKMUTEX pmutex
  97. );
  98. void
  99. AudioObDereferenceObject(
  100. IN PVOID pvObject
  101. );
  102. void
  103. AudioIoCompleteRequest(
  104. IN PIRP pIrp,
  105. IN CCHAR PriorityBoost
  106. );
  107. #if 0
  108. void
  109. AudioEnterSpinLock(
  110. IN PKSPIN_LOCK pSpinLock,
  111. OUT PKIRQL pOldIrql
  112. );
  113. void
  114. AudioLeaveSpinLock(
  115. IN PKSPIN_LOCK pSpinLock,
  116. IN KIRQL OldIrql
  117. );
  118. NTSTATUS
  119. AudioIoCallDriver (
  120. IN PDEVICE_OBJECT pDevice,
  121. IN PIRP pIrp
  122. );
  123. #endif