diff --git a/Core/Driver/Driver.cpp b/Core/Driver/Driver.cpp index dc59722..94f9009 100644 --- a/Core/Driver/Driver.cpp +++ b/Core/Driver/Driver.cpp @@ -83,8 +83,8 @@ namespace Driver } if (drv.MemTrk) delete drv.MemTrk, drv.MemTrk = nullptr; - Drivers.remove(drv); } + Drivers.clear(); } bool Driver::UnloadDriver(unsigned long DUID) @@ -268,7 +268,10 @@ namespace Driver { SmartLock(DriverInterruptLock); /* Lock in case of multiple interrupts firing at the same time */ if (!this->Enabled) + { + debug("Interrupt hook is not enabled"); return; + } if (!Handle.InterruptCallback) { diff --git a/Core/InterruptsManager.cpp b/Core/InterruptsManager.cpp index cf0f653..c169c0c 100644 --- a/Core/InterruptsManager.cpp +++ b/Core/InterruptsManager.cpp @@ -131,6 +131,7 @@ namespace Interrupts { #if defined(a64) CPU::x64::TrapFrame *Frame = (CPU::x64::TrapFrame *)Data; + // debug("IRQ%ld", Frame->InterruptNumber - 32); memmove(InterruptFrames + 1, InterruptFrames, sizeof(InterruptFrames) - sizeof(InterruptFrames[0])); InterruptFrames[0] = (void *)Frame->rip; diff --git a/Core/Random.cpp b/Core/Random.cpp index 7b01dfc..10c160e 100644 --- a/Core/Random.cpp +++ b/Core/Random.cpp @@ -43,6 +43,8 @@ namespace Random RDRANDFlag = cpuid.ECX.RDRAND; } } + else + RDRANDFlag = 0; } if (RDRANDFlag) @@ -80,6 +82,8 @@ namespace Random RDRANDFlag = cpuid.ECX.RDRAND; } } + else + RDRANDFlag = 0; } if (RDRANDFlag) @@ -117,6 +121,8 @@ namespace Random RDRANDFlag = cpuid.ECX.RDRAND; } } + else + RDRANDFlag = 0; } if (RDRANDFlag) diff --git a/Core/UniversalAsynchronousReceiverTransmitter.cpp b/Core/UniversalAsynchronousReceiverTransmitter.cpp index 7fbac22..e9b7961 100644 --- a/Core/UniversalAsynchronousReceiverTransmitter.cpp +++ b/Core/UniversalAsynchronousReceiverTransmitter.cpp @@ -161,7 +161,7 @@ namespace UniversalAsynchronousReceiverTransmitter SafeFunction NIF Events::~Events() { - for (uintptr_t i = 0; i < RegisteredEvents.size(); i++) + for (size_t i = 0; i < RegisteredEvents.size(); i++) if (RegisteredEvents[i] == this) { RegisteredEvents.remove(i); diff --git a/GUI/GraphicalUserInterface.cpp b/GUI/GraphicalUserInterface.cpp index 1b1c937..b93dfec 100644 --- a/GUI/GraphicalUserInterface.cpp +++ b/GUI/GraphicalUserInterface.cpp @@ -660,7 +660,6 @@ namespace GraphicalUserInterface delete this->OverlayBuffer, this->OverlayBuffer = nullptr; delete this->CursorBuffer, this->CursorBuffer = nullptr; Display->DeleteBuffer(200); - for (size_t i = 0; i < this->Windows.size(); i++) - this->Windows.remove(i); + this->Windows.clear(); } } diff --git a/Network/AddressResolutionProtocol.cpp b/Network/AddressResolutionProtocol.cpp index 13ccb35..6c64a35 100644 --- a/Network/AddressResolutionProtocol.cpp +++ b/Network/AddressResolutionProtocol.cpp @@ -49,6 +49,7 @@ namespace NetworkARP netdbg("Removed %s from discovered addresses", IP.v4.ToStringLittleEndian()); delete tmp, tmp = nullptr; DiscoveredAddresses.remove(i); + break; } } return nullptr; diff --git a/Network/NetworkController.cpp b/Network/NetworkController.cpp index 4ecaa5a..d23b947 100644 --- a/Network/NetworkController.cpp +++ b/Network/NetworkController.cpp @@ -59,8 +59,7 @@ namespace NetworkInterfaceManager this->StopNetworkStack(); // Unregister all events - for (size_t i = 0; i < RegisteredEvents.size(); i++) - RegisteredEvents.remove(i); + RegisteredEvents.clear(); foreach (auto inf in Interfaces) { diff --git a/Tasking/Security.cpp b/Tasking/Security.cpp index 29da4e3..b8500dc 100644 --- a/Tasking/Security.cpp +++ b/Tasking/Security.cpp @@ -145,10 +145,5 @@ namespace Tasking } Security::Security() {} - - Security::~Security() - { - for (size_t i = 0; i < Tokens.size(); i++) - Tokens.remove(i); - } + Security::~Security() { Tokens.clear(); } }