mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibCore: Add VERIFY checks for all wait completion packet nt.dll calls
This commit is contained in:
parent
d5e5dbdf3d
commit
fa262d2db5
Notes:
github-actions[bot]
2025-11-18 17:50:42 +00:00
Author: https://github.com/ayeteadoe
Commit: fa262d2db5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6838
Reviewed-by: https://github.com/R-Goc ✅
Reviewed-by: https://github.com/gmta ✅
1 changed files with 10 additions and 6 deletions
|
|
@ -203,14 +203,17 @@ size_t EventLoopImplementationWindows::pump(PumpMode pump_mode)
|
|||
auto* timer = static_cast<EventLoopTimer*>(packet);
|
||||
if (auto owner = timer->owner.strong_ref())
|
||||
event_queue.post_event(*owner, make<TimerEvent>());
|
||||
if (timer->is_periodic)
|
||||
g_system.NtAssociateWaitCompletionPacket(timer->wait_packet.handle, thread_data->iocp.handle, timer->timer.handle, timer, NULL, 0, 0, NULL);
|
||||
if (timer->is_periodic) {
|
||||
NTSTATUS status = g_system.NtAssociateWaitCompletionPacket(timer->wait_packet.handle, thread_data->iocp.handle, timer->timer.handle, timer, NULL, 0, 0, NULL);
|
||||
VERIFY(NT_SUCCESS(status));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (packet->type == CompletionType::Notifer) {
|
||||
auto* notifier_data = static_cast<EventLoopNotifier*>(packet);
|
||||
event_queue.post_event(*notifier_data->notifier, make<NotifierActivationEvent>(notifier_data->notifier_fd(), notifier_data->notifier_type()));
|
||||
g_system.NtAssociateWaitCompletionPacket(notifier_data->wait_packet.handle, thread_data->iocp.handle, notifier_data->wait_event.handle, notifier_data, NULL, 0, 0, NULL);
|
||||
NTSTATUS status = g_system.NtAssociateWaitCompletionPacket(notifier_data->wait_packet.handle, thread_data->iocp.handle, notifier_data->wait_event.handle, notifier_data, NULL, 0, 0, NULL);
|
||||
VERIFY(NT_SUCCESS(status));
|
||||
continue;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
|
|
@ -278,9 +281,9 @@ void EventLoopManagerWindows::register_notifier(Notifier& notifier)
|
|||
notifier_data->notifier = ¬ifier;
|
||||
notifier_data->m_notifier_type = notifier.type();
|
||||
notifier_data->wait_event.handle = event;
|
||||
NTSTATUS status = NtCreateWaitCompletionPacket(¬ifier_data->wait_packet.handle, GENERIC_READ | GENERIC_WRITE, NULL);
|
||||
NTSTATUS status = g_system.NtCreateWaitCompletionPacket(¬ifier_data->wait_packet.handle, GENERIC_READ | GENERIC_WRITE, NULL);
|
||||
VERIFY(NT_SUCCESS(status));
|
||||
status = NtAssociateWaitCompletionPacket(notifier_data->wait_packet.handle, thread_data->iocp.handle, event, notifier_data.ptr(), NULL, 0, 0, NULL);
|
||||
status = g_system.NtAssociateWaitCompletionPacket(notifier_data->wait_packet.handle, thread_data->iocp.handle, event, notifier_data.ptr(), NULL, 0, 0, NULL);
|
||||
VERIFY(NT_SUCCESS(status));
|
||||
notifiers.set(¬ifier, move(notifier_data));
|
||||
}
|
||||
|
|
@ -345,7 +348,8 @@ void EventLoopManagerWindows::unregister_timer(intptr_t timer_id)
|
|||
if (!maybe_timer.has_value())
|
||||
return;
|
||||
auto timer = move(maybe_timer.value());
|
||||
g_system.NtCancelWaitCompletionPacket(timer->wait_packet.handle, TRUE);
|
||||
NTSTATUS status = g_system.NtCancelWaitCompletionPacket(timer->wait_packet.handle, TRUE);
|
||||
VERIFY(NT_SUCCESS(status));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue