Added IOCB function

This commit is contained in:
Alex 2022-11-02 04:13:43 +02:00
parent 7d658a99e6
commit 2650202bc5
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 13 additions and 0 deletions

View File

@ -114,6 +114,17 @@ namespace Driver
},
};
int Driver::IOCB(unsigned long DUID, void *KCB)
{
foreach (auto var in Drivers)
if (var->DriverUID == DUID)
{
FexExtended *DrvExtHdr = (FexExtended *)((uint64_t)var->Address + EXTENDED_SECTION_ADDRESS);
return ((int (*)(void *))((uint64_t)DrvExtHdr->Driver.Callback + (uint64_t)var->Address))(KCB);
}
return -1;
}
DriverCode Driver::CallDriverEntryPoint(void *fex)
{
KernelAPI *API = (KernelAPI *)KernelAllocator.RequestPages(TO_PAGES(sizeof(KernelAPI)));

View File

@ -57,6 +57,8 @@ namespace Driver
DriverCode CallDriverEntryPoint(void *fex);
public:
Vector<DriverFile *> GetDrivers() { return Drivers; }
int IOCB(unsigned long DUID, /* KernelCallback */ void *KCB);
DriverCode LoadDriver(uint64_t DriverAddress, uint64_t Size);
DriverCode StartDrivers();
Driver();