//! NOTE: this file is autogenerated, DO NOT MODIFY
//--------------------------------------------------------------------------------
// Section: Constants (3)
//--------------------------------------------------------------------------------
pub const MAX_MODULE_NAME32 = @as(u32, 255);
pub const HF32_DEFAULT = @as(u32, 1);
pub const HF32_SHARED = @as(u32, 2);

//--------------------------------------------------------------------------------
// Section: Types (9)
//--------------------------------------------------------------------------------
pub const CREATE_TOOLHELP_SNAPSHOT_FLAGS = enum(u32) {
    INHERIT = 2147483648,
    SNAPALL = 15,
    SNAPHEAPLIST = 1,
    SNAPMODULE = 8,
    SNAPMODULE32 = 16,
    SNAPPROCESS = 2,
    SNAPTHREAD = 4,
    _,
    pub fn initFlags(o: struct {
        INHERIT: u1 = 0,
        SNAPALL: u1 = 0,
        SNAPHEAPLIST: u1 = 0,
        SNAPMODULE: u1 = 0,
        SNAPMODULE32: u1 = 0,
        SNAPPROCESS: u1 = 0,
        SNAPTHREAD: u1 = 0,
    }) CREATE_TOOLHELP_SNAPSHOT_FLAGS {
        return @as(CREATE_TOOLHELP_SNAPSHOT_FLAGS, @enumFromInt((if (o.INHERIT == 1) @intFromEnum(CREATE_TOOLHELP_SNAPSHOT_FLAGS.INHERIT) else 0) | (if (o.SNAPALL == 1) @intFromEnum(CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPALL) else 0) | (if (o.SNAPHEAPLIST == 1) @intFromEnum(CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPHEAPLIST) else 0) | (if (o.SNAPMODULE == 1) @intFromEnum(CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPMODULE) else 0) | (if (o.SNAPMODULE32 == 1) @intFromEnum(CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPMODULE32) else 0) | (if (o.SNAPPROCESS == 1) @intFromEnum(CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPPROCESS) else 0) | (if (o.SNAPTHREAD == 1) @intFromEnum(CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPTHREAD) else 0)));
    }
};
pub const TH32CS_INHERIT = CREATE_TOOLHELP_SNAPSHOT_FLAGS.INHERIT;
pub const TH32CS_SNAPALL = CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPALL;
pub const TH32CS_SNAPHEAPLIST = CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPHEAPLIST;
pub const TH32CS_SNAPMODULE = CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPMODULE;
pub const TH32CS_SNAPMODULE32 = CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPMODULE32;
pub const TH32CS_SNAPPROCESS = CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPPROCESS;
pub const TH32CS_SNAPTHREAD = CREATE_TOOLHELP_SNAPSHOT_FLAGS.SNAPTHREAD;

pub const HEAPENTRY32_FLAGS = enum(u32) {
    FIXED = 1,
    FREE = 2,
    MOVEABLE = 4,
};
pub const LF32_FIXED = HEAPENTRY32_FLAGS.FIXED;
pub const LF32_FREE = HEAPENTRY32_FLAGS.FREE;
pub const LF32_MOVEABLE = HEAPENTRY32_FLAGS.MOVEABLE;

pub const HEAPLIST32 = extern struct {
    dwSize: usize,
    th32ProcessID: u32,
    th32HeapID: usize,
    dwFlags: u32,
};

pub const HEAPENTRY32 = extern struct {
    dwSize: usize,
    hHandle: ?HANDLE,
    dwAddress: usize,
    dwBlockSize: usize,
    dwFlags: HEAPENTRY32_FLAGS,
    dwLockCount: u32,
    dwResvd: u32,
    th32ProcessID: u32,
    th32HeapID: usize,
};

pub const PROCESSENTRY32W = extern struct {
    dwSize: u32,
    cntUsage: u32,
    th32ProcessID: u32,
    th32DefaultHeapID: usize,
    th32ModuleID: u32,
    cntThreads: u32,
    th32ParentProcessID: u32,
    pcPriClassBase: i32,
    dwFlags: u32,
    szExeFile: [260]u16,
};

pub const PROCESSENTRY32 = extern struct {
    dwSize: u32,
    cntUsage: u32,
    th32ProcessID: u32,
    th32DefaultHeapID: usize,
    th32ModuleID: u32,
    cntThreads: u32,
    th32ParentProcessID: u32,
    pcPriClassBase: i32,
    dwFlags: u32,
    szExeFile: [260]CHAR,
};

pub const THREADENTRY32 = extern struct {
    dwSize: u32,
    cntUsage: u32,
    th32ThreadID: u32,
    th32OwnerProcessID: u32,
    tpBasePri: i32,
    tpDeltaPri: i32,
    dwFlags: u32,
};

pub const MODULEENTRY32W = extern struct {
    dwSize: u32,
    th32ModuleID: u32,
    th32ProcessID: u32,
    GlblcntUsage: u32,
    ProccntUsage: u32,
    modBaseAddr: ?*u8,
    modBaseSize: u32,
    hModule: ?HINSTANCE,
    szModule: [256]u16,
    szExePath: [260]u16,
};

pub const MODULEENTRY32 = extern struct {
    dwSize: u32,
    th32ModuleID: u32,
    th32ProcessID: u32,
    GlblcntUsage: u32,
    ProccntUsage: u32,
    modBaseAddr: ?*u8,
    modBaseSize: u32,
    hModule: ?HINSTANCE,
    szModule: [256]CHAR,
    szExePath: [260]CHAR,
};

//--------------------------------------------------------------------------------
// Section: Functions (16)
//--------------------------------------------------------------------------------
// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn CreateToolhelp32Snapshot(
    dwFlags: CREATE_TOOLHELP_SNAPSHOT_FLAGS,
    th32ProcessID: u32,
) callconv(@import("std").os.windows.WINAPI) ?HANDLE;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Heap32ListFirst(
    hSnapshot: ?HANDLE,
    lphl: ?*HEAPLIST32,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Heap32ListNext(
    hSnapshot: ?HANDLE,
    lphl: ?*HEAPLIST32,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Heap32First(
    lphe: ?*HEAPENTRY32,
    th32ProcessID: u32,
    th32HeapID: usize,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Heap32Next(
    lphe: ?*HEAPENTRY32,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Toolhelp32ReadProcessMemory(
    th32ProcessID: u32,
    lpBaseAddress: ?*const anyopaque,
    lpBuffer: ?*anyopaque,
    cbRead: usize,
    lpNumberOfBytesRead: ?*usize,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Process32FirstW(
    hSnapshot: ?HANDLE,
    lppe: ?*PROCESSENTRY32W,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Process32NextW(
    hSnapshot: ?HANDLE,
    lppe: ?*PROCESSENTRY32W,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Process32First(
    hSnapshot: ?HANDLE,
    lppe: ?*PROCESSENTRY32,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Process32Next(
    hSnapshot: ?HANDLE,
    lppe: ?*PROCESSENTRY32,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Thread32First(
    hSnapshot: ?HANDLE,
    lpte: ?*THREADENTRY32,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Thread32Next(
    hSnapshot: ?HANDLE,
    lpte: ?*THREADENTRY32,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Module32FirstW(
    hSnapshot: ?HANDLE,
    lpme: ?*MODULEENTRY32W,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Module32NextW(
    hSnapshot: ?HANDLE,
    lpme: ?*MODULEENTRY32W,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Module32First(
    hSnapshot: ?HANDLE,
    lpme: ?*MODULEENTRY32,
) callconv(@import("std").os.windows.WINAPI) BOOL;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "kernel32" fn Module32Next(
    hSnapshot: ?HANDLE,
    lpme: ?*MODULEENTRY32,
) callconv(@import("std").os.windows.WINAPI) BOOL;

//--------------------------------------------------------------------------------
// Section: Unicode Aliases (0)
//--------------------------------------------------------------------------------
const thismodule = @This();
pub usingnamespace switch (@import("../../zig.zig").unicode_mode) {
    .ansi => struct {},
    .wide => struct {},
    .unspecified => if (@import("builtin").is_test) struct {} else struct {},
};
//--------------------------------------------------------------------------------
// Section: Imports (4)
//--------------------------------------------------------------------------------
const BOOL = @import("../../foundation.zig").BOOL;
const CHAR = @import("../../foundation.zig").CHAR;
const HANDLE = @import("../../foundation.zig").HANDLE;
const HINSTANCE = @import("../../foundation.zig").HINSTANCE;

test {
    @setEvalBranchQuota(comptime @import("std").meta.declarations(@This()).len * 3);

    // reference all the pub declarations
    if (!@import("builtin").is_test) return;
    inline for (comptime @import("std").meta.declarations(@This())) |decl| {
        if (decl.is_pub) {
            _ = @field(@This(), decl.name);
        }
    }
}
