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.

115 lines
1.8 KiB

  1. #define PRESENT 1
  2. #define WRITABLE 2
  3. #define USER 4
  4. #define WRITETHROUGHCACHE 8
  5. #define CACHEDISABLED 16
  6. #define ACCESSED 32
  7. #define DIRTY 64
  8. #define PROCPAGESIZE 4096
  9. #define PAGECOUNT 32
  10. #define MAXDMABUFFERSIZE PAGECOUNT*PROCPAGESIZE
  11. #ifdef UNDER_NT
  12. #define STR_DEVICENAME TEXT("\\Device\\GLITCH")
  13. #define STR_LINKNAME TEXT("\\DosDevices\\GLITCH")
  14. #else
  15. #define STR_DEVICENAME TEXT(L"\\Device\\GLITCH")
  16. #define STR_LINKNAME TEXT(L"\\DosDevices\\GLITCH")
  17. #endif
  18. #define PACKETSIZE sizeof(ULONGLONG)+2*sizeof(ULONG)
  19. enum PacketTypes{
  20. NODATA,
  21. MASKED,
  22. UNMASKED,
  23. GLITCHED,
  24. HELDOFF
  25. };
  26. typedef struct {
  27. ULONG WriteLocation;
  28. ULONG ReadLocation;
  29. ULONG BufferSize;
  30. PCHAR pBuffer;
  31. } GLITCHDATA, *PGLITCHDATA;
  32. typedef struct {
  33. ULONG Channel;
  34. PKSPIN_LOCK pMasterAdapterSpinLock;
  35. ULONG CR3;
  36. PULONG PageDirectory;
  37. PULONG PageTable;
  38. PULONG pDmaBuffer;
  39. ULONG DmaBufferSize;
  40. ULONG PhysicalDmaBufferStart;
  41. PCHAR pPrintBuffer;
  42. ULONG PrintBufferSize;
  43. volatile ULONG *pPrintLoad;
  44. volatile ULONG *pPrintEmpty;
  45. BOOLEAN Read32BitPhysicalAddresses;
  46. } DMAINFO, *PDMAINFO;
  47. extern PGLITCHDATA GlitchInfo;
  48. VOID
  49. TrackGlitches (
  50. PVOID Context,
  51. ThreadStats *Statistics
  52. );
  53. VOID
  54. GlitchDetect (
  55. PDMAINFO Context,
  56. ThreadStats *Statistics
  57. );
  58. PVOID
  59. __cdecl
  60. ReservePages (
  61. ULONG page,
  62. ULONG npages,
  63. ULONG flags
  64. );
  65. ULONG
  66. __cdecl
  67. FreePages (
  68. PVOID hmem,
  69. ULONG flags
  70. );
  71. PVOID
  72. __cdecl
  73. LockPages (
  74. ULONG page,
  75. ULONG npages,
  76. ULONG pageoffset,
  77. ULONG flags
  78. );
  79. #ifdef UNDER_NT
  80. NTSTATUS DeviceIoCreate(
  81. IN PDEVICE_OBJECT DeviceObject,
  82. IN PIRP pIrp);
  83. NTSTATUS DeviceIoClose(
  84. IN PDEVICE_OBJECT DeviceObject,
  85. IN PIRP pIrp);
  86. NTSTATUS DeviceIoControl(
  87. IN PDEVICE_OBJECT DeviceObject,
  88. IN PIRP pIrp);
  89. #endif