From 381c91cc0118610b30d9c5d508bd10aa07da1ca9 Mon Sep 17 00:00:00 2001 From: Dibyamartanda Samanta Date: Fri, 10 May 2024 09:25:57 +0200 Subject: [PATCH] [NTOSKRNL:CC] MDL Handler's Header with MDL Specific defination --- NTOSKRNL/CC/ccmdl.hpp | 63 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 NTOSKRNL/CC/ccmdl.hpp diff --git a/NTOSKRNL/CC/ccmdl.hpp b/NTOSKRNL/CC/ccmdl.hpp new file mode 100644 index 0000000..f2ac303 --- /dev/null +++ b/NTOSKRNL/CC/ccmdl.hpp @@ -0,0 +1,63 @@ +/* PROJECT: Alcyone Kernel +* LICENSE: BSD Clause 3 +* PURPOSE: Cache Controller:: MDL Handler +* NT KERNEL: 5.11.9360 +* COPYRIGHT: 2023-2029 Dibymartanda Samanta <> +*/ + +/* Iterator class for MDL*/ +constexpr unsigned int MDL_READTYPE_DiskIoAttribution = 0; +constexpr unsigned int OPTIONAL_IRP = 0; +constexpr unsigned int MDL MAXIO_DISPATCH = 76; +constexpr unsigned int NOPRIORITY = 0 ; +constexpr unsigned int FLAG_UPDATE_READAHEAD = 0x20000;' ' + +class MDLIterator { +public: + MDLIterator(PMDL p) : ptr(p) {} + + // Prefix ++ operator + MDLIterator& operator++() { + if (ptr) { + ptr = ptr->Next; + } + return *this; + } + + // Postfix ++ operator + MDLIterator operator++(int) { + MDLIterator tmp(*this); + operator++(); + return tmp; + } + + // Dereference operator + PMDL operator*() const { + return ptr; + } + + // Equality operator + bool operator==(const MDLIterator& rhs) const { + return ptr == rhs.ptr; + } + + // Inequality operator + bool operator!=(const MDLIterator& rhs) const { + return ptr != rhs.ptr; + } + +private: + PMDL ptr; +}; + +/*Helper function to get the beginning of the MDL chain*/ +MDLIterator begin(PMDL p) { + return MDLIterator(p); +} + +/* Helper function to get the end of the MDL chain*/ +MDLIterator end(PMDL) { + return MDLIterator(nullptr); +} + +