[NTOSKRNL:CC] MDL Handler's Header with MDL Specific defination

This commit is contained in:
Dibyamartanda Samanta 2024-05-10 09:25:57 +02:00
parent 85794e26cd
commit 381c91cc01

63
NTOSKRNL/CC/ccmdl.hpp Normal file
View File

@ -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);
}