//! NOTE: this file is autogenerated, DO NOT MODIFY
//--------------------------------------------------------------------------------
// Section: Constants (27)
//--------------------------------------------------------------------------------
pub const TBS_CONTEXT_VERSION_ONE = @as(u32, 1);
pub const TBS_SUCCESS = @as(u32, 0);
pub const TBS_OWNERAUTH_TYPE_FULL = @as(u32, 1);
pub const TBS_OWNERAUTH_TYPE_ADMIN = @as(u32, 2);
pub const TBS_OWNERAUTH_TYPE_USER = @as(u32, 3);
pub const TBS_OWNERAUTH_TYPE_ENDORSEMENT = @as(u32, 4);
pub const TBS_OWNERAUTH_TYPE_ENDORSEMENT_20 = @as(u32, 12);
pub const TBS_OWNERAUTH_TYPE_STORAGE_20 = @as(u32, 13);
pub const TBS_CONTEXT_VERSION_TWO = @as(u32, 2);
pub const TPM_WNF_INFO_CLEAR_SUCCESSFUL = @as(u32, 1);
pub const TPM_WNF_INFO_OWNERSHIP_SUCCESSFUL = @as(u32, 2);
pub const TPM_WNF_INFO_NO_REBOOT_REQUIRED = @as(u32, 1);
pub const TPM_VERSION_UNKNOWN = @as(u32, 0);
pub const TPM_VERSION_12 = @as(u32, 1);
pub const TPM_VERSION_20 = @as(u32, 2);
pub const TPM_IFTYPE_UNKNOWN = @as(u32, 0);
pub const TPM_IFTYPE_1 = @as(u32, 1);
pub const TPM_IFTYPE_TRUSTZONE = @as(u32, 2);
pub const TPM_IFTYPE_HW = @as(u32, 3);
pub const TPM_IFTYPE_EMULATOR = @as(u32, 4);
pub const TPM_IFTYPE_SPB = @as(u32, 5);
pub const TBS_TCGLOG_SRTM_CURRENT = @as(u32, 0);
pub const TBS_TCGLOG_DRTM_CURRENT = @as(u32, 1);
pub const TBS_TCGLOG_SRTM_BOOT = @as(u32, 2);
pub const TBS_TCGLOG_SRTM_RESUME = @as(u32, 3);
pub const TBS_TCGLOG_DRTM_BOOT = @as(u32, 4);
pub const TBS_TCGLOG_DRTM_RESUME = @as(u32, 5);

//--------------------------------------------------------------------------------
// Section: Types (6)
//--------------------------------------------------------------------------------
pub const TBS_COMMAND_PRIORITY = enum(u32) {
    LOW = 100,
    NORMAL = 200,
    SYSTEM = 400,
    HIGH = 300,
    MAX = 2147483648,
};
pub const TBS_COMMAND_PRIORITY_LOW = TBS_COMMAND_PRIORITY.LOW;
pub const TBS_COMMAND_PRIORITY_NORMAL = TBS_COMMAND_PRIORITY.NORMAL;
pub const TBS_COMMAND_PRIORITY_SYSTEM = TBS_COMMAND_PRIORITY.SYSTEM;
pub const TBS_COMMAND_PRIORITY_HIGH = TBS_COMMAND_PRIORITY.HIGH;
pub const TBS_COMMAND_PRIORITY_MAX = TBS_COMMAND_PRIORITY.MAX;

pub const TBS_COMMAND_LOCALITY = enum(u32) {
    ZERO = 0,
    ONE = 1,
    TWO = 2,
    THREE = 3,
    FOUR = 4,
};
pub const TBS_COMMAND_LOCALITY_ZERO = TBS_COMMAND_LOCALITY.ZERO;
pub const TBS_COMMAND_LOCALITY_ONE = TBS_COMMAND_LOCALITY.ONE;
pub const TBS_COMMAND_LOCALITY_TWO = TBS_COMMAND_LOCALITY.TWO;
pub const TBS_COMMAND_LOCALITY_THREE = TBS_COMMAND_LOCALITY.THREE;
pub const TBS_COMMAND_LOCALITY_FOUR = TBS_COMMAND_LOCALITY.FOUR;

pub const TBS_CONTEXT_PARAMS = extern struct {
    version: u32,
};

pub const TBS_CONTEXT_PARAMS2 = extern struct {
    version: u32,
    Anonymous: extern union {
        Anonymous: extern struct {
            _bitfield: u32,
        },
        asUINT32: u32,
    },
};

pub const tdTPM_WNF_PROVISIONING = extern struct {
    status: u32,
    message: [28]u8,
};

pub const TPM_DEVICE_INFO = extern struct {
    structVersion: u32,
    tpmVersion: u32,
    tpmInterfaceType: u32,
    tpmImpRevision: u32,
};

//--------------------------------------------------------------------------------
// Section: Functions (13)
//--------------------------------------------------------------------------------
// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tbs" fn Tbsi_Context_Create(
    pContextParams: ?*TBS_CONTEXT_PARAMS,
    phContext: ?*?*anyopaque,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tbs" fn Tbsip_Context_Close(
    hContext: ?*anyopaque,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tbs" fn Tbsip_Submit_Command(
    hContext: ?*anyopaque,
    Locality: TBS_COMMAND_LOCALITY,
    Priority: TBS_COMMAND_PRIORITY,
    // TODO: what to do with BytesParamIndex 4?
    pabCommand: ?*u8,
    cbCommand: u32,
    // TODO: what to do with BytesParamIndex 6?
    pabResult: ?*u8,
    pcbResult: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tbs" fn Tbsip_Cancel_Commands(
    hContext: ?*anyopaque,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tbs" fn Tbsi_Physical_Presence_Command(
    hContext: ?*anyopaque,
    // TODO: what to do with BytesParamIndex 2?
    pabInput: ?*u8,
    cbInput: u32,
    // TODO: what to do with BytesParamIndex 4?
    pabOutput: ?*u8,
    pcbOutput: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tbs" fn Tbsi_Get_TCG_Log(
    hContext: ?*anyopaque,
    // TODO: what to do with BytesParamIndex 2?
    pOutputBuf: ?*u8,
    pOutputBufLen: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.0'
pub extern "tbs" fn Tbsi_GetDeviceInfo(
    Size: u32,
    // TODO: what to do with BytesParamIndex 0?
    Info: ?*anyopaque,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.0'
pub extern "tbs" fn Tbsi_Get_OwnerAuth(
    hContext: ?*anyopaque,
    ownerauthType: u32,
    // TODO: what to do with BytesParamIndex 3?
    pOutputBuf: ?*u8,
    pOutputBufLen: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.0'
pub extern "tbs" fn Tbsi_Revoke_Attestation() callconv(@import("std").os.windows.WINAPI) u32;

pub extern "tbs" fn GetDeviceID(
    // TODO: what to do with BytesParamIndex 1?
    pbWindowsAIK: ?*u8,
    cbWindowsAIK: u32,
    pcbResult: ?*u32,
    pfProtectedByTPM: ?*BOOL,
) callconv(@import("std").os.windows.WINAPI) HRESULT;

pub extern "tbs" fn GetDeviceIDString(
    pszWindowsAIK: ?[*:0]u16,
    cchWindowsAIK: u32,
    pcchResult: ?*u32,
    pfProtectedByTPM: ?*BOOL,
) callconv(@import("std").os.windows.WINAPI) HRESULT;

pub extern "tbs" fn Tbsi_Create_Windows_Key(
    keyHandle: u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows10.0.17134'
pub extern "tbs" fn Tbsi_Get_TCG_Log_Ex(
    logType: u32,
    // TODO: what to do with BytesParamIndex 2?
    pbOutput: ?*u8,
    pcbOutput: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

//--------------------------------------------------------------------------------
// 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 (2)
//--------------------------------------------------------------------------------
const BOOL = @import("../foundation.zig").BOOL;
const HRESULT = @import("../foundation.zig").HRESULT;

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);
        }
    }
}
