mirror-ac/module/dispatcher/dispatcher.h
donnaskiez ea2278e7b3
internal refactoring (#14)
- Refactor process list. New implementation consists of a hashmap. Each process entry then contains the associated user modules.
- Implement user module integrity checks on timer callback
2024-06-09 17:22:22 +10:00

37 lines
No EOL
934 B
C++

#pragma once
#include "threadpool.h"
#include "timer.h"
#include "../kernel_interface/kernel_interface.h"
#include "../module.h"
namespace dispatcher {
constexpr int DISPATCH_LOOP_SLEEP_TIME = 30;
constexpr int KERNEL_DISPATCH_FUNCTION_COUNT = 12;
constexpr int DISPATCHER_THREAD_COUNT = 4;
constexpr int TIMER_CALLBACK_DELAY = 15;
constexpr int WRITE_SHARED_MAPPING_PERIOD = 30;
constexpr int WRITE_SHARED_MAPPING_DUE_TIME = 30;
class dispatcher {
timer timers;
thread_pool thread_pool;
kernel_interface::kernel_interface k_interface;
module::module_information *module_info;
void issue_kernel_job();
void write_shared_mapping_operation();
void init_timer_callbacks();
void run_timer_thread();
void run_io_port_thread();
void request_session_pk();
public:
dispatcher(LPCWSTR driver_name, client::message_queue &queue, module::module_information* module_info);
void run();
};
} // namespace dispatcher