use super::*;

pub(super) const DLL_PROCESS_ATTACH: u32 = 1;
pub(super) const E_FAIL: i32 = 0x8000_4005_u32 as i32;
pub(super) const FILE_APPEND_DATA: u32 = 0x0000_0004;
pub(super) const FILE_SHARE_READ: u32 = 0x0000_0001;
pub(super) const OPEN_ALWAYS: u32 = 4;
pub(super) const FILE_ATTRIBUTE_NORMAL: u32 = 0x0000_0080;
pub(super) const INVALID_HANDLE_VALUE: isize = -1;
pub(super) const FILE_END: u32 = 2;

pub(super) static LOG_PATH: &[u8] = b"rrt_hook_attach.log\0";
pub(super) static ATTACH_MESSAGE: &[u8] = b"rrt-hook: process attach\n";
pub(super) static FINANCE_CAPTURE_STARTED_MESSAGE: &[u8] =
    b"rrt-hook: finance capture thread started\n";
pub(super) static FINANCE_CAPTURE_SCAN_MESSAGE: &[u8] =
    b"rrt-hook: finance capture raw collection scan\n";
pub(super) static FINANCE_CAPTURE_PROBE_DUMP_WRITTEN_MESSAGE: &[u8] =
    b"rrt-hook: finance collection probe written\n";
pub(super) static FINANCE_CAPTURE_COMPANY_RESOLVED_MESSAGE: &[u8] =
    b"rrt-hook: finance capture company resolved\n";
pub(super) static FINANCE_CAPTURE_PROBE_WRITTEN_MESSAGE: &[u8] =
    b"rrt-hook: finance probe snapshot written\n";
pub(super) static FINANCE_CAPTURE_TIMEOUT_MESSAGE: &[u8] = b"rrt-hook: finance capture timed out\n";
pub(super) static CARGO_CAPTURE_STARTED_MESSAGE: &[u8] =
    b"rrt-hook: cargo capture thread started\n";
pub(super) static CARGO_CAPTURE_WRITTEN_MESSAGE: &[u8] =
    b"rrt-hook: cargo collection probe written\n";
pub(super) static CARGO_CAPTURE_TIMEOUT_MESSAGE: &[u8] = b"rrt-hook: cargo capture timed out\n";
pub(super) static AUTO_LOAD_STARTED_MESSAGE: &[u8] = b"rrt-hook: auto load hook armed\n";
pub(super) static AUTO_LOAD_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell-state hook installed\n";
pub(super) static AUTO_LOAD_PROFILE_DISPATCH_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load startup-dispatch hook installed\n";
pub(super) static AUTO_LOAD_RUNTIME_RESET_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load runtime-reset hook installed\n";
pub(super) static AUTO_LOAD_ALLOCATOR_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load allocator hook installed\n";
pub(super) static AUTO_LOAD_LOAD_SCREEN_SCALAR_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load load-screen scalar hook installed\n";
pub(super) static AUTO_LOAD_LOAD_SCREEN_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load load-screen hook installed\n";
pub(super) static AUTO_LOAD_LOAD_SCREEN_MESSAGE_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load load-screen message hook installed\n";
pub(super) static AUTO_LOAD_RUNTIME_PRIME_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell runtime-prime hook installed\n";
pub(super) static AUTO_LOAD_FRAME_CYCLE_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell frame-cycle hook installed\n";
pub(super) static AUTO_LOAD_OBJECT_SERVICE_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell object-service hook installed\n";
pub(super) static AUTO_LOAD_CHILD_SERVICE_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell child-service hook installed\n";
pub(super) static AUTO_LOAD_PUBLISH_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell publish hook installed\n";
pub(super) static AUTO_LOAD_UNPUBLISH_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell unpublish hook installed\n";
pub(super) static AUTO_LOAD_OBJECT_TEARDOWN_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell object teardown hook installed\n";
pub(super) static AUTO_LOAD_OBJECT_RANGE_REMOVE_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell object range-remove hook installed\n";
pub(super) static AUTO_LOAD_REMOVE_NODE_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell remove-node hook installed\n";
pub(super) static AUTO_LOAD_NODE_VCALL_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell node-vcall hook installed\n";
pub(super) static AUTO_LOAD_MODE2_TEARDOWN_HOOK_INSTALLED_MESSAGE: &[u8] =
    b"rrt-hook: auto load mode2 teardown hook installed\n";
pub(super) static AUTO_LOAD_READY_MESSAGE: &[u8] = b"rrt-hook: auto load ready gate passed\n";
pub(super) static AUTO_LOAD_DEFERRED_MESSAGE: &[u8] =
    b"rrt-hook: auto load restore deferred to later service turn\n";
pub(super) static AUTO_LOAD_CALLING_MESSAGE: &[u8] = b"rrt-hook: auto load restore calling\n";
pub(super) static AUTO_LOAD_STAGED_MESSAGE: &[u8] =
    b"rrt-hook: auto load restore staged for later transition\n";
pub(super) static AUTO_LOAD_READY_COUNT_MESSAGE: &[u8] = b"rrt-hook: auto load ready count\n";
pub(super) static AUTO_LOAD_ARMED_TICK_MESSAGE: &[u8] =
    b"rrt-hook: auto load armed transition tick\n";
pub(super) static AUTO_LOAD_OWNER_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell transition entering\n";
pub(super) static AUTO_LOAD_OWNER_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell transition returned\n";
pub(super) static AUTO_LOAD_PROFILE_DISPATCH_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load startup dispatch entering\n";
pub(super) static AUTO_LOAD_PROFILE_DISPATCH_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load startup dispatch returned\n";
pub(super) static AUTO_LOAD_RUNTIME_RESET_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load runtime reset entering\n";
pub(super) static AUTO_LOAD_RUNTIME_RESET_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load runtime reset returned\n";
pub(super) static AUTO_LOAD_ALLOCATOR_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load allocator entering\n";
pub(super) static AUTO_LOAD_ALLOCATOR_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load allocator returned\n";
pub(super) static AUTO_LOAD_LOAD_SCREEN_SCALAR_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load load-screen scalar entering\n";
pub(super) static AUTO_LOAD_LOAD_SCREEN_SCALAR_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load load-screen scalar returned\n";
pub(super) static AUTO_LOAD_LOAD_SCREEN_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load load-screen construct entering\n";
pub(super) static AUTO_LOAD_LOAD_SCREEN_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load load-screen construct returned\n";
pub(super) static AUTO_LOAD_LOAD_SCREEN_MESSAGE_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load load-screen message entering\n";
pub(super) static AUTO_LOAD_LOAD_SCREEN_MESSAGE_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load load-screen message returned\n";
pub(super) static AUTO_LOAD_RUNTIME_PRIME_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell runtime-prime entering\n";
pub(super) static AUTO_LOAD_RUNTIME_PRIME_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell runtime-prime returned\n";
pub(super) static AUTO_LOAD_FRAME_CYCLE_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell frame-cycle entering\n";
pub(super) static AUTO_LOAD_FRAME_CYCLE_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell frame-cycle returned\n";
pub(super) static AUTO_LOAD_OBJECT_SERVICE_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell object-service entering\n";
pub(super) static AUTO_LOAD_OBJECT_SERVICE_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell object-service returned\n";
pub(super) static AUTO_LOAD_CHILD_SERVICE_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell child-service entering\n";
pub(super) static AUTO_LOAD_CHILD_SERVICE_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell child-service returned\n";
pub(super) static AUTO_LOAD_PUBLISH_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell publish entering\n";
pub(super) static AUTO_LOAD_PUBLISH_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell publish returned\n";
pub(super) static AUTO_LOAD_UNPUBLISH_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell unpublish entering\n";
pub(super) static AUTO_LOAD_UNPUBLISH_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell unpublish returned\n";
pub(super) static AUTO_LOAD_OBJECT_TEARDOWN_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell object teardown entering\n";
pub(super) static AUTO_LOAD_OBJECT_TEARDOWN_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell object teardown returned\n";
pub(super) static AUTO_LOAD_OBJECT_RANGE_REMOVE_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell object range-remove entering\n";
pub(super) static AUTO_LOAD_OBJECT_RANGE_REMOVE_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell object range-remove returned\n";
pub(super) static AUTO_LOAD_REMOVE_NODE_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell remove-node entering\n";
pub(super) static AUTO_LOAD_REMOVE_NODE_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell remove-node returned\n";
pub(super) static AUTO_LOAD_NODE_VCALL_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell node-vcall entering\n";
pub(super) static AUTO_LOAD_NODE_VCALL_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load shell node-vcall returned\n";
pub(super) static AUTO_LOAD_MODE2_TEARDOWN_ENTRY_MESSAGE: &[u8] =
    b"rrt-hook: auto load mode2 teardown entering\n";
pub(super) static AUTO_LOAD_MODE2_TEARDOWN_RETURNED_MESSAGE: &[u8] =
    b"rrt-hook: auto load mode2 teardown returned\n";
pub(super) static AUTO_LOAD_TRIGGERED_MESSAGE: &[u8] = b"rrt-hook: auto load restore invoked\n";
pub(super) static AUTO_LOAD_SUCCESS_MESSAGE: &[u8] =
    b"rrt-hook: auto load request reported success\n";
pub(super) static AUTO_LOAD_FAILURE_MESSAGE: &[u8] =
    b"rrt-hook: auto load request reported failure\n";
pub(super) static DEBUG_MESSAGE: &[u8] = b"rrt-hook: DllMain process attach\0";
pub(super) static DIRECT_INPUT8_CREATE_NAME: &[u8] = b"DirectInput8Create\0";

pub(super) const COMPANY_COLLECTION_ADDR: usize = 0x0062be10;
pub(super) const CARGO_COLLECTION_ADDR: usize = 0x0062ba8c;
pub(super) const SHELL_CONTROLLER_PTR_ADDR: usize = 0x006d4024;
pub(super) const SHELL_STATE_PTR_ADDR: usize = 0x006cec74;
pub(super) const ACTIVE_MODE_PTR_ADDR: usize = 0x006cec78;
pub(super) const SHELL_STATE_SERVICE_ADDR: usize = 0x00482160;
pub(super) const SHELL_TRANSITION_MODE_ADDR: usize = 0x00482ec0;
pub(super) const PROFILE_STARTUP_DISPATCH_ADDR: usize = 0x00438890;
pub(super) const RUNTIME_RESET_ADDR: usize = 0x004336d0;
pub(super) const STARTUP_RUNTIME_ALLOC_THUNK_ADDR: usize = 0x0053b070;
pub(super) const LOAD_SCREEN_SET_SCALAR_ADDR: usize = 0x004ea710;
pub(super) const LOAD_SCREEN_CONSTRUCT_ADDR: usize = 0x004ea620;
pub(super) const LOAD_SCREEN_HANDLE_MESSAGE_ADDR: usize = 0x004e3a80;
pub(super) const SHELL_RUNTIME_PRIME_ADDR: usize = 0x00538b60;
pub(super) const SHELL_FRAME_CYCLE_ADDR: usize = 0x00520620;
pub(super) const SHELL_OBJECT_SERVICE_ADDR: usize = 0x0053fda0;
pub(super) const SHELL_CHILD_SERVICE_ADDR: usize = 0x005595d0;
pub(super) const SHELL_PUBLISH_WINDOW_ADDR: usize = 0x00538e50;
pub(super) const SHELL_UNPUBLISH_WINDOW_ADDR: usize = 0x005389c0;
pub(super) const SHELL_OBJECT_TEARDOWN_ADDR: usize = 0x005400c0;
pub(super) const SHELL_OBJECT_RANGE_REMOVE_ADDR: usize = 0x0053fe00;
pub(super) const SHELL_REMOVE_NODE_ADDR: usize = 0x0053f860;
pub(super) const SHELL_NODE_VCALL_ADDR: usize = 0x00540910;
pub(super) const MODE2_TEARDOWN_ADDR: usize = 0x00502720;
pub(super) const SHELL_STATE_ACTIVE_MODE_OFFSET: usize = 0x08;
pub(super) const SHELL_STATE_ACTIVE_MODE_OBJECT_OFFSET: usize = 0x0c;
pub(super) const RUNTIME_PROFILE_PTR_ADDR: usize = 0x006cec7c;
pub(super) const RUNTIME_PROFILE_STARTUP_SELECTOR_OFFSET: usize = 0x01;
pub(super) const RUNTIME_PROFILE_MANUAL_LOAD_PATH_OFFSET: usize = 0x11;
pub(super) const RUNTIME_PROFILE_PENDING_LOAD_BYTE_OFFSET: usize = 0x97;
pub(super) const SHELL_MODE_STARTUP_LOAD_DISPATCH: u32 = 1;
pub(super) const STARTUP_SELECTOR_SCENARIO_LOAD: u8 = 3;
pub(super) const STARTUP_RUNTIME_OBJECT_SIZE: u32 = 0x00046c40;
pub(super) const INDEXED_COLLECTION_FLAT_FLAG_OFFSET: usize = 0x04;
pub(super) const INDEXED_COLLECTION_STRIDE_OFFSET: usize = 0x08;
pub(super) const INDEXED_COLLECTION_ID_BOUND_OFFSET: usize = 0x14;
pub(super) const INDEXED_COLLECTION_PAYLOAD_OFFSET: usize = 0x30;
pub(super) const INDEXED_COLLECTION_TOMBSTONE_BITSET_OFFSET: usize = 0x34;
pub(super) const CARGO_STEM_OFFSET: usize = 0x04;
pub(super) const CARGO_SUBTYPE_OFFSET: usize = 0x32;
pub(super) const CARGO_ROUTE_STYLE_OFFSET: usize = 0x46;
pub(super) const CARGO_COLLECTION_CLASS_MARKER_BASE_OFFSET: usize = 0x9a;
pub(super) const COMPANY_ACTIVE_OFFSET: usize = 0x3f;
pub(super) const COMPANY_OUTSTANDING_SHARES_OFFSET: usize = 0x47;
pub(super) const COMPANY_COMPANY_VALUE_OFFSET: usize = 0x57;
pub(super) const COMPANY_BOND_COUNT_OFFSET: usize = 0x5b;
pub(super) const COMPANY_BOND_TABLE_OFFSET: usize = 0x5f;
pub(super) const COMPANY_FOUNDING_YEAR_OFFSET: usize = 0x157;
pub(super) const COMPANY_LAST_BANKRUPTCY_YEAR_OFFSET: usize = 0x163;
pub(super) const COMPANY_CITY_CONNECTION_LATCH_OFFSET: usize = 0x0d18;
pub(super) const COMPANY_LINKED_TRANSIT_LATCH_OFFSET: usize = 0x0d56;

pub(super) const SCENARIO_CURRENT_YEAR_OFFSET: usize = 0x0d;
pub(super) const SCENARIO_BUILDING_DENSITY_GROWTH_OFFSET: usize = 0x4c7c;
pub(super) const SCENARIO_BANKRUPTCY_TOGGLE_OFFSET: usize = 0x4a8f;
pub(super) const SCENARIO_BOND_TOGGLE_OFFSET: usize = 0x4a8b;
pub(super) const SCENARIO_STOCK_TOGGLE_OFFSET: usize = 0x4a87;
pub(super) const SCENARIO_DIVIDEND_TOGGLE_OFFSET: usize = 0x4a93;

pub(super) const MAX_CAPTURE_POLL_ATTEMPTS: usize = 120;
pub(super) const CAPTURE_POLL_INTERVAL: Duration = Duration::from_secs(1);
pub(super) const AUTO_LOAD_READY_POLLS: u32 = 1;
pub(super) const AUTO_LOAD_DEFER_POLLS: u32 = 0;
pub(super) const MEM_COMMIT: u32 = 0x1000;
pub(super) const MEM_RESERVE: u32 = 0x2000;
pub(super) const PAGE_EXECUTE_READWRITE: u32 = 0x40;
