//! NOTE: this file is autogenerated, DO NOT MODIFY
//--------------------------------------------------------------------------------
// Section: Constants (459)
//--------------------------------------------------------------------------------
pub const WNODE_FLAG_ALL_DATA = @as(u32, 1);
pub const WNODE_FLAG_SINGLE_INSTANCE = @as(u32, 2);
pub const WNODE_FLAG_SINGLE_ITEM = @as(u32, 4);
pub const WNODE_FLAG_EVENT_ITEM = @as(u32, 8);
pub const WNODE_FLAG_FIXED_INSTANCE_SIZE = @as(u32, 16);
pub const WNODE_FLAG_TOO_SMALL = @as(u32, 32);
pub const WNODE_FLAG_INSTANCES_SAME = @as(u32, 64);
pub const WNODE_FLAG_STATIC_INSTANCE_NAMES = @as(u32, 128);
pub const WNODE_FLAG_INTERNAL = @as(u32, 256);
pub const WNODE_FLAG_USE_TIMESTAMP = @as(u32, 512);
pub const WNODE_FLAG_PERSIST_EVENT = @as(u32, 1024);
pub const WNODE_FLAG_EVENT_REFERENCE = @as(u32, 8192);
pub const WNODE_FLAG_ANSI_INSTANCENAMES = @as(u32, 16384);
pub const WNODE_FLAG_METHOD_ITEM = @as(u32, 32768);
pub const WNODE_FLAG_PDO_INSTANCE_NAMES = @as(u32, 65536);
pub const WNODE_FLAG_TRACED_GUID = @as(u32, 131072);
pub const WNODE_FLAG_LOG_WNODE = @as(u32, 262144);
pub const WNODE_FLAG_USE_GUID_PTR = @as(u32, 524288);
pub const WNODE_FLAG_USE_MOF_PTR = @as(u32, 1048576);
pub const WNODE_FLAG_NO_HEADER = @as(u32, 2097152);
pub const WNODE_FLAG_SEND_DATA_BLOCK = @as(u32, 4194304);
pub const WNODE_FLAG_VERSIONED_PROPERTIES = @as(u32, 8388608);
pub const WNODE_FLAG_SEVERITY_MASK = @as(u32, 4278190080);
pub const WMIREG_FLAG_EXPENSIVE = @as(u32, 1);
pub const WMIREG_FLAG_INSTANCE_LIST = @as(u32, 4);
pub const WMIREG_FLAG_INSTANCE_BASENAME = @as(u32, 8);
pub const WMIREG_FLAG_INSTANCE_PDO = @as(u32, 32);
pub const WMIREG_FLAG_REMOVE_GUID = @as(u32, 65536);
pub const WMIREG_FLAG_RESERVED1 = @as(u32, 131072);
pub const WMIREG_FLAG_RESERVED2 = @as(u32, 262144);
pub const WMIREG_FLAG_TRACED_GUID = @as(u32, 524288);
pub const WMIREG_FLAG_TRACE_CONTROL_GUID = @as(u32, 4096);
pub const WMIREG_FLAG_EVENT_ONLY_GUID = @as(u32, 64);
pub const WMI_GUIDTYPE_TRACECONTROL = @as(u32, 0);
pub const WMI_GUIDTYPE_TRACE = @as(u32, 1);
pub const WMI_GUIDTYPE_DATA = @as(u32, 2);
pub const WMI_GUIDTYPE_EVENT = @as(u32, 3);
pub const WMIGUID_QUERY = @as(u32, 1);
pub const WMIGUID_SET = @as(u32, 2);
pub const WMIGUID_NOTIFICATION = @as(u32, 4);
pub const WMIGUID_READ_DESCRIPTION = @as(u32, 8);
pub const WMIGUID_EXECUTE = @as(u32, 16);
pub const TRACELOG_CREATE_REALTIME = @as(u32, 32);
pub const TRACELOG_CREATE_ONDISK = @as(u32, 64);
pub const TRACELOG_GUID_ENABLE = @as(u32, 128);
pub const TRACELOG_ACCESS_KERNEL_LOGGER = @as(u32, 256);
pub const TRACELOG_LOG_EVENT = @as(u32, 512);
pub const TRACELOG_CREATE_INPROC = @as(u32, 512);
pub const TRACELOG_ACCESS_REALTIME = @as(u32, 1024);
pub const TRACELOG_REGISTER_GUIDS = @as(u32, 2048);
pub const TRACELOG_JOIN_GROUP = @as(u32, 4096);
pub const WMI_GLOBAL_LOGGER_ID = @as(u32, 1);
pub const MAX_PAYLOAD_PREDICATES = @as(u32, 8);
pub const EventTraceGuid = Guid.initString("68fdd900-4a3e-11d1-84f4-0000f80464e3");
pub const SystemTraceControlGuid = Guid.initString("9e814aad-3204-11d2-9a82-006008a86939");
pub const EventTraceConfigGuid = Guid.initString("01853a65-418f-4f36-aefc-dc0f1d2fd235");
pub const DefaultTraceSecurityGuid = Guid.initString("0811c1af-7a07-4a06-82ed-869455cdf713");
pub const PrivateLoggerNotificationGuid = Guid.initString("3595ab5c-042a-4c8e-b942-2d059bfeb1b1");
pub const SystemIoFilterProviderGuid = Guid.initString("fbd09363-9e22-4661-b8bf-e7a34b535b8c");
pub const SystemObjectProviderGuid = Guid.initString("febd7460-3d1d-47eb-af49-c9eeb1e146f2");
pub const SystemPowerProviderGuid = Guid.initString("c134884a-32d5-4488-80e5-14ed7abb8269");
pub const SystemHypervisorProviderGuid = Guid.initString("bafa072a-918a-4bed-b622-bc152097098f");
pub const SystemLockProviderGuid = Guid.initString("721ddfd3-dacc-4e1e-b26a-a2cb31d4705a");
pub const SystemConfigProviderGuid = Guid.initString("fef3a8b6-318d-4b67-a96a-3b0f6b8f18fe");
pub const SystemCpuProviderGuid = Guid.initString("c6c5265f-eae8-4650-aae4-9d48603d8510");
pub const SystemSchedulerProviderGuid = Guid.initString("599a2a76-4d91-4910-9ac7-7d33f2e97a6c");
pub const SystemProfileProviderGuid = Guid.initString("bfeb0324-1cee-496f-a409-2ac2b48a6322");
pub const SystemIoProviderGuid = Guid.initString("3d5c43e3-0f1c-4202-b817-174c0070dc79");
pub const SystemMemoryProviderGuid = Guid.initString("82958ca9-b6cd-47f8-a3a8-03ae85a4bc24");
pub const SystemRegistryProviderGuid = Guid.initString("16156bd9-fab4-4cfa-a232-89d1099058e3");
pub const SystemProcessProviderGuid = Guid.initString("151f55dc-467d-471f-83b5-5f889d46ff66");
pub const SystemAlpcProviderGuid = Guid.initString("fcb9baaf-e529-4980-92e9-ced1a6aadfdf");
pub const SystemSyscallProviderGuid = Guid.initString("434286f7-6f1b-45bb-b37e-95f623046c7c");
pub const SystemInterruptProviderGuid = Guid.initString("d4bbee17-b545-4888-858b-744169015b25");
pub const SystemTimerProviderGuid = Guid.initString("4f061568-e215-499f-ab2e-eda0ae890a5b");
pub const MAX_MOF_FIELDS = @as(u32, 16);
pub const SYSTEM_EVENT_TYPE = @as(u32, 1);
pub const EVENT_TRACE_TYPE_INFO = @as(u32, 0);
pub const EVENT_TRACE_TYPE_START = @as(u32, 1);
pub const EVENT_TRACE_TYPE_END = @as(u32, 2);
pub const EVENT_TRACE_TYPE_STOP = @as(u32, 2);
pub const EVENT_TRACE_TYPE_DC_START = @as(u32, 3);
pub const EVENT_TRACE_TYPE_DC_END = @as(u32, 4);
pub const EVENT_TRACE_TYPE_EXTENSION = @as(u32, 5);
pub const EVENT_TRACE_TYPE_REPLY = @as(u32, 6);
pub const EVENT_TRACE_TYPE_DEQUEUE = @as(u32, 7);
pub const EVENT_TRACE_TYPE_RESUME = @as(u32, 7);
pub const EVENT_TRACE_TYPE_CHECKPOINT = @as(u32, 8);
pub const EVENT_TRACE_TYPE_SUSPEND = @as(u32, 8);
pub const EVENT_TRACE_TYPE_WINEVT_SEND = @as(u32, 9);
pub const EVENT_TRACE_TYPE_WINEVT_RECEIVE = @as(u32, 240);
pub const TRACE_LEVEL_NONE = @as(u32, 0);
pub const TRACE_LEVEL_CRITICAL = @as(u32, 1);
pub const TRACE_LEVEL_FATAL = @as(u32, 1);
pub const TRACE_LEVEL_ERROR = @as(u32, 2);
pub const TRACE_LEVEL_WARNING = @as(u32, 3);
pub const TRACE_LEVEL_INFORMATION = @as(u32, 4);
pub const TRACE_LEVEL_VERBOSE = @as(u32, 5);
pub const TRACE_LEVEL_RESERVED6 = @as(u32, 6);
pub const TRACE_LEVEL_RESERVED7 = @as(u32, 7);
pub const TRACE_LEVEL_RESERVED8 = @as(u32, 8);
pub const TRACE_LEVEL_RESERVED9 = @as(u32, 9);
pub const EVENT_TRACE_TYPE_LOAD = @as(u32, 10);
pub const EVENT_TRACE_TYPE_TERMINATE = @as(u32, 11);
pub const EVENT_TRACE_TYPE_IO_READ = @as(u32, 10);
pub const EVENT_TRACE_TYPE_IO_WRITE = @as(u32, 11);
pub const EVENT_TRACE_TYPE_IO_READ_INIT = @as(u32, 12);
pub const EVENT_TRACE_TYPE_IO_WRITE_INIT = @as(u32, 13);
pub const EVENT_TRACE_TYPE_IO_FLUSH = @as(u32, 14);
pub const EVENT_TRACE_TYPE_IO_FLUSH_INIT = @as(u32, 15);
pub const EVENT_TRACE_TYPE_IO_REDIRECTED_INIT = @as(u32, 16);
pub const EVENT_TRACE_TYPE_MM_TF = @as(u32, 10);
pub const EVENT_TRACE_TYPE_MM_DZF = @as(u32, 11);
pub const EVENT_TRACE_TYPE_MM_COW = @as(u32, 12);
pub const EVENT_TRACE_TYPE_MM_GPF = @as(u32, 13);
pub const EVENT_TRACE_TYPE_MM_HPF = @as(u32, 14);
pub const EVENT_TRACE_TYPE_MM_AV = @as(u32, 15);
pub const EVENT_TRACE_TYPE_SEND = @as(u32, 10);
pub const EVENT_TRACE_TYPE_RECEIVE = @as(u32, 11);
pub const EVENT_TRACE_TYPE_CONNECT = @as(u32, 12);
pub const EVENT_TRACE_TYPE_DISCONNECT = @as(u32, 13);
pub const EVENT_TRACE_TYPE_RETRANSMIT = @as(u32, 14);
pub const EVENT_TRACE_TYPE_ACCEPT = @as(u32, 15);
pub const EVENT_TRACE_TYPE_RECONNECT = @as(u32, 16);
pub const EVENT_TRACE_TYPE_CONNFAIL = @as(u32, 17);
pub const EVENT_TRACE_TYPE_COPY_TCP = @as(u32, 18);
pub const EVENT_TRACE_TYPE_COPY_ARP = @as(u32, 19);
pub const EVENT_TRACE_TYPE_ACKFULL = @as(u32, 20);
pub const EVENT_TRACE_TYPE_ACKPART = @as(u32, 21);
pub const EVENT_TRACE_TYPE_ACKDUP = @as(u32, 22);
pub const EVENT_TRACE_TYPE_GUIDMAP = @as(u32, 10);
pub const EVENT_TRACE_TYPE_CONFIG = @as(u32, 11);
pub const EVENT_TRACE_TYPE_SIDINFO = @as(u32, 12);
pub const EVENT_TRACE_TYPE_SECURITY = @as(u32, 13);
pub const EVENT_TRACE_TYPE_DBGID_RSDS = @as(u32, 64);
pub const EVENT_TRACE_TYPE_REGCREATE = @as(u32, 10);
pub const EVENT_TRACE_TYPE_REGOPEN = @as(u32, 11);
pub const EVENT_TRACE_TYPE_REGDELETE = @as(u32, 12);
pub const EVENT_TRACE_TYPE_REGQUERY = @as(u32, 13);
pub const EVENT_TRACE_TYPE_REGSETVALUE = @as(u32, 14);
pub const EVENT_TRACE_TYPE_REGDELETEVALUE = @as(u32, 15);
pub const EVENT_TRACE_TYPE_REGQUERYVALUE = @as(u32, 16);
pub const EVENT_TRACE_TYPE_REGENUMERATEKEY = @as(u32, 17);
pub const EVENT_TRACE_TYPE_REGENUMERATEVALUEKEY = @as(u32, 18);
pub const EVENT_TRACE_TYPE_REGQUERYMULTIPLEVALUE = @as(u32, 19);
pub const EVENT_TRACE_TYPE_REGSETINFORMATION = @as(u32, 20);
pub const EVENT_TRACE_TYPE_REGFLUSH = @as(u32, 21);
pub const EVENT_TRACE_TYPE_REGKCBCREATE = @as(u32, 22);
pub const EVENT_TRACE_TYPE_REGKCBDELETE = @as(u32, 23);
pub const EVENT_TRACE_TYPE_REGKCBRUNDOWNBEGIN = @as(u32, 24);
pub const EVENT_TRACE_TYPE_REGKCBRUNDOWNEND = @as(u32, 25);
pub const EVENT_TRACE_TYPE_REGVIRTUALIZE = @as(u32, 26);
pub const EVENT_TRACE_TYPE_REGCLOSE = @as(u32, 27);
pub const EVENT_TRACE_TYPE_REGSETSECURITY = @as(u32, 28);
pub const EVENT_TRACE_TYPE_REGQUERYSECURITY = @as(u32, 29);
pub const EVENT_TRACE_TYPE_REGCOMMIT = @as(u32, 30);
pub const EVENT_TRACE_TYPE_REGPREPARE = @as(u32, 31);
pub const EVENT_TRACE_TYPE_REGROLLBACK = @as(u32, 32);
pub const EVENT_TRACE_TYPE_REGMOUNTHIVE = @as(u32, 33);
pub const EVENT_TRACE_TYPE_CONFIG_CPU = @as(u32, 10);
pub const EVENT_TRACE_TYPE_CONFIG_PHYSICALDISK = @as(u32, 11);
pub const EVENT_TRACE_TYPE_CONFIG_LOGICALDISK = @as(u32, 12);
pub const EVENT_TRACE_TYPE_CONFIG_NIC = @as(u32, 13);
pub const EVENT_TRACE_TYPE_CONFIG_VIDEO = @as(u32, 14);
pub const EVENT_TRACE_TYPE_CONFIG_SERVICES = @as(u32, 15);
pub const EVENT_TRACE_TYPE_CONFIG_POWER = @as(u32, 16);
pub const EVENT_TRACE_TYPE_CONFIG_NETINFO = @as(u32, 17);
pub const EVENT_TRACE_TYPE_CONFIG_OPTICALMEDIA = @as(u32, 18);
pub const EVENT_TRACE_TYPE_CONFIG_IRQ = @as(u32, 21);
pub const EVENT_TRACE_TYPE_CONFIG_PNP = @as(u32, 22);
pub const EVENT_TRACE_TYPE_CONFIG_IDECHANNEL = @as(u32, 23);
pub const EVENT_TRACE_TYPE_CONFIG_NUMANODE = @as(u32, 24);
pub const EVENT_TRACE_TYPE_CONFIG_PLATFORM = @as(u32, 25);
pub const EVENT_TRACE_TYPE_CONFIG_PROCESSORGROUP = @as(u32, 26);
pub const EVENT_TRACE_TYPE_CONFIG_PROCESSORNUMBER = @as(u32, 27);
pub const EVENT_TRACE_TYPE_CONFIG_DPI = @as(u32, 28);
pub const EVENT_TRACE_TYPE_CONFIG_CI_INFO = @as(u32, 29);
pub const EVENT_TRACE_TYPE_CONFIG_MACHINEID = @as(u32, 30);
pub const EVENT_TRACE_TYPE_CONFIG_DEFRAG = @as(u32, 31);
pub const EVENT_TRACE_TYPE_CONFIG_MOBILEPLATFORM = @as(u32, 32);
pub const EVENT_TRACE_TYPE_CONFIG_DEVICEFAMILY = @as(u32, 33);
pub const EVENT_TRACE_TYPE_CONFIG_FLIGHTID = @as(u32, 34);
pub const EVENT_TRACE_TYPE_CONFIG_PROCESSOR = @as(u32, 35);
pub const EVENT_TRACE_TYPE_CONFIG_VIRTUALIZATION = @as(u32, 36);
pub const EVENT_TRACE_TYPE_CONFIG_BOOT = @as(u32, 37);
pub const EVENT_TRACE_TYPE_OPTICAL_IO_READ = @as(u32, 55);
pub const EVENT_TRACE_TYPE_OPTICAL_IO_WRITE = @as(u32, 56);
pub const EVENT_TRACE_TYPE_OPTICAL_IO_FLUSH = @as(u32, 57);
pub const EVENT_TRACE_TYPE_OPTICAL_IO_READ_INIT = @as(u32, 58);
pub const EVENT_TRACE_TYPE_OPTICAL_IO_WRITE_INIT = @as(u32, 59);
pub const EVENT_TRACE_TYPE_OPTICAL_IO_FLUSH_INIT = @as(u32, 60);
pub const EVENT_TRACE_TYPE_FLT_PREOP_INIT = @as(u32, 96);
pub const EVENT_TRACE_TYPE_FLT_POSTOP_INIT = @as(u32, 97);
pub const EVENT_TRACE_TYPE_FLT_PREOP_COMPLETION = @as(u32, 98);
pub const EVENT_TRACE_TYPE_FLT_POSTOP_COMPLETION = @as(u32, 99);
pub const EVENT_TRACE_TYPE_FLT_PREOP_FAILURE = @as(u32, 100);
pub const EVENT_TRACE_TYPE_FLT_POSTOP_FAILURE = @as(u32, 101);
pub const EVENT_TRACE_FLAG_DEBUG_EVENTS = @as(u32, 4194304);
pub const EVENT_TRACE_FLAG_EXTENSION = @as(u32, 2147483648);
pub const EVENT_TRACE_FLAG_FORWARD_WMI = @as(u32, 1073741824);
pub const EVENT_TRACE_FLAG_ENABLE_RESERVE = @as(u32, 536870912);
pub const EVENT_TRACE_FILE_MODE_NONE = @as(u32, 0);
pub const EVENT_TRACE_FILE_MODE_SEQUENTIAL = @as(u32, 1);
pub const EVENT_TRACE_FILE_MODE_CIRCULAR = @as(u32, 2);
pub const EVENT_TRACE_FILE_MODE_APPEND = @as(u32, 4);
pub const EVENT_TRACE_REAL_TIME_MODE = @as(u32, 256);
pub const EVENT_TRACE_DELAY_OPEN_FILE_MODE = @as(u32, 512);
pub const EVENT_TRACE_BUFFERING_MODE = @as(u32, 1024);
pub const EVENT_TRACE_PRIVATE_LOGGER_MODE = @as(u32, 2048);
pub const EVENT_TRACE_ADD_HEADER_MODE = @as(u32, 4096);
pub const EVENT_TRACE_USE_GLOBAL_SEQUENCE = @as(u32, 16384);
pub const EVENT_TRACE_USE_LOCAL_SEQUENCE = @as(u32, 32768);
pub const EVENT_TRACE_RELOG_MODE = @as(u32, 65536);
pub const EVENT_TRACE_USE_PAGED_MEMORY = @as(u32, 16777216);
pub const EVENT_TRACE_FILE_MODE_NEWFILE = @as(u32, 8);
pub const EVENT_TRACE_FILE_MODE_PREALLOCATE = @as(u32, 32);
pub const EVENT_TRACE_NONSTOPPABLE_MODE = @as(u32, 64);
pub const EVENT_TRACE_SECURE_MODE = @as(u32, 128);
pub const EVENT_TRACE_USE_KBYTES_FOR_SIZE = @as(u32, 8192);
pub const EVENT_TRACE_PRIVATE_IN_PROC = @as(u32, 131072);
pub const EVENT_TRACE_MODE_RESERVED = @as(u32, 1048576);
pub const EVENT_TRACE_NO_PER_PROCESSOR_BUFFERING = @as(u32, 268435456);
pub const EVENT_TRACE_SYSTEM_LOGGER_MODE = @as(u32, 33554432);
pub const EVENT_TRACE_ADDTO_TRIAGE_DUMP = @as(u32, 2147483648);
pub const EVENT_TRACE_STOP_ON_HYBRID_SHUTDOWN = @as(u32, 4194304);
pub const EVENT_TRACE_PERSIST_ON_HYBRID_SHUTDOWN = @as(u32, 8388608);
pub const EVENT_TRACE_INDEPENDENT_SESSION_MODE = @as(u32, 134217728);
pub const EVENT_TRACE_COMPRESSED_MODE = @as(u32, 67108864);
pub const EVENT_TRACE_CONTROL_INCREMENT_FILE = @as(u32, 4);
pub const EVENT_TRACE_CONTROL_CONVERT_TO_REALTIME = @as(u32, 5);
pub const TRACE_MESSAGE_PERFORMANCE_TIMESTAMP = @as(u32, 16);
pub const TRACE_MESSAGE_POINTER32 = @as(u32, 64);
pub const TRACE_MESSAGE_POINTER64 = @as(u32, 128);
pub const TRACE_MESSAGE_FLAG_MASK = @as(u32, 65535);
pub const EVENT_TRACE_USE_PROCTIME = @as(u32, 1);
pub const EVENT_TRACE_USE_NOCPUTIME = @as(u32, 2);
pub const TRACE_HEADER_FLAG_USE_TIMESTAMP = @as(u32, 512);
pub const TRACE_HEADER_FLAG_TRACED_GUID = @as(u32, 131072);
pub const TRACE_HEADER_FLAG_LOG_WNODE = @as(u32, 262144);
pub const TRACE_HEADER_FLAG_USE_GUID_PTR = @as(u32, 524288);
pub const TRACE_HEADER_FLAG_USE_MOF_PTR = @as(u32, 1048576);
pub const SYSTEM_ALPC_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_CONFIG_KW_SYSTEM = @as(u64, 1);
pub const SYSTEM_CONFIG_KW_GRAPHICS = @as(u64, 2);
pub const SYSTEM_CONFIG_KW_STORAGE = @as(u64, 4);
pub const SYSTEM_CONFIG_KW_NETWORK = @as(u64, 8);
pub const SYSTEM_CONFIG_KW_SERVICES = @as(u64, 16);
pub const SYSTEM_CONFIG_KW_PNP = @as(u64, 32);
pub const SYSTEM_CONFIG_KW_OPTICAL = @as(u64, 64);
pub const SYSTEM_CPU_KW_CONFIG = @as(u64, 1);
pub const SYSTEM_CPU_KW_CACHE_FLUSH = @as(u64, 2);
pub const SYSTEM_CPU_KW_SPEC_CONTROL = @as(u64, 4);
pub const SYSTEM_HYPERVISOR_KW_PROFILE = @as(u64, 1);
pub const SYSTEM_HYPERVISOR_KW_CALLOUTS = @as(u64, 2);
pub const SYSTEM_HYPERVISOR_KW_VTL_CHANGE = @as(u64, 4);
pub const SYSTEM_INTERRUPT_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_INTERRUPT_KW_CLOCK_INTERRUPT = @as(u64, 2);
pub const SYSTEM_INTERRUPT_KW_DPC = @as(u64, 4);
pub const SYSTEM_INTERRUPT_KW_DPC_QUEUE = @as(u64, 8);
pub const SYSTEM_INTERRUPT_KW_WDF_DPC = @as(u64, 16);
pub const SYSTEM_INTERRUPT_KW_WDF_INTERRUPT = @as(u64, 32);
pub const SYSTEM_INTERRUPT_KW_IPI = @as(u64, 64);
pub const SYSTEM_IO_KW_DISK = @as(u64, 1);
pub const SYSTEM_IO_KW_DISK_INIT = @as(u64, 2);
pub const SYSTEM_IO_KW_FILENAME = @as(u64, 4);
pub const SYSTEM_IO_KW_SPLIT = @as(u64, 8);
pub const SYSTEM_IO_KW_FILE = @as(u64, 16);
pub const SYSTEM_IO_KW_OPTICAL = @as(u64, 32);
pub const SYSTEM_IO_KW_OPTICAL_INIT = @as(u64, 64);
pub const SYSTEM_IO_KW_DRIVERS = @as(u64, 128);
pub const SYSTEM_IO_KW_CC = @as(u64, 256);
pub const SYSTEM_IO_KW_NETWORK = @as(u64, 512);
pub const SYSTEM_IOFILTER_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_IOFILTER_KW_INIT = @as(u64, 2);
pub const SYSTEM_IOFILTER_KW_FASTIO = @as(u64, 4);
pub const SYSTEM_IOFILTER_KW_FAILURE = @as(u64, 8);
pub const SYSTEM_LOCK_KW_SPINLOCK = @as(u64, 1);
pub const SYSTEM_LOCK_KW_SPINLOCK_COUNTERS = @as(u64, 2);
pub const SYSTEM_LOCK_KW_SYNC_OBJECTS = @as(u64, 4);
pub const SYSTEM_MEMORY_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_MEMORY_KW_HARD_FAULTS = @as(u64, 2);
pub const SYSTEM_MEMORY_KW_ALL_FAULTS = @as(u64, 4);
pub const SYSTEM_MEMORY_KW_POOL = @as(u64, 8);
pub const SYSTEM_MEMORY_KW_MEMINFO = @as(u64, 16);
pub const SYSTEM_MEMORY_KW_PFSECTION = @as(u64, 32);
pub const SYSTEM_MEMORY_KW_MEMINFO_WS = @as(u64, 64);
pub const SYSTEM_MEMORY_KW_HEAP = @as(u64, 128);
pub const SYSTEM_MEMORY_KW_WS = @as(u64, 256);
pub const SYSTEM_MEMORY_KW_CONTMEM_GEN = @as(u64, 512);
pub const SYSTEM_MEMORY_KW_VIRTUAL_ALLOC = @as(u64, 1024);
pub const SYSTEM_MEMORY_KW_FOOTPRINT = @as(u64, 2048);
pub const SYSTEM_MEMORY_KW_SESSION = @as(u64, 4096);
pub const SYSTEM_MEMORY_KW_REFSET = @as(u64, 8192);
pub const SYSTEM_MEMORY_KW_VAMAP = @as(u64, 16384);
pub const SYSTEM_MEMORY_KW_NONTRADEABLE = @as(u64, 32768);
pub const SYSTEM_OBJECT_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_OBJECT_KW_HANDLE = @as(u64, 2);
pub const SYSTEM_POWER_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_POWER_KW_HIBER_RUNDOWN = @as(u64, 2);
pub const SYSTEM_POWER_KW_PROCESSOR_IDLE = @as(u64, 4);
pub const SYSTEM_POWER_KW_IDLE_SELECTION = @as(u64, 8);
pub const SYSTEM_POWER_KW_PPM_EXIT_LATENCY = @as(u64, 16);
pub const SYSTEM_PROCESS_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_PROCESS_KW_INSWAP = @as(u64, 2);
pub const SYSTEM_PROCESS_KW_FREEZE = @as(u64, 4);
pub const SYSTEM_PROCESS_KW_PERF_COUNTER = @as(u64, 8);
pub const SYSTEM_PROCESS_KW_WAKE_COUNTER = @as(u64, 16);
pub const SYSTEM_PROCESS_KW_WAKE_DROP = @as(u64, 32);
pub const SYSTEM_PROCESS_KW_WAKE_EVENT = @as(u64, 64);
pub const SYSTEM_PROCESS_KW_DEBUG_EVENTS = @as(u64, 128);
pub const SYSTEM_PROCESS_KW_DBGPRINT = @as(u64, 256);
pub const SYSTEM_PROCESS_KW_JOB = @as(u64, 512);
pub const SYSTEM_PROCESS_KW_WORKER_THREAD = @as(u64, 1024);
pub const SYSTEM_PROCESS_KW_THREAD = @as(u64, 2048);
pub const SYSTEM_PROCESS_KW_LOADER = @as(u64, 4096);
pub const SYSTEM_PROFILE_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_PROFILE_KW_PMC_PROFILE = @as(u64, 2);
pub const SYSTEM_REGISTRY_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_REGISTRY_KW_HIVE = @as(u64, 2);
pub const SYSTEM_REGISTRY_KW_NOTIFICATION = @as(u64, 4);
pub const SYSTEM_SCHEDULER_KW_XSCHEDULER = @as(u64, 1);
pub const SYSTEM_SCHEDULER_KW_DISPATCHER = @as(u64, 2);
pub const SYSTEM_SCHEDULER_KW_KERNEL_QUEUE = @as(u64, 4);
pub const SYSTEM_SCHEDULER_KW_SHOULD_YIELD = @as(u64, 8);
pub const SYSTEM_SCHEDULER_KW_ANTI_STARVATION = @as(u64, 16);
pub const SYSTEM_SCHEDULER_KW_LOAD_BALANCER = @as(u64, 32);
pub const SYSTEM_SCHEDULER_KW_AFFINITY = @as(u64, 64);
pub const SYSTEM_SCHEDULER_KW_PRIORITY = @as(u64, 128);
pub const SYSTEM_SCHEDULER_KW_IDEAL_PROCESSOR = @as(u64, 256);
pub const SYSTEM_SCHEDULER_KW_CONTEXT_SWITCH = @as(u64, 512);
pub const SYSTEM_SCHEDULER_KW_COMPACT_CSWITCH = @as(u64, 1024);
pub const SYSTEM_SYSCALL_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_TIMER_KW_GENERAL = @as(u64, 1);
pub const SYSTEM_TIMER_KW_CLOCK_TIMER = @as(u64, 2);
pub const SYSTEM_MEMORY_POOL_FILTER_ID = @as(u32, 1);
pub const ETW_NULL_TYPE_VALUE = @as(u32, 0);
pub const ETW_OBJECT_TYPE_VALUE = @as(u32, 1);
pub const ETW_STRING_TYPE_VALUE = @as(u32, 2);
pub const ETW_SBYTE_TYPE_VALUE = @as(u32, 3);
pub const ETW_BYTE_TYPE_VALUE = @as(u32, 4);
pub const ETW_INT16_TYPE_VALUE = @as(u32, 5);
pub const ETW_UINT16_TYPE_VALUE = @as(u32, 6);
pub const ETW_INT32_TYPE_VALUE = @as(u32, 7);
pub const ETW_UINT32_TYPE_VALUE = @as(u32, 8);
pub const ETW_INT64_TYPE_VALUE = @as(u32, 9);
pub const ETW_UINT64_TYPE_VALUE = @as(u32, 10);
pub const ETW_CHAR_TYPE_VALUE = @as(u32, 11);
pub const ETW_SINGLE_TYPE_VALUE = @as(u32, 12);
pub const ETW_DOUBLE_TYPE_VALUE = @as(u32, 13);
pub const ETW_BOOLEAN_TYPE_VALUE = @as(u32, 14);
pub const ETW_DECIMAL_TYPE_VALUE = @as(u32, 15);
pub const ETW_GUID_TYPE_VALUE = @as(u32, 101);
pub const ETW_ASCIICHAR_TYPE_VALUE = @as(u32, 102);
pub const ETW_ASCIISTRING_TYPE_VALUE = @as(u32, 103);
pub const ETW_COUNTED_STRING_TYPE_VALUE = @as(u32, 104);
pub const ETW_POINTER_TYPE_VALUE = @as(u32, 105);
pub const ETW_SIZET_TYPE_VALUE = @as(u32, 106);
pub const ETW_HIDDEN_TYPE_VALUE = @as(u32, 107);
pub const ETW_BOOL_TYPE_VALUE = @as(u32, 108);
pub const ETW_COUNTED_ANSISTRING_TYPE_VALUE = @as(u32, 109);
pub const ETW_REVERSED_COUNTED_STRING_TYPE_VALUE = @as(u32, 110);
pub const ETW_REVERSED_COUNTED_ANSISTRING_TYPE_VALUE = @as(u32, 111);
pub const ETW_NON_NULL_TERMINATED_STRING_TYPE_VALUE = @as(u32, 112);
pub const ETW_REDUCED_ANSISTRING_TYPE_VALUE = @as(u32, 113);
pub const ETW_REDUCED_STRING_TYPE_VALUE = @as(u32, 114);
pub const ETW_SID_TYPE_VALUE = @as(u32, 115);
pub const ETW_VARIANT_TYPE_VALUE = @as(u32, 116);
pub const ETW_PTVECTOR_TYPE_VALUE = @as(u32, 117);
pub const ETW_WMITIME_TYPE_VALUE = @as(u32, 118);
pub const ETW_DATETIME_TYPE_VALUE = @as(u32, 119);
pub const ETW_REFRENCE_TYPE_VALUE = @as(u32, 120);
pub const TRACE_PROVIDER_FLAG_LEGACY = @as(u32, 1);
pub const TRACE_PROVIDER_FLAG_PRE_ENABLE = @as(u32, 2);
pub const ENABLE_TRACE_PARAMETERS_VERSION = @as(u32, 1);
pub const ENABLE_TRACE_PARAMETERS_VERSION_2 = @as(u32, 2);
pub const EVENT_MIN_LEVEL = @as(u32, 0);
pub const EVENT_MAX_LEVEL = @as(u32, 255);
pub const EVENT_ACTIVITY_CTRL_GET_ID = @as(u32, 1);
pub const EVENT_ACTIVITY_CTRL_SET_ID = @as(u32, 2);
pub const EVENT_ACTIVITY_CTRL_CREATE_ID = @as(u32, 3);
pub const EVENT_ACTIVITY_CTRL_GET_SET_ID = @as(u32, 4);
pub const EVENT_ACTIVITY_CTRL_CREATE_SET_ID = @as(u32, 5);
pub const MAX_EVENT_DATA_DESCRIPTORS = @as(u32, 128);
pub const MAX_EVENT_FILTER_DATA_SIZE = @as(u32, 1024);
pub const MAX_EVENT_FILTER_PAYLOAD_SIZE = @as(u32, 4096);
pub const MAX_EVENT_FILTER_EVENT_NAME_SIZE = @as(u32, 4096);
pub const MAX_EVENT_FILTERS_COUNT = @as(u32, 13);
pub const MAX_EVENT_FILTER_PID_COUNT = @as(u32, 8);
pub const MAX_EVENT_FILTER_EVENT_ID_COUNT = @as(u32, 64);
pub const EVENT_FILTER_TYPE_NONE = @as(u32, 0);
pub const EVENT_FILTER_TYPE_SCHEMATIZED = @as(u32, 2147483648);
pub const EVENT_FILTER_TYPE_SYSTEM_FLAGS = @as(u32, 2147483649);
pub const EVENT_FILTER_TYPE_TRACEHANDLE = @as(u32, 2147483650);
pub const EVENT_FILTER_TYPE_PID = @as(u32, 2147483652);
pub const EVENT_FILTER_TYPE_EXECUTABLE_NAME = @as(u32, 2147483656);
pub const EVENT_FILTER_TYPE_PACKAGE_ID = @as(u32, 2147483664);
pub const EVENT_FILTER_TYPE_PACKAGE_APP_ID = @as(u32, 2147483680);
pub const EVENT_FILTER_TYPE_PAYLOAD = @as(u32, 2147483904);
pub const EVENT_FILTER_TYPE_EVENT_ID = @as(u32, 2147484160);
pub const EVENT_FILTER_TYPE_EVENT_NAME = @as(u32, 2147484672);
pub const EVENT_FILTER_TYPE_STACKWALK = @as(u32, 2147487744);
pub const EVENT_FILTER_TYPE_STACKWALK_NAME = @as(u32, 2147491840);
pub const EVENT_FILTER_TYPE_STACKWALK_LEVEL_KW = @as(u32, 2147500032);
pub const EVENT_FILTER_TYPE_CONTAINER = @as(u32, 2147516416);
pub const EVENT_DATA_DESCRIPTOR_TYPE_NONE = @as(u32, 0);
pub const EVENT_DATA_DESCRIPTOR_TYPE_EVENT_METADATA = @as(u32, 1);
pub const EVENT_DATA_DESCRIPTOR_TYPE_PROVIDER_METADATA = @as(u32, 2);
pub const EVENT_DATA_DESCRIPTOR_TYPE_TIMESTAMP_OVERRIDE = @as(u32, 3);
pub const EVENT_WRITE_FLAG_NO_FAULTING = @as(u32, 1);
pub const EVENT_WRITE_FLAG_INPRIVATE = @as(u32, 2);
pub const EVENT_HEADER_EXT_TYPE_RELATED_ACTIVITYID = @as(u32, 1);
pub const EVENT_HEADER_EXT_TYPE_SID = @as(u32, 2);
pub const EVENT_HEADER_EXT_TYPE_TS_ID = @as(u32, 3);
pub const EVENT_HEADER_EXT_TYPE_INSTANCE_INFO = @as(u32, 4);
pub const EVENT_HEADER_EXT_TYPE_STACK_TRACE32 = @as(u32, 5);
pub const EVENT_HEADER_EXT_TYPE_STACK_TRACE64 = @as(u32, 6);
pub const EVENT_HEADER_EXT_TYPE_PEBS_INDEX = @as(u32, 7);
pub const EVENT_HEADER_EXT_TYPE_PMC_COUNTERS = @as(u32, 8);
pub const EVENT_HEADER_EXT_TYPE_PSM_KEY = @as(u32, 9);
pub const EVENT_HEADER_EXT_TYPE_EVENT_KEY = @as(u32, 10);
pub const EVENT_HEADER_EXT_TYPE_EVENT_SCHEMA_TL = @as(u32, 11);
pub const EVENT_HEADER_EXT_TYPE_PROV_TRAITS = @as(u32, 12);
pub const EVENT_HEADER_EXT_TYPE_PROCESS_START_KEY = @as(u32, 13);
pub const EVENT_HEADER_EXT_TYPE_CONTROL_GUID = @as(u32, 14);
pub const EVENT_HEADER_EXT_TYPE_QPC_DELTA = @as(u32, 15);
pub const EVENT_HEADER_EXT_TYPE_CONTAINER_ID = @as(u32, 16);
pub const EVENT_HEADER_EXT_TYPE_STACK_KEY32 = @as(u32, 17);
pub const EVENT_HEADER_EXT_TYPE_STACK_KEY64 = @as(u32, 18);
pub const EVENT_HEADER_EXT_TYPE_MAX = @as(u32, 19);
pub const EVENT_HEADER_PROPERTY_XML = @as(u32, 1);
pub const EVENT_HEADER_PROPERTY_FORWARDED_XML = @as(u32, 2);
pub const EVENT_HEADER_PROPERTY_LEGACY_EVENTLOG = @as(u32, 4);
pub const EVENT_HEADER_PROPERTY_RELOGGABLE = @as(u32, 8);
pub const EVENT_HEADER_FLAG_EXTENDED_INFO = @as(u32, 1);
pub const EVENT_HEADER_FLAG_PRIVATE_SESSION = @as(u32, 2);
pub const EVENT_HEADER_FLAG_STRING_ONLY = @as(u32, 4);
pub const EVENT_HEADER_FLAG_TRACE_MESSAGE = @as(u32, 8);
pub const EVENT_HEADER_FLAG_NO_CPUTIME = @as(u32, 16);
pub const EVENT_HEADER_FLAG_32_BIT_HEADER = @as(u32, 32);
pub const EVENT_HEADER_FLAG_64_BIT_HEADER = @as(u32, 64);
pub const EVENT_HEADER_FLAG_DECODE_GUID = @as(u32, 128);
pub const EVENT_HEADER_FLAG_CLASSIC_HEADER = @as(u32, 256);
pub const EVENT_HEADER_FLAG_PROCESSOR_INDEX = @as(u32, 512);
pub const EVENT_ENABLE_PROPERTY_SID = @as(u32, 1);
pub const EVENT_ENABLE_PROPERTY_TS_ID = @as(u32, 2);
pub const EVENT_ENABLE_PROPERTY_STACK_TRACE = @as(u32, 4);
pub const EVENT_ENABLE_PROPERTY_PSM_KEY = @as(u32, 8);
pub const EVENT_ENABLE_PROPERTY_IGNORE_KEYWORD_0 = @as(u32, 16);
pub const EVENT_ENABLE_PROPERTY_PROVIDER_GROUP = @as(u32, 32);
pub const EVENT_ENABLE_PROPERTY_ENABLE_KEYWORD_0 = @as(u32, 64);
pub const EVENT_ENABLE_PROPERTY_PROCESS_START_KEY = @as(u32, 128);
pub const EVENT_ENABLE_PROPERTY_EVENT_KEY = @as(u32, 256);
pub const EVENT_ENABLE_PROPERTY_EXCLUDE_INPRIVATE = @as(u32, 512);
pub const EVENT_ENABLE_PROPERTY_ENABLE_SILOS = @as(u32, 1024);
pub const EVENT_ENABLE_PROPERTY_SOURCE_CONTAINER_TRACKING = @as(u32, 2048);
pub const PROCESS_TRACE_MODE_REAL_TIME = @as(u32, 256);
pub const PROCESS_TRACE_MODE_RAW_TIMESTAMP = @as(u32, 4096);
pub const PROCESS_TRACE_MODE_EVENT_RECORD = @as(u32, 268435456);
pub const CLSID_TraceRelogger = Guid.initString("7b40792d-05ff-44c4-9058-f440c71f17d4");

//--------------------------------------------------------------------------------
// Section: Types (108)
//--------------------------------------------------------------------------------
pub const TRACE_MESSAGE_FLAGS = enum(u32) {
    COMPONENTID = 4,
    GUID = 2,
    SEQUENCE = 1,
    SYSTEMINFO = 32,
    TIMESTAMP = 8,
    _,
    pub fn initFlags(o: struct {
        COMPONENTID: u1 = 0,
        GUID: u1 = 0,
        SEQUENCE: u1 = 0,
        SYSTEMINFO: u1 = 0,
        TIMESTAMP: u1 = 0,
    }) TRACE_MESSAGE_FLAGS {
        return @as(TRACE_MESSAGE_FLAGS, @enumFromInt((if (o.COMPONENTID == 1) @intFromEnum(TRACE_MESSAGE_FLAGS.COMPONENTID) else 0) | (if (o.GUID == 1) @intFromEnum(TRACE_MESSAGE_FLAGS.GUID) else 0) | (if (o.SEQUENCE == 1) @intFromEnum(TRACE_MESSAGE_FLAGS.SEQUENCE) else 0) | (if (o.SYSTEMINFO == 1) @intFromEnum(TRACE_MESSAGE_FLAGS.SYSTEMINFO) else 0) | (if (o.TIMESTAMP == 1) @intFromEnum(TRACE_MESSAGE_FLAGS.TIMESTAMP) else 0)));
    }
};
pub const TRACE_MESSAGE_COMPONENTID = TRACE_MESSAGE_FLAGS.COMPONENTID;
pub const TRACE_MESSAGE_GUID = TRACE_MESSAGE_FLAGS.GUID;
pub const TRACE_MESSAGE_SEQUENCE = TRACE_MESSAGE_FLAGS.SEQUENCE;
pub const TRACE_MESSAGE_SYSTEMINFO = TRACE_MESSAGE_FLAGS.SYSTEMINFO;
pub const TRACE_MESSAGE_TIMESTAMP = TRACE_MESSAGE_FLAGS.TIMESTAMP;

pub const ENABLECALLBACK_ENABLED_STATE = enum(u32) {
    DISABLE_PROVIDER = 0,
    ENABLE_PROVIDER = 1,
    CAPTURE_STATE = 2,
};
pub const EVENT_CONTROL_CODE_DISABLE_PROVIDER = ENABLECALLBACK_ENABLED_STATE.DISABLE_PROVIDER;
pub const EVENT_CONTROL_CODE_ENABLE_PROVIDER = ENABLECALLBACK_ENABLED_STATE.ENABLE_PROVIDER;
pub const EVENT_CONTROL_CODE_CAPTURE_STATE = ENABLECALLBACK_ENABLED_STATE.CAPTURE_STATE;

pub const EVENT_TRACE_CONTROL = enum(u32) {
    FLUSH = 3,
    QUERY = 0,
    STOP = 1,
    UPDATE = 2,
};
pub const EVENT_TRACE_CONTROL_FLUSH = EVENT_TRACE_CONTROL.FLUSH;
pub const EVENT_TRACE_CONTROL_QUERY = EVENT_TRACE_CONTROL.QUERY;
pub const EVENT_TRACE_CONTROL_STOP = EVENT_TRACE_CONTROL.STOP;
pub const EVENT_TRACE_CONTROL_UPDATE = EVENT_TRACE_CONTROL.UPDATE;

pub const EVENT_TRACE_FLAG = enum(u32) {
    ALPC = 1048576,
    CSWITCH = 16,
    DBGPRINT = 262144,
    DISK_FILE_IO = 512,
    DISK_IO = 256,
    DISK_IO_INIT = 1024,
    DISPATCHER = 2048,
    DPC = 32,
    DRIVER = 8388608,
    FILE_IO = 33554432,
    FILE_IO_INIT = 67108864,
    IMAGE_LOAD = 4,
    INTERRUPT = 64,
    JOB = 524288,
    MEMORY_HARD_FAULTS = 8192,
    MEMORY_PAGE_FAULTS = 4096,
    NETWORK_TCPIP = 65536,
    NO_SYSCONFIG = 268435456,
    PROCESS = 1,
    PROCESS_COUNTERS = 8,
    PROFILE = 16777216,
    REGISTRY = 131072,
    SPLIT_IO = 2097152,
    SYSTEMCALL = 128,
    THREAD = 2,
    VAMAP = 32768,
    VIRTUAL_ALLOC = 16384,
    _,
    pub fn initFlags(o: struct {
        ALPC: u1 = 0,
        CSWITCH: u1 = 0,
        DBGPRINT: u1 = 0,
        DISK_FILE_IO: u1 = 0,
        DISK_IO: u1 = 0,
        DISK_IO_INIT: u1 = 0,
        DISPATCHER: u1 = 0,
        DPC: u1 = 0,
        DRIVER: u1 = 0,
        FILE_IO: u1 = 0,
        FILE_IO_INIT: u1 = 0,
        IMAGE_LOAD: u1 = 0,
        INTERRUPT: u1 = 0,
        JOB: u1 = 0,
        MEMORY_HARD_FAULTS: u1 = 0,
        MEMORY_PAGE_FAULTS: u1 = 0,
        NETWORK_TCPIP: u1 = 0,
        NO_SYSCONFIG: u1 = 0,
        PROCESS: u1 = 0,
        PROCESS_COUNTERS: u1 = 0,
        PROFILE: u1 = 0,
        REGISTRY: u1 = 0,
        SPLIT_IO: u1 = 0,
        SYSTEMCALL: u1 = 0,
        THREAD: u1 = 0,
        VAMAP: u1 = 0,
        VIRTUAL_ALLOC: u1 = 0,
    }) EVENT_TRACE_FLAG {
        return @as(EVENT_TRACE_FLAG, @enumFromInt((if (o.ALPC == 1) @intFromEnum(EVENT_TRACE_FLAG.ALPC) else 0) | (if (o.CSWITCH == 1) @intFromEnum(EVENT_TRACE_FLAG.CSWITCH) else 0) | (if (o.DBGPRINT == 1) @intFromEnum(EVENT_TRACE_FLAG.DBGPRINT) else 0) | (if (o.DISK_FILE_IO == 1) @intFromEnum(EVENT_TRACE_FLAG.DISK_FILE_IO) else 0) | (if (o.DISK_IO == 1) @intFromEnum(EVENT_TRACE_FLAG.DISK_IO) else 0) | (if (o.DISK_IO_INIT == 1) @intFromEnum(EVENT_TRACE_FLAG.DISK_IO_INIT) else 0) | (if (o.DISPATCHER == 1) @intFromEnum(EVENT_TRACE_FLAG.DISPATCHER) else 0) | (if (o.DPC == 1) @intFromEnum(EVENT_TRACE_FLAG.DPC) else 0) | (if (o.DRIVER == 1) @intFromEnum(EVENT_TRACE_FLAG.DRIVER) else 0) | (if (o.FILE_IO == 1) @intFromEnum(EVENT_TRACE_FLAG.FILE_IO) else 0) | (if (o.FILE_IO_INIT == 1) @intFromEnum(EVENT_TRACE_FLAG.FILE_IO_INIT) else 0) | (if (o.IMAGE_LOAD == 1) @intFromEnum(EVENT_TRACE_FLAG.IMAGE_LOAD) else 0) | (if (o.INTERRUPT == 1) @intFromEnum(EVENT_TRACE_FLAG.INTERRUPT) else 0) | (if (o.JOB == 1) @intFromEnum(EVENT_TRACE_FLAG.JOB) else 0) | (if (o.MEMORY_HARD_FAULTS == 1) @intFromEnum(EVENT_TRACE_FLAG.MEMORY_HARD_FAULTS) else 0) | (if (o.MEMORY_PAGE_FAULTS == 1) @intFromEnum(EVENT_TRACE_FLAG.MEMORY_PAGE_FAULTS) else 0) | (if (o.NETWORK_TCPIP == 1) @intFromEnum(EVENT_TRACE_FLAG.NETWORK_TCPIP) else 0) | (if (o.NO_SYSCONFIG == 1) @intFromEnum(EVENT_TRACE_FLAG.NO_SYSCONFIG) else 0) | (if (o.PROCESS == 1) @intFromEnum(EVENT_TRACE_FLAG.PROCESS) else 0) | (if (o.PROCESS_COUNTERS == 1) @intFromEnum(EVENT_TRACE_FLAG.PROCESS_COUNTERS) else 0) | (if (o.PROFILE == 1) @intFromEnum(EVENT_TRACE_FLAG.PROFILE) else 0) | (if (o.REGISTRY == 1) @intFromEnum(EVENT_TRACE_FLAG.REGISTRY) else 0) | (if (o.SPLIT_IO == 1) @intFromEnum(EVENT_TRACE_FLAG.SPLIT_IO) else 0) | (if (o.SYSTEMCALL == 1) @intFromEnum(EVENT_TRACE_FLAG.SYSTEMCALL) else 0) | (if (o.THREAD == 1) @intFromEnum(EVENT_TRACE_FLAG.THREAD) else 0) | (if (o.VAMAP == 1) @intFromEnum(EVENT_TRACE_FLAG.VAMAP) else 0) | (if (o.VIRTUAL_ALLOC == 1) @intFromEnum(EVENT_TRACE_FLAG.VIRTUAL_ALLOC) else 0)));
    }
};
pub const EVENT_TRACE_FLAG_ALPC = EVENT_TRACE_FLAG.ALPC;
pub const EVENT_TRACE_FLAG_CSWITCH = EVENT_TRACE_FLAG.CSWITCH;
pub const EVENT_TRACE_FLAG_DBGPRINT = EVENT_TRACE_FLAG.DBGPRINT;
pub const EVENT_TRACE_FLAG_DISK_FILE_IO = EVENT_TRACE_FLAG.DISK_FILE_IO;
pub const EVENT_TRACE_FLAG_DISK_IO = EVENT_TRACE_FLAG.DISK_IO;
pub const EVENT_TRACE_FLAG_DISK_IO_INIT = EVENT_TRACE_FLAG.DISK_IO_INIT;
pub const EVENT_TRACE_FLAG_DISPATCHER = EVENT_TRACE_FLAG.DISPATCHER;
pub const EVENT_TRACE_FLAG_DPC = EVENT_TRACE_FLAG.DPC;
pub const EVENT_TRACE_FLAG_DRIVER = EVENT_TRACE_FLAG.DRIVER;
pub const EVENT_TRACE_FLAG_FILE_IO = EVENT_TRACE_FLAG.FILE_IO;
pub const EVENT_TRACE_FLAG_FILE_IO_INIT = EVENT_TRACE_FLAG.FILE_IO_INIT;
pub const EVENT_TRACE_FLAG_IMAGE_LOAD = EVENT_TRACE_FLAG.IMAGE_LOAD;
pub const EVENT_TRACE_FLAG_INTERRUPT = EVENT_TRACE_FLAG.INTERRUPT;
pub const EVENT_TRACE_FLAG_JOB = EVENT_TRACE_FLAG.JOB;
pub const EVENT_TRACE_FLAG_MEMORY_HARD_FAULTS = EVENT_TRACE_FLAG.MEMORY_HARD_FAULTS;
pub const EVENT_TRACE_FLAG_MEMORY_PAGE_FAULTS = EVENT_TRACE_FLAG.MEMORY_PAGE_FAULTS;
pub const EVENT_TRACE_FLAG_NETWORK_TCPIP = EVENT_TRACE_FLAG.NETWORK_TCPIP;
pub const EVENT_TRACE_FLAG_NO_SYSCONFIG = EVENT_TRACE_FLAG.NO_SYSCONFIG;
pub const EVENT_TRACE_FLAG_PROCESS = EVENT_TRACE_FLAG.PROCESS;
pub const EVENT_TRACE_FLAG_PROCESS_COUNTERS = EVENT_TRACE_FLAG.PROCESS_COUNTERS;
pub const EVENT_TRACE_FLAG_PROFILE = EVENT_TRACE_FLAG.PROFILE;
pub const EVENT_TRACE_FLAG_REGISTRY = EVENT_TRACE_FLAG.REGISTRY;
pub const EVENT_TRACE_FLAG_SPLIT_IO = EVENT_TRACE_FLAG.SPLIT_IO;
pub const EVENT_TRACE_FLAG_SYSTEMCALL = EVENT_TRACE_FLAG.SYSTEMCALL;
pub const EVENT_TRACE_FLAG_THREAD = EVENT_TRACE_FLAG.THREAD;
pub const EVENT_TRACE_FLAG_VAMAP = EVENT_TRACE_FLAG.VAMAP;
pub const EVENT_TRACE_FLAG_VIRTUAL_ALLOC = EVENT_TRACE_FLAG.VIRTUAL_ALLOC;

// TODO: this type has a FreeFunc 'TdhCloseDecodingHandle', what can Zig do with this information?
pub const TDH_HANDLE = isize;

pub const WNODE_HEADER = extern struct {
    BufferSize: u32,
    ProviderId: u32,
    Anonymous1: extern union {
        HistoricalContext: u64,
        Anonymous: extern struct {
            Version: u32,
            Linkage: u32,
        },
    },
    Anonymous2: extern union {
        CountLost: u32,
        KernelHandle: ?HANDLE,
        TimeStamp: LARGE_INTEGER,
    },
    Guid: Guid,
    ClientContext: u32,
    Flags: u32,
};

pub const OFFSETINSTANCEDATAANDLENGTH = extern struct {
    OffsetInstanceData: u32,
    LengthInstanceData: u32,
};

pub const WNODE_ALL_DATA = extern struct {
    WnodeHeader: WNODE_HEADER,
    DataBlockOffset: u32,
    InstanceCount: u32,
    OffsetInstanceNameOffsets: u32,
    Anonymous: extern union {
        FixedInstanceSize: u32,
        OffsetInstanceDataAndLength: [1]OFFSETINSTANCEDATAANDLENGTH,
    },
};

pub const WNODE_SINGLE_INSTANCE = extern struct {
    WnodeHeader: WNODE_HEADER,
    OffsetInstanceName: u32,
    InstanceIndex: u32,
    DataBlockOffset: u32,
    SizeDataBlock: u32,
    VariableData: [1]u8,
};

pub const WNODE_SINGLE_ITEM = extern struct {
    WnodeHeader: WNODE_HEADER,
    OffsetInstanceName: u32,
    InstanceIndex: u32,
    ItemId: u32,
    DataBlockOffset: u32,
    SizeDataItem: u32,
    VariableData: [1]u8,
};

pub const WNODE_METHOD_ITEM = extern struct {
    WnodeHeader: WNODE_HEADER,
    OffsetInstanceName: u32,
    InstanceIndex: u32,
    MethodId: u32,
    DataBlockOffset: u32,
    SizeDataBlock: u32,
    VariableData: [1]u8,
};

pub const WNODE_EVENT_ITEM = extern struct {
    WnodeHeader: WNODE_HEADER,
};

pub const WNODE_EVENT_REFERENCE = extern struct {
    WnodeHeader: WNODE_HEADER,
    TargetGuid: Guid,
    TargetDataBlockSize: u32,
    Anonymous: extern union {
        TargetInstanceIndex: u32,
        TargetInstanceName: [1]u16,
    },
};

pub const WNODE_TOO_SMALL = extern struct {
    WnodeHeader: WNODE_HEADER,
    SizeNeeded: u32,
};

pub const WMIREGGUIDW = extern struct {
    Guid: Guid,
    Flags: u32,
    InstanceCount: u32,
    Anonymous: extern union {
        InstanceNameList: u32,
        BaseNameOffset: u32,
        Pdo: usize,
        InstanceInfo: usize,
    },
};

pub const WMIREGINFOW = extern struct {
    BufferSize: u32,
    NextWmiRegInfo: u32,
    RegistryPath: u32,
    MofResourceName: u32,
    GuidCount: u32,
    WmiRegGuid: [1]WMIREGGUIDW,
};

pub const WMIDPREQUESTCODE = enum(i32) {
    GET_ALL_DATA = 0,
    GET_SINGLE_INSTANCE = 1,
    SET_SINGLE_INSTANCE = 2,
    SET_SINGLE_ITEM = 3,
    ENABLE_EVENTS = 4,
    DISABLE_EVENTS = 5,
    ENABLE_COLLECTION = 6,
    DISABLE_COLLECTION = 7,
    REGINFO = 8,
    EXECUTE_METHOD = 9,
    CAPTURE_STATE = 10,
};
pub const WMI_GET_ALL_DATA = WMIDPREQUESTCODE.GET_ALL_DATA;
pub const WMI_GET_SINGLE_INSTANCE = WMIDPREQUESTCODE.GET_SINGLE_INSTANCE;
pub const WMI_SET_SINGLE_INSTANCE = WMIDPREQUESTCODE.SET_SINGLE_INSTANCE;
pub const WMI_SET_SINGLE_ITEM = WMIDPREQUESTCODE.SET_SINGLE_ITEM;
pub const WMI_ENABLE_EVENTS = WMIDPREQUESTCODE.ENABLE_EVENTS;
pub const WMI_DISABLE_EVENTS = WMIDPREQUESTCODE.DISABLE_EVENTS;
pub const WMI_ENABLE_COLLECTION = WMIDPREQUESTCODE.ENABLE_COLLECTION;
pub const WMI_DISABLE_COLLECTION = WMIDPREQUESTCODE.DISABLE_COLLECTION;
pub const WMI_REGINFO = WMIDPREQUESTCODE.REGINFO;
pub const WMI_EXECUTE_METHOD = WMIDPREQUESTCODE.EXECUTE_METHOD;
pub const WMI_CAPTURE_STATE = WMIDPREQUESTCODE.CAPTURE_STATE;

pub const ETW_COMPRESSION_RESUMPTION_MODE = enum(i32) {
    Restart = 0,
    NoDisable = 1,
    NoRestart = 2,
};
pub const EtwCompressionModeRestart = ETW_COMPRESSION_RESUMPTION_MODE.Restart;
pub const EtwCompressionModeNoDisable = ETW_COMPRESSION_RESUMPTION_MODE.NoDisable;
pub const EtwCompressionModeNoRestart = ETW_COMPRESSION_RESUMPTION_MODE.NoRestart;

pub const EVENT_TRACE_HEADER = extern struct {
    Size: u16,
    Anonymous1: extern union {
        FieldTypeFlags: u16,
        Anonymous: extern struct {
            HeaderType: u8,
            MarkerFlags: u8,
        },
    },
    Anonymous2: extern union {
        Version: u32,
        Class: extern struct {
            Type: u8,
            Level: u8,
            Version: u16,
        },
    },
    ThreadId: u32,
    ProcessId: u32,
    TimeStamp: LARGE_INTEGER,
    Anonymous3: extern union {
        Guid: Guid,
        GuidPtr: u64,
    },
    Anonymous4: extern union {
        Anonymous1: extern struct {
            KernelTime: u32,
            UserTime: u32,
        },
        ProcessorTime: u64,
        Anonymous2: extern struct {
            ClientContext: u32,
            Flags: u32,
        },
    },
};

pub const EVENT_INSTANCE_HEADER = extern struct {
    Size: u16,
    Anonymous1: extern union {
        FieldTypeFlags: u16,
        Anonymous: extern struct {
            HeaderType: u8,
            MarkerFlags: u8,
        },
    },
    Anonymous2: extern union {
        Version: u32,
        Class: extern struct {
            Type: u8,
            Level: u8,
            Version: u16,
        },
    },
    ThreadId: u32,
    ProcessId: u32,
    TimeStamp: LARGE_INTEGER,
    RegHandle: u64,
    InstanceId: u32,
    ParentInstanceId: u32,
    Anonymous3: extern union {
        Anonymous1: extern struct {
            KernelTime: u32,
            UserTime: u32,
        },
        ProcessorTime: u64,
        Anonymous2: extern struct {
            EventId: u32,
            Flags: u32,
        },
    },
    ParentRegHandle: u64,
};

pub const MOF_FIELD = extern struct {
    DataPtr: u64,
    Length: u32,
    DataType: u32,
};

pub const TRACE_LOGFILE_HEADER = extern struct {
    BufferSize: u32,
    Anonymous1: extern union {
        Version: u32,
        VersionDetail: extern struct {
            MajorVersion: u8,
            MinorVersion: u8,
            SubVersion: u8,
            SubMinorVersion: u8,
        },
    },
    ProviderVersion: u32,
    NumberOfProcessors: u32,
    EndTime: LARGE_INTEGER,
    TimerResolution: u32,
    MaximumFileSize: u32,
    LogFileMode: u32,
    BuffersWritten: u32,
    Anonymous2: extern union {
        LogInstanceGuid: Guid,
        Anonymous: extern struct {
            StartBuffers: u32,
            PointerSize: u32,
            EventsLost: u32,
            CpuSpeedInMHz: u32,
        },
    },
    LoggerName: ?PWSTR,
    LogFileName: ?PWSTR,
    TimeZone: TIME_ZONE_INFORMATION,
    BootTime: LARGE_INTEGER,
    PerfFreq: LARGE_INTEGER,
    StartTime: LARGE_INTEGER,
    ReservedFlags: u32,
    BuffersLost: u32,
};

pub const TRACE_LOGFILE_HEADER32 = extern struct {
    BufferSize: u32,
    Anonymous1: extern union {
        Version: u32,
        VersionDetail: extern struct {
            MajorVersion: u8,
            MinorVersion: u8,
            SubVersion: u8,
            SubMinorVersion: u8,
        },
    },
    ProviderVersion: u32,
    NumberOfProcessors: u32,
    EndTime: LARGE_INTEGER,
    TimerResolution: u32,
    MaximumFileSize: u32,
    LogFileMode: u32,
    BuffersWritten: u32,
    Anonymous2: extern union {
        LogInstanceGuid: Guid,
        Anonymous: extern struct {
            StartBuffers: u32,
            PointerSize: u32,
            EventsLost: u32,
            CpuSpeedInMHz: u32,
        },
    },
    LoggerName: u32,
    LogFileName: u32,
    TimeZone: TIME_ZONE_INFORMATION,
    BootTime: LARGE_INTEGER,
    PerfFreq: LARGE_INTEGER,
    StartTime: LARGE_INTEGER,
    ReservedFlags: u32,
    BuffersLost: u32,
};

pub const TRACE_LOGFILE_HEADER64 = extern struct {
    BufferSize: u32,
    Anonymous1: extern union {
        Version: u32,
        VersionDetail: extern struct {
            MajorVersion: u8,
            MinorVersion: u8,
            SubVersion: u8,
            SubMinorVersion: u8,
        },
    },
    ProviderVersion: u32,
    NumberOfProcessors: u32,
    EndTime: LARGE_INTEGER,
    TimerResolution: u32,
    MaximumFileSize: u32,
    LogFileMode: u32,
    BuffersWritten: u32,
    Anonymous2: extern union {
        LogInstanceGuid: Guid,
        Anonymous: extern struct {
            StartBuffers: u32,
            PointerSize: u32,
            EventsLost: u32,
            CpuSpeedInMHz: u32,
        },
    },
    LoggerName: u64,
    LogFileName: u64,
    TimeZone: TIME_ZONE_INFORMATION,
    BootTime: LARGE_INTEGER,
    PerfFreq: LARGE_INTEGER,
    StartTime: LARGE_INTEGER,
    ReservedFlags: u32,
    BuffersLost: u32,
};

pub const EVENT_INSTANCE_INFO = extern struct {
    RegHandle: ?HANDLE,
    InstanceId: u32,
};

pub const EVENT_TRACE_PROPERTIES = extern struct {
    Wnode: WNODE_HEADER,
    BufferSize: u32,
    MinimumBuffers: u32,
    MaximumBuffers: u32,
    MaximumFileSize: u32,
    LogFileMode: u32,
    FlushTimer: u32,
    EnableFlags: EVENT_TRACE_FLAG,
    Anonymous: extern union {
        AgeLimit: i32,
        FlushThreshold: i32,
    },
    NumberOfBuffers: u32,
    FreeBuffers: u32,
    EventsLost: u32,
    BuffersWritten: u32,
    LogBuffersLost: u32,
    RealTimeBuffersLost: u32,
    LoggerThreadId: ?HANDLE,
    LogFileNameOffset: u32,
    LoggerNameOffset: u32,
};

pub const EVENT_TRACE_PROPERTIES_V2 = extern struct {
    Wnode: WNODE_HEADER,
    BufferSize: u32,
    MinimumBuffers: u32,
    MaximumBuffers: u32,
    MaximumFileSize: u32,
    LogFileMode: u32,
    FlushTimer: u32,
    EnableFlags: EVENT_TRACE_FLAG,
    Anonymous1: extern union {
        AgeLimit: i32,
        FlushThreshold: i32,
    },
    NumberOfBuffers: u32,
    FreeBuffers: u32,
    EventsLost: u32,
    BuffersWritten: u32,
    LogBuffersLost: u32,
    RealTimeBuffersLost: u32,
    LoggerThreadId: ?HANDLE,
    LogFileNameOffset: u32,
    LoggerNameOffset: u32,
    Anonymous2: extern union {
        Anonymous: extern struct {
            _bitfield: u32,
        },
        V2Control: u32,
    },
    FilterDescCount: u32,
    FilterDesc: ?*EVENT_FILTER_DESCRIPTOR,
    Anonymous3: extern union {
        Anonymous: extern struct {
            _bitfield: u32,
        },
        V2Options: u64,
    },
};

pub const TRACE_GUID_REGISTRATION = extern struct {
    Guid: ?*const Guid,
    RegHandle: ?HANDLE,
};

pub const TRACE_GUID_PROPERTIES = extern struct {
    Guid: Guid,
    GuidType: u32,
    LoggerId: u32,
    EnableLevel: u32,
    EnableFlags: u32,
    IsEnable: BOOLEAN,
};

pub const ETW_BUFFER_CONTEXT = extern struct {
    Anonymous: extern union {
        Anonymous: extern struct {
            ProcessorNumber: u8,
            Alignment: u8,
        },
        ProcessorIndex: u16,
    },
    LoggerId: u16,
};

pub const TRACE_ENABLE_INFO = extern struct {
    IsEnabled: u32,
    Level: u8,
    Reserved1: u8,
    LoggerId: u16,
    EnableProperty: u32,
    Reserved2: u32,
    MatchAnyKeyword: u64,
    MatchAllKeyword: u64,
};

pub const TRACE_PROVIDER_INSTANCE_INFO = extern struct {
    NextOffset: u32,
    EnableCount: u32,
    Pid: u32,
    Flags: u32,
};

pub const TRACE_GUID_INFO = extern struct {
    InstanceCount: u32,
    Reserved: u32,
};

pub const PROFILE_SOURCE_INFO = extern struct {
    NextEntryOffset: u32,
    Source: u32,
    MinInterval: u32,
    MaxInterval: u32,
    Reserved: u64,
    Description: [1]u16,
};

pub const ETW_PMC_COUNTER_OWNER_TYPE = enum(i32) {
    Free = 0,
    Untagged = 1,
    Tagged = 2,
    TaggedWithSource = 3,
};
pub const EtwPmcOwnerFree = ETW_PMC_COUNTER_OWNER_TYPE.Free;
pub const EtwPmcOwnerUntagged = ETW_PMC_COUNTER_OWNER_TYPE.Untagged;
pub const EtwPmcOwnerTagged = ETW_PMC_COUNTER_OWNER_TYPE.Tagged;
pub const EtwPmcOwnerTaggedWithSource = ETW_PMC_COUNTER_OWNER_TYPE.TaggedWithSource;

pub const ETW_PMC_COUNTER_OWNER = extern struct {
    OwnerType: ETW_PMC_COUNTER_OWNER_TYPE,
    ProfileSource: u32,
    OwnerTag: u32,
};

pub const ETW_PMC_COUNTER_OWNERSHIP_STATUS = extern struct {
    ProcessorNumber: u32,
    NumberOfCounters: u32,
    CounterOwners: [1]ETW_PMC_COUNTER_OWNER,
};

pub const EVENT_TRACE = extern struct {
    Header: EVENT_TRACE_HEADER,
    InstanceId: u32,
    ParentInstanceId: u32,
    ParentGuid: Guid,
    MofData: ?*anyopaque,
    MofLength: u32,
    Anonymous: extern union {
        ClientContext: u32,
        BufferContext: ETW_BUFFER_CONTEXT,
    },
};

// TODO: this function pointer causes dependency loop problems, so it's stubbed out
pub const PEVENT_TRACE_BUFFER_CALLBACKW = switch (@import("builtin").zig_backend) {
    .stage1 => fn () callconv(@import("std").os.windows.WINAPI) void,
    else => *const fn () callconv(@import("std").os.windows.WINAPI) void,
};

// TODO: this function pointer causes dependency loop problems, so it's stubbed out
pub const PEVENT_TRACE_BUFFER_CALLBACKA = switch (@import("builtin").zig_backend) {
    .stage1 => fn () callconv(@import("std").os.windows.WINAPI) void,
    else => *const fn () callconv(@import("std").os.windows.WINAPI) void,
};

pub const PEVENT_CALLBACK = switch (@import("builtin").zig_backend) {
    .stage1 => fn (
        pEvent: ?*EVENT_TRACE,
    ) callconv(@import("std").os.windows.WINAPI) void,
    else => *const fn (
        pEvent: ?*EVENT_TRACE,
    ) callconv(@import("std").os.windows.WINAPI) void,
};

pub const PEVENT_RECORD_CALLBACK = switch (@import("builtin").zig_backend) {
    .stage1 => fn (
        EventRecord: ?*EVENT_RECORD,
    ) callconv(@import("std").os.windows.WINAPI) void,
    else => *const fn (
        EventRecord: ?*EVENT_RECORD,
    ) callconv(@import("std").os.windows.WINAPI) void,
};

pub const WMIDPREQUEST = switch (@import("builtin").zig_backend) {
    .stage1 => fn (
        RequestCode: WMIDPREQUESTCODE,
        RequestContext: ?*anyopaque,
        BufferSize: ?*u32,
        Buffer: ?*anyopaque,
    ) callconv(@import("std").os.windows.WINAPI) u32,
    else => *const fn (
        RequestCode: WMIDPREQUESTCODE,
        RequestContext: ?*anyopaque,
        BufferSize: ?*u32,
        Buffer: ?*anyopaque,
    ) callconv(@import("std").os.windows.WINAPI) u32,
};

pub const EVENT_TRACE_LOGFILEW = extern struct {
    LogFileName: ?PWSTR,
    LoggerName: ?PWSTR,
    CurrentTime: i64,
    BuffersRead: u32,
    Anonymous1: extern union {
        LogFileMode: u32,
        ProcessTraceMode: u32,
    },
    CurrentEvent: EVENT_TRACE,
    LogfileHeader: TRACE_LOGFILE_HEADER,
    BufferCallback: ?PEVENT_TRACE_BUFFER_CALLBACKW,
    BufferSize: u32,
    Filled: u32,
    EventsLost: u32,
    Anonymous2: extern union {
        EventCallback: ?PEVENT_CALLBACK,
        EventRecordCallback: ?PEVENT_RECORD_CALLBACK,
    },
    IsKernelTrace: u32,
    Context: ?*anyopaque,
};

pub const EVENT_TRACE_LOGFILEA = extern struct {
    LogFileName: ?PSTR,
    LoggerName: ?PSTR,
    CurrentTime: i64,
    BuffersRead: u32,
    Anonymous1: extern union {
        LogFileMode: u32,
        ProcessTraceMode: u32,
    },
    CurrentEvent: EVENT_TRACE,
    LogfileHeader: TRACE_LOGFILE_HEADER,
    BufferCallback: ?PEVENT_TRACE_BUFFER_CALLBACKA,
    BufferSize: u32,
    Filled: u32,
    EventsLost: u32,
    Anonymous2: extern union {
        EventCallback: ?PEVENT_CALLBACK,
        EventRecordCallback: ?PEVENT_RECORD_CALLBACK,
    },
    IsKernelTrace: u32,
    Context: ?*anyopaque,
};

pub const ENABLE_TRACE_PARAMETERS_V1 = extern struct {
    Version: u32,
    EnableProperty: u32,
    ControlFlags: u32,
    SourceId: Guid,
    EnableFilterDesc: ?*EVENT_FILTER_DESCRIPTOR,
};

pub const ENABLE_TRACE_PARAMETERS = extern struct {
    Version: u32,
    EnableProperty: u32,
    ControlFlags: u32,
    SourceId: Guid,
    EnableFilterDesc: ?*EVENT_FILTER_DESCRIPTOR,
    FilterDescCount: u32,
};

pub const TRACE_QUERY_INFO_CLASS = enum(i32) {
    TraceGuidQueryList = 0,
    TraceGuidQueryInfo = 1,
    TraceGuidQueryProcess = 2,
    TraceStackTracingInfo = 3,
    TraceSystemTraceEnableFlagsInfo = 4,
    TraceSampledProfileIntervalInfo = 5,
    TraceProfileSourceConfigInfo = 6,
    TraceProfileSourceListInfo = 7,
    TracePmcEventListInfo = 8,
    TracePmcCounterListInfo = 9,
    TraceSetDisallowList = 10,
    TraceVersionInfo = 11,
    TraceGroupQueryList = 12,
    TraceGroupQueryInfo = 13,
    TraceDisallowListQuery = 14,
    TraceInfoReserved15 = 15,
    TracePeriodicCaptureStateListInfo = 16,
    TracePeriodicCaptureStateInfo = 17,
    TraceProviderBinaryTracking = 18,
    TraceMaxLoggersQuery = 19,
    TraceLbrConfigurationInfo = 20,
    TraceLbrEventListInfo = 21,
    TraceMaxPmcCounterQuery = 22,
    TraceStreamCount = 23,
    TraceStackCachingInfo = 24,
    TracePmcCounterOwners = 25,
    TraceUnifiedStackCachingInfo = 26,
    MaxTraceSetInfoClass = 27,
};
pub const TraceGuidQueryList = TRACE_QUERY_INFO_CLASS.TraceGuidQueryList;
pub const TraceGuidQueryInfo = TRACE_QUERY_INFO_CLASS.TraceGuidQueryInfo;
pub const TraceGuidQueryProcess = TRACE_QUERY_INFO_CLASS.TraceGuidQueryProcess;
pub const TraceStackTracingInfo = TRACE_QUERY_INFO_CLASS.TraceStackTracingInfo;
pub const TraceSystemTraceEnableFlagsInfo = TRACE_QUERY_INFO_CLASS.TraceSystemTraceEnableFlagsInfo;
pub const TraceSampledProfileIntervalInfo = TRACE_QUERY_INFO_CLASS.TraceSampledProfileIntervalInfo;
pub const TraceProfileSourceConfigInfo = TRACE_QUERY_INFO_CLASS.TraceProfileSourceConfigInfo;
pub const TraceProfileSourceListInfo = TRACE_QUERY_INFO_CLASS.TraceProfileSourceListInfo;
pub const TracePmcEventListInfo = TRACE_QUERY_INFO_CLASS.TracePmcEventListInfo;
pub const TracePmcCounterListInfo = TRACE_QUERY_INFO_CLASS.TracePmcCounterListInfo;
pub const TraceSetDisallowList = TRACE_QUERY_INFO_CLASS.TraceSetDisallowList;
pub const TraceVersionInfo = TRACE_QUERY_INFO_CLASS.TraceVersionInfo;
pub const TraceGroupQueryList = TRACE_QUERY_INFO_CLASS.TraceGroupQueryList;
pub const TraceGroupQueryInfo = TRACE_QUERY_INFO_CLASS.TraceGroupQueryInfo;
pub const TraceDisallowListQuery = TRACE_QUERY_INFO_CLASS.TraceDisallowListQuery;
pub const TraceInfoReserved15 = TRACE_QUERY_INFO_CLASS.TraceInfoReserved15;
pub const TracePeriodicCaptureStateListInfo = TRACE_QUERY_INFO_CLASS.TracePeriodicCaptureStateListInfo;
pub const TracePeriodicCaptureStateInfo = TRACE_QUERY_INFO_CLASS.TracePeriodicCaptureStateInfo;
pub const TraceProviderBinaryTracking = TRACE_QUERY_INFO_CLASS.TraceProviderBinaryTracking;
pub const TraceMaxLoggersQuery = TRACE_QUERY_INFO_CLASS.TraceMaxLoggersQuery;
pub const TraceLbrConfigurationInfo = TRACE_QUERY_INFO_CLASS.TraceLbrConfigurationInfo;
pub const TraceLbrEventListInfo = TRACE_QUERY_INFO_CLASS.TraceLbrEventListInfo;
pub const TraceMaxPmcCounterQuery = TRACE_QUERY_INFO_CLASS.TraceMaxPmcCounterQuery;
pub const TraceStreamCount = TRACE_QUERY_INFO_CLASS.TraceStreamCount;
pub const TraceStackCachingInfo = TRACE_QUERY_INFO_CLASS.TraceStackCachingInfo;
pub const TracePmcCounterOwners = TRACE_QUERY_INFO_CLASS.TracePmcCounterOwners;
pub const TraceUnifiedStackCachingInfo = TRACE_QUERY_INFO_CLASS.TraceUnifiedStackCachingInfo;
pub const MaxTraceSetInfoClass = TRACE_QUERY_INFO_CLASS.MaxTraceSetInfoClass;

pub const CLASSIC_EVENT_ID = extern struct {
    EventGuid: Guid,
    Type: u8,
    Reserved: [7]u8,
};

pub const TRACE_STACK_CACHING_INFO = extern struct {
    Enabled: BOOLEAN,
    CacheSize: u32,
    BucketCount: u32,
};

pub const TRACE_PROFILE_INTERVAL = extern struct {
    Source: u32,
    Interval: u32,
};

pub const TRACE_VERSION_INFO = extern struct {
    EtwTraceProcessingVersion: u32,
    Reserved: u32,
};

pub const TRACE_PERIODIC_CAPTURE_STATE_INFO = extern struct {
    CaptureStateFrequencyInSeconds: u32,
    ProviderCount: u16,
    Reserved: u16,
};

pub const ETW_PROCESS_HANDLE_INFO_TYPE = enum(i32) {
    PartitionInformation = 1,
    PartitionInformationV2 = 2,
    LastDroppedTimes = 3,
    ProcessHandleInfoMax = 4,
};
pub const EtwQueryPartitionInformation = ETW_PROCESS_HANDLE_INFO_TYPE.PartitionInformation;
pub const EtwQueryPartitionInformationV2 = ETW_PROCESS_HANDLE_INFO_TYPE.PartitionInformationV2;
pub const EtwQueryLastDroppedTimes = ETW_PROCESS_HANDLE_INFO_TYPE.LastDroppedTimes;
pub const EtwQueryProcessHandleInfoMax = ETW_PROCESS_HANDLE_INFO_TYPE.ProcessHandleInfoMax;

pub const ETW_TRACE_PARTITION_INFORMATION = extern struct {
    PartitionId: Guid,
    ParentId: Guid,
    QpcOffsetFromRoot: i64,
    PartitionType: u32,
};

pub const ETW_TRACE_PARTITION_INFORMATION_V2 = extern struct {
    QpcOffsetFromRoot: i64,
    PartitionType: u32,
    PartitionId: ?PWSTR,
    ParentId: ?PWSTR,
};

pub const EVENT_DATA_DESCRIPTOR = extern struct {
    Ptr: u64,
    Size: u32,
    Anonymous: extern union {
        Reserved: u32,
        Anonymous: extern struct {
            Type: u8,
            Reserved1: u8,
            Reserved2: u16,
        },
    },
};

pub const EVENT_DESCRIPTOR = extern struct {
    Id: u16,
    Version: u8,
    Channel: u8,
    Level: u8,
    Opcode: u8,
    Task: u16,
    Keyword: u64,
};

pub const EVENT_FILTER_DESCRIPTOR = extern struct {
    Ptr: u64,
    Size: u32,
    Type: u32,
};

pub const EVENT_FILTER_HEADER = extern struct {
    Id: u16,
    Version: u8,
    Reserved: [5]u8,
    InstanceId: u64,
    Size: u32,
    NextOffset: u32,
};

pub const EVENT_FILTER_EVENT_ID = extern struct {
    FilterIn: BOOLEAN,
    Reserved: u8,
    Count: u16,
    Events: [1]u16,
};

pub const EVENT_FILTER_EVENT_NAME = extern struct {
    MatchAnyKeyword: u64,
    MatchAllKeyword: u64,
    Level: u8,
    FilterIn: BOOLEAN,
    NameCount: u16,
    Names: [1]u8,
};

pub const EVENT_FILTER_LEVEL_KW = extern struct {
    MatchAnyKeyword: u64,
    MatchAllKeyword: u64,
    Level: u8,
    FilterIn: BOOLEAN,
};

pub const EVENT_INFO_CLASS = enum(i32) {
    EventProviderBinaryTrackInfo = 0,
    EventProviderSetReserved1 = 1,
    EventProviderSetTraits = 2,
    EventProviderUseDescriptorType = 3,
    MaxEventInfo = 4,
};
pub const EventProviderBinaryTrackInfo = EVENT_INFO_CLASS.EventProviderBinaryTrackInfo;
pub const EventProviderSetReserved1 = EVENT_INFO_CLASS.EventProviderSetReserved1;
pub const EventProviderSetTraits = EVENT_INFO_CLASS.EventProviderSetTraits;
pub const EventProviderUseDescriptorType = EVENT_INFO_CLASS.EventProviderUseDescriptorType;
pub const MaxEventInfo = EVENT_INFO_CLASS.MaxEventInfo;

pub const PENABLECALLBACK = switch (@import("builtin").zig_backend) {
    .stage1 => fn (
        SourceId: ?*const Guid,
        IsEnabled: ENABLECALLBACK_ENABLED_STATE,
        Level: u8,
        MatchAnyKeyword: u64,
        MatchAllKeyword: u64,
        FilterData: ?*EVENT_FILTER_DESCRIPTOR,
        CallbackContext: ?*anyopaque,
    ) callconv(@import("std").os.windows.WINAPI) void,
    else => *const fn (
        SourceId: ?*const Guid,
        IsEnabled: ENABLECALLBACK_ENABLED_STATE,
        Level: u8,
        MatchAnyKeyword: u64,
        MatchAllKeyword: u64,
        FilterData: ?*EVENT_FILTER_DESCRIPTOR,
        CallbackContext: ?*anyopaque,
    ) callconv(@import("std").os.windows.WINAPI) void,
};

pub const EVENT_HEADER_EXTENDED_DATA_ITEM = extern struct {
    Reserved1: u16,
    ExtType: u16,
    Anonymous: extern struct {
        _bitfield: u16,
    },
    DataSize: u16,
    DataPtr: u64,
};

pub const EVENT_EXTENDED_ITEM_INSTANCE = extern struct {
    InstanceId: u32,
    ParentInstanceId: u32,
    ParentGuid: Guid,
};

pub const EVENT_EXTENDED_ITEM_RELATED_ACTIVITYID = extern struct {
    RelatedActivityId: Guid,
};

pub const EVENT_EXTENDED_ITEM_TS_ID = extern struct {
    SessionId: u32,
};

pub const EVENT_EXTENDED_ITEM_STACK_TRACE32 = extern struct {
    MatchId: u64,
    Address: [1]u32,
};

pub const EVENT_EXTENDED_ITEM_STACK_TRACE64 = extern struct {
    MatchId: u64,
    Address: [1]u64,
};

pub const EVENT_EXTENDED_ITEM_STACK_KEY32 = extern struct {
    MatchId: u64,
    StackKey: u32,
    Padding: u32,
};

pub const EVENT_EXTENDED_ITEM_STACK_KEY64 = extern struct {
    MatchId: u64,
    StackKey: u64,
};

pub const EVENT_EXTENDED_ITEM_PEBS_INDEX = extern struct {
    PebsIndex: u64,
};

pub const EVENT_EXTENDED_ITEM_PMC_COUNTERS = extern struct {
    Counter: [1]u64,
};

pub const EVENT_EXTENDED_ITEM_PROCESS_START_KEY = extern struct {
    ProcessStartKey: u64,
};

pub const EVENT_EXTENDED_ITEM_EVENT_KEY = extern struct {
    Key: u64,
};

pub const EVENT_HEADER = extern struct {
    Size: u16,
    HeaderType: u16,
    Flags: u16,
    EventProperty: u16,
    ThreadId: u32,
    ProcessId: u32,
    TimeStamp: LARGE_INTEGER,
    ProviderId: Guid,
    EventDescriptor: EVENT_DESCRIPTOR,
    Anonymous: extern union {
        Anonymous: extern struct {
            KernelTime: u32,
            UserTime: u32,
        },
        ProcessorTime: u64,
    },
    ActivityId: Guid,
};

pub const EVENT_RECORD = extern struct {
    EventHeader: EVENT_HEADER,
    BufferContext: ETW_BUFFER_CONTEXT,
    ExtendedDataCount: u16,
    UserDataLength: u16,
    ExtendedData: ?*EVENT_HEADER_EXTENDED_DATA_ITEM,
    UserData: ?*anyopaque,
    UserContext: ?*anyopaque,
};

pub const ETW_PROVIDER_TRAIT_TYPE = enum(i32) {
    TypeGroup = 1,
    DecodeGuid = 2,
    TypeMax = 3,
};
pub const EtwProviderTraitTypeGroup = ETW_PROVIDER_TRAIT_TYPE.TypeGroup;
pub const EtwProviderTraitDecodeGuid = ETW_PROVIDER_TRAIT_TYPE.DecodeGuid;
pub const EtwProviderTraitTypeMax = ETW_PROVIDER_TRAIT_TYPE.TypeMax;

pub const EVENTSECURITYOPERATION = enum(i32) {
    SetDACL = 0,
    SetSACL = 1,
    AddDACL = 2,
    AddSACL = 3,
    Max = 4,
};
pub const EventSecuritySetDACL = EVENTSECURITYOPERATION.SetDACL;
pub const EventSecuritySetSACL = EVENTSECURITYOPERATION.SetSACL;
pub const EventSecurityAddDACL = EVENTSECURITYOPERATION.AddDACL;
pub const EventSecurityAddSACL = EVENTSECURITYOPERATION.AddSACL;
pub const EventSecurityMax = EVENTSECURITYOPERATION.Max;

pub const EVENT_MAP_ENTRY = extern struct {
    OutputOffset: u32,
    Anonymous: extern union {
        Value: u32,
        InputOffset: u32,
    },
};

pub const MAP_FLAGS = enum(i32) {
    MANIFEST_VALUEMAP = 1,
    MANIFEST_BITMAP = 2,
    MANIFEST_PATTERNMAP = 4,
    WBEM_VALUEMAP = 8,
    WBEM_BITMAP = 16,
    WBEM_FLAG = 32,
    WBEM_NO_MAP = 64,
};
pub const EVENTMAP_INFO_FLAG_MANIFEST_VALUEMAP = MAP_FLAGS.MANIFEST_VALUEMAP;
pub const EVENTMAP_INFO_FLAG_MANIFEST_BITMAP = MAP_FLAGS.MANIFEST_BITMAP;
pub const EVENTMAP_INFO_FLAG_MANIFEST_PATTERNMAP = MAP_FLAGS.MANIFEST_PATTERNMAP;
pub const EVENTMAP_INFO_FLAG_WBEM_VALUEMAP = MAP_FLAGS.WBEM_VALUEMAP;
pub const EVENTMAP_INFO_FLAG_WBEM_BITMAP = MAP_FLAGS.WBEM_BITMAP;
pub const EVENTMAP_INFO_FLAG_WBEM_FLAG = MAP_FLAGS.WBEM_FLAG;
pub const EVENTMAP_INFO_FLAG_WBEM_NO_MAP = MAP_FLAGS.WBEM_NO_MAP;

pub const MAP_VALUETYPE = enum(i32) {
    ULONG = 0,
    STRING = 1,
};
pub const EVENTMAP_ENTRY_VALUETYPE_ULONG = MAP_VALUETYPE.ULONG;
pub const EVENTMAP_ENTRY_VALUETYPE_STRING = MAP_VALUETYPE.STRING;

pub const EVENT_MAP_INFO = extern struct {
    NameOffset: u32,
    Flag: MAP_FLAGS,
    EntryCount: u32,
    Anonymous: extern union {
        MapEntryValueType: MAP_VALUETYPE,
        FormatStringOffset: u32,
    },
    MapEntryArray: [1]EVENT_MAP_ENTRY,
};

pub const _TDH_IN_TYPE = enum(i32) {
    NULL = 0,
    UNICODESTRING = 1,
    ANSISTRING = 2,
    INT8 = 3,
    UINT8 = 4,
    INT16 = 5,
    UINT16 = 6,
    INT32 = 7,
    UINT32 = 8,
    INT64 = 9,
    UINT64 = 10,
    FLOAT = 11,
    DOUBLE = 12,
    BOOLEAN = 13,
    BINARY = 14,
    GUID = 15,
    POINTER = 16,
    FILETIME = 17,
    SYSTEMTIME = 18,
    SID = 19,
    HEXINT32 = 20,
    HEXINT64 = 21,
    MANIFEST_COUNTEDSTRING = 22,
    MANIFEST_COUNTEDANSISTRING = 23,
    RESERVED24 = 24,
    MANIFEST_COUNTEDBINARY = 25,
    COUNTEDSTRING = 300,
    COUNTEDANSISTRING = 301,
    REVERSEDCOUNTEDSTRING = 302,
    REVERSEDCOUNTEDANSISTRING = 303,
    NONNULLTERMINATEDSTRING = 304,
    NONNULLTERMINATEDANSISTRING = 305,
    UNICODECHAR = 306,
    ANSICHAR = 307,
    SIZET = 308,
    HEXDUMP = 309,
    WBEMSID = 310,
};
pub const TDH_INTYPE_NULL = _TDH_IN_TYPE.NULL;
pub const TDH_INTYPE_UNICODESTRING = _TDH_IN_TYPE.UNICODESTRING;
pub const TDH_INTYPE_ANSISTRING = _TDH_IN_TYPE.ANSISTRING;
pub const TDH_INTYPE_INT8 = _TDH_IN_TYPE.INT8;
pub const TDH_INTYPE_UINT8 = _TDH_IN_TYPE.UINT8;
pub const TDH_INTYPE_INT16 = _TDH_IN_TYPE.INT16;
pub const TDH_INTYPE_UINT16 = _TDH_IN_TYPE.UINT16;
pub const TDH_INTYPE_INT32 = _TDH_IN_TYPE.INT32;
pub const TDH_INTYPE_UINT32 = _TDH_IN_TYPE.UINT32;
pub const TDH_INTYPE_INT64 = _TDH_IN_TYPE.INT64;
pub const TDH_INTYPE_UINT64 = _TDH_IN_TYPE.UINT64;
pub const TDH_INTYPE_FLOAT = _TDH_IN_TYPE.FLOAT;
pub const TDH_INTYPE_DOUBLE = _TDH_IN_TYPE.DOUBLE;
pub const TDH_INTYPE_BOOLEAN = _TDH_IN_TYPE.BOOLEAN;
pub const TDH_INTYPE_BINARY = _TDH_IN_TYPE.BINARY;
pub const TDH_INTYPE_GUID = _TDH_IN_TYPE.GUID;
pub const TDH_INTYPE_POINTER = _TDH_IN_TYPE.POINTER;
pub const TDH_INTYPE_FILETIME = _TDH_IN_TYPE.FILETIME;
pub const TDH_INTYPE_SYSTEMTIME = _TDH_IN_TYPE.SYSTEMTIME;
pub const TDH_INTYPE_SID = _TDH_IN_TYPE.SID;
pub const TDH_INTYPE_HEXINT32 = _TDH_IN_TYPE.HEXINT32;
pub const TDH_INTYPE_HEXINT64 = _TDH_IN_TYPE.HEXINT64;
pub const TDH_INTYPE_MANIFEST_COUNTEDSTRING = _TDH_IN_TYPE.MANIFEST_COUNTEDSTRING;
pub const TDH_INTYPE_MANIFEST_COUNTEDANSISTRING = _TDH_IN_TYPE.MANIFEST_COUNTEDANSISTRING;
pub const TDH_INTYPE_RESERVED24 = _TDH_IN_TYPE.RESERVED24;
pub const TDH_INTYPE_MANIFEST_COUNTEDBINARY = _TDH_IN_TYPE.MANIFEST_COUNTEDBINARY;
pub const TDH_INTYPE_COUNTEDSTRING = _TDH_IN_TYPE.COUNTEDSTRING;
pub const TDH_INTYPE_COUNTEDANSISTRING = _TDH_IN_TYPE.COUNTEDANSISTRING;
pub const TDH_INTYPE_REVERSEDCOUNTEDSTRING = _TDH_IN_TYPE.REVERSEDCOUNTEDSTRING;
pub const TDH_INTYPE_REVERSEDCOUNTEDANSISTRING = _TDH_IN_TYPE.REVERSEDCOUNTEDANSISTRING;
pub const TDH_INTYPE_NONNULLTERMINATEDSTRING = _TDH_IN_TYPE.NONNULLTERMINATEDSTRING;
pub const TDH_INTYPE_NONNULLTERMINATEDANSISTRING = _TDH_IN_TYPE.NONNULLTERMINATEDANSISTRING;
pub const TDH_INTYPE_UNICODECHAR = _TDH_IN_TYPE.UNICODECHAR;
pub const TDH_INTYPE_ANSICHAR = _TDH_IN_TYPE.ANSICHAR;
pub const TDH_INTYPE_SIZET = _TDH_IN_TYPE.SIZET;
pub const TDH_INTYPE_HEXDUMP = _TDH_IN_TYPE.HEXDUMP;
pub const TDH_INTYPE_WBEMSID = _TDH_IN_TYPE.WBEMSID;

pub const _TDH_OUT_TYPE = enum(i32) {
    NULL = 0,
    STRING = 1,
    DATETIME = 2,
    BYTE = 3,
    UNSIGNEDBYTE = 4,
    SHORT = 5,
    UNSIGNEDSHORT = 6,
    INT = 7,
    UNSIGNEDINT = 8,
    LONG = 9,
    UNSIGNEDLONG = 10,
    FLOAT = 11,
    DOUBLE = 12,
    BOOLEAN = 13,
    GUID = 14,
    HEXBINARY = 15,
    HEXINT8 = 16,
    HEXINT16 = 17,
    HEXINT32 = 18,
    HEXINT64 = 19,
    PID = 20,
    TID = 21,
    PORT = 22,
    IPV4 = 23,
    IPV6 = 24,
    SOCKETADDRESS = 25,
    CIMDATETIME = 26,
    ETWTIME = 27,
    XML = 28,
    ERRORCODE = 29,
    WIN32ERROR = 30,
    NTSTATUS = 31,
    HRESULT = 32,
    CULTURE_INSENSITIVE_DATETIME = 33,
    JSON = 34,
    UTF8 = 35,
    PKCS7_WITH_TYPE_INFO = 36,
    CODE_POINTER = 37,
    DATETIME_UTC = 38,
    REDUCEDSTRING = 300,
    NOPRINT = 301,
};
pub const TDH_OUTTYPE_NULL = _TDH_OUT_TYPE.NULL;
pub const TDH_OUTTYPE_STRING = _TDH_OUT_TYPE.STRING;
pub const TDH_OUTTYPE_DATETIME = _TDH_OUT_TYPE.DATETIME;
pub const TDH_OUTTYPE_BYTE = _TDH_OUT_TYPE.BYTE;
pub const TDH_OUTTYPE_UNSIGNEDBYTE = _TDH_OUT_TYPE.UNSIGNEDBYTE;
pub const TDH_OUTTYPE_SHORT = _TDH_OUT_TYPE.SHORT;
pub const TDH_OUTTYPE_UNSIGNEDSHORT = _TDH_OUT_TYPE.UNSIGNEDSHORT;
pub const TDH_OUTTYPE_INT = _TDH_OUT_TYPE.INT;
pub const TDH_OUTTYPE_UNSIGNEDINT = _TDH_OUT_TYPE.UNSIGNEDINT;
pub const TDH_OUTTYPE_LONG = _TDH_OUT_TYPE.LONG;
pub const TDH_OUTTYPE_UNSIGNEDLONG = _TDH_OUT_TYPE.UNSIGNEDLONG;
pub const TDH_OUTTYPE_FLOAT = _TDH_OUT_TYPE.FLOAT;
pub const TDH_OUTTYPE_DOUBLE = _TDH_OUT_TYPE.DOUBLE;
pub const TDH_OUTTYPE_BOOLEAN = _TDH_OUT_TYPE.BOOLEAN;
pub const TDH_OUTTYPE_GUID = _TDH_OUT_TYPE.GUID;
pub const TDH_OUTTYPE_HEXBINARY = _TDH_OUT_TYPE.HEXBINARY;
pub const TDH_OUTTYPE_HEXINT8 = _TDH_OUT_TYPE.HEXINT8;
pub const TDH_OUTTYPE_HEXINT16 = _TDH_OUT_TYPE.HEXINT16;
pub const TDH_OUTTYPE_HEXINT32 = _TDH_OUT_TYPE.HEXINT32;
pub const TDH_OUTTYPE_HEXINT64 = _TDH_OUT_TYPE.HEXINT64;
pub const TDH_OUTTYPE_PID = _TDH_OUT_TYPE.PID;
pub const TDH_OUTTYPE_TID = _TDH_OUT_TYPE.TID;
pub const TDH_OUTTYPE_PORT = _TDH_OUT_TYPE.PORT;
pub const TDH_OUTTYPE_IPV4 = _TDH_OUT_TYPE.IPV4;
pub const TDH_OUTTYPE_IPV6 = _TDH_OUT_TYPE.IPV6;
pub const TDH_OUTTYPE_SOCKETADDRESS = _TDH_OUT_TYPE.SOCKETADDRESS;
pub const TDH_OUTTYPE_CIMDATETIME = _TDH_OUT_TYPE.CIMDATETIME;
pub const TDH_OUTTYPE_ETWTIME = _TDH_OUT_TYPE.ETWTIME;
pub const TDH_OUTTYPE_XML = _TDH_OUT_TYPE.XML;
pub const TDH_OUTTYPE_ERRORCODE = _TDH_OUT_TYPE.ERRORCODE;
pub const TDH_OUTTYPE_WIN32ERROR = _TDH_OUT_TYPE.WIN32ERROR;
pub const TDH_OUTTYPE_NTSTATUS = _TDH_OUT_TYPE.NTSTATUS;
pub const TDH_OUTTYPE_HRESULT = _TDH_OUT_TYPE.HRESULT;
pub const TDH_OUTTYPE_CULTURE_INSENSITIVE_DATETIME = _TDH_OUT_TYPE.CULTURE_INSENSITIVE_DATETIME;
pub const TDH_OUTTYPE_JSON = _TDH_OUT_TYPE.JSON;
pub const TDH_OUTTYPE_UTF8 = _TDH_OUT_TYPE.UTF8;
pub const TDH_OUTTYPE_PKCS7_WITH_TYPE_INFO = _TDH_OUT_TYPE.PKCS7_WITH_TYPE_INFO;
pub const TDH_OUTTYPE_CODE_POINTER = _TDH_OUT_TYPE.CODE_POINTER;
pub const TDH_OUTTYPE_DATETIME_UTC = _TDH_OUT_TYPE.DATETIME_UTC;
pub const TDH_OUTTYPE_REDUCEDSTRING = _TDH_OUT_TYPE.REDUCEDSTRING;
pub const TDH_OUTTYPE_NOPRINT = _TDH_OUT_TYPE.NOPRINT;

pub const PROPERTY_FLAGS = enum(i32) {
    Struct = 1,
    ParamLength = 2,
    ParamCount = 4,
    WBEMXmlFragment = 8,
    ParamFixedLength = 16,
    ParamFixedCount = 32,
    HasTags = 64,
    HasCustomSchema = 128,
};
pub const PropertyStruct = PROPERTY_FLAGS.Struct;
pub const PropertyParamLength = PROPERTY_FLAGS.ParamLength;
pub const PropertyParamCount = PROPERTY_FLAGS.ParamCount;
pub const PropertyWBEMXmlFragment = PROPERTY_FLAGS.WBEMXmlFragment;
pub const PropertyParamFixedLength = PROPERTY_FLAGS.ParamFixedLength;
pub const PropertyParamFixedCount = PROPERTY_FLAGS.ParamFixedCount;
pub const PropertyHasTags = PROPERTY_FLAGS.HasTags;
pub const PropertyHasCustomSchema = PROPERTY_FLAGS.HasCustomSchema;

pub const EVENT_PROPERTY_INFO = extern struct {
    Flags: PROPERTY_FLAGS,
    NameOffset: u32,
    Anonymous1: extern union {
        pub const _customSchemaType = extern struct {
            InType: u16,
            OutType: u16,
            CustomSchemaOffset: u32,
        };
        pub const _nonStructType = extern struct {
            InType: u16,
            OutType: u16,
            MapNameOffset: u32,
        };
        pub const _structType = extern struct {
            StructStartIndex: u16,
            NumOfStructMembers: u16,
            padding: u32,
        };
        nonStructType: _nonStructType,
        structType: _structType,
        customSchemaType: _customSchemaType,
    },
    Anonymous2: extern union {
        count: u16,
        countPropertyIndex: u16,
    },
    Anonymous3: extern union {
        length: u16,
        lengthPropertyIndex: u16,
    },
    Anonymous4: extern union {
        Reserved: u32,
        Anonymous: extern struct {
            _bitfield: u32,
        },
    },
};

pub const DECODING_SOURCE = enum(i32) {
    XMLFile = 0,
    Wbem = 1,
    WPP = 2,
    Tlg = 3,
    Max = 4,
};
pub const DecodingSourceXMLFile = DECODING_SOURCE.XMLFile;
pub const DecodingSourceWbem = DECODING_SOURCE.Wbem;
pub const DecodingSourceWPP = DECODING_SOURCE.WPP;
pub const DecodingSourceTlg = DECODING_SOURCE.Tlg;
pub const DecodingSourceMax = DECODING_SOURCE.Max;

pub const TEMPLATE_FLAGS = enum(i32) {
    EVENT_DATA = 1,
    USER_DATA = 2,
    CONTROL_GUID = 4,
};
pub const TEMPLATE_EVENT_DATA = TEMPLATE_FLAGS.EVENT_DATA;
pub const TEMPLATE_USER_DATA = TEMPLATE_FLAGS.USER_DATA;
pub const TEMPLATE_CONTROL_GUID = TEMPLATE_FLAGS.CONTROL_GUID;

pub const TRACE_EVENT_INFO = extern struct {
    ProviderGuid: Guid,
    EventGuid: Guid,
    EventDescriptor: EVENT_DESCRIPTOR,
    DecodingSource: DECODING_SOURCE,
    ProviderNameOffset: u32,
    LevelNameOffset: u32,
    ChannelNameOffset: u32,
    KeywordsNameOffset: u32,
    TaskNameOffset: u32,
    OpcodeNameOffset: u32,
    EventMessageOffset: u32,
    ProviderMessageOffset: u32,
    BinaryXMLOffset: u32,
    BinaryXMLSize: u32,
    Anonymous1: extern union {
        EventNameOffset: u32,
        ActivityIDNameOffset: u32,
    },
    Anonymous2: extern union {
        EventAttributesOffset: u32,
        RelatedActivityIDNameOffset: u32,
    },
    PropertyCount: u32,
    TopLevelPropertyCount: u32,
    Anonymous3: extern union {
        Flags: TEMPLATE_FLAGS,
        Anonymous: extern struct {
            _bitfield: u32,
        },
    },
    EventPropertyInfoArray: [1]EVENT_PROPERTY_INFO,
};

pub const PROPERTY_DATA_DESCRIPTOR = extern struct {
    PropertyName: u64,
    ArrayIndex: u32,
    Reserved: u32,
};

pub const PAYLOAD_OPERATOR = enum(i32) {
    EQ = 0,
    NE = 1,
    LE = 2,
    GT = 3,
    LT = 4,
    GE = 5,
    BETWEEN = 6,
    NOTBETWEEN = 7,
    MODULO = 8,
    CONTAINS = 20,
    DOESNTCONTAIN = 21,
    IS = 30,
    ISNOT = 31,
    INVALID = 32,
};
pub const PAYLOADFIELD_EQ = PAYLOAD_OPERATOR.EQ;
pub const PAYLOADFIELD_NE = PAYLOAD_OPERATOR.NE;
pub const PAYLOADFIELD_LE = PAYLOAD_OPERATOR.LE;
pub const PAYLOADFIELD_GT = PAYLOAD_OPERATOR.GT;
pub const PAYLOADFIELD_LT = PAYLOAD_OPERATOR.LT;
pub const PAYLOADFIELD_GE = PAYLOAD_OPERATOR.GE;
pub const PAYLOADFIELD_BETWEEN = PAYLOAD_OPERATOR.BETWEEN;
pub const PAYLOADFIELD_NOTBETWEEN = PAYLOAD_OPERATOR.NOTBETWEEN;
pub const PAYLOADFIELD_MODULO = PAYLOAD_OPERATOR.MODULO;
pub const PAYLOADFIELD_CONTAINS = PAYLOAD_OPERATOR.CONTAINS;
pub const PAYLOADFIELD_DOESNTCONTAIN = PAYLOAD_OPERATOR.DOESNTCONTAIN;
pub const PAYLOADFIELD_IS = PAYLOAD_OPERATOR.IS;
pub const PAYLOADFIELD_ISNOT = PAYLOAD_OPERATOR.ISNOT;
pub const PAYLOADFIELD_INVALID = PAYLOAD_OPERATOR.INVALID;

pub const PAYLOAD_FILTER_PREDICATE = extern struct {
    FieldName: ?PWSTR,
    CompareOp: u16,
    Value: ?PWSTR,
};

pub const PROVIDER_FILTER_INFO = extern struct {
    Id: u8,
    Version: u8,
    MessageOffset: u32,
    Reserved: u32,
    PropertyCount: u32,
    EventPropertyInfoArray: [1]EVENT_PROPERTY_INFO,
};

pub const EVENT_FIELD_TYPE = enum(i32) {
    KeywordInformation = 0,
    LevelInformation = 1,
    ChannelInformation = 2,
    TaskInformation = 3,
    OpcodeInformation = 4,
    InformationMax = 5,
};
pub const EventKeywordInformation = EVENT_FIELD_TYPE.KeywordInformation;
pub const EventLevelInformation = EVENT_FIELD_TYPE.LevelInformation;
pub const EventChannelInformation = EVENT_FIELD_TYPE.ChannelInformation;
pub const EventTaskInformation = EVENT_FIELD_TYPE.TaskInformation;
pub const EventOpcodeInformation = EVENT_FIELD_TYPE.OpcodeInformation;
pub const EventInformationMax = EVENT_FIELD_TYPE.InformationMax;

pub const PROVIDER_FIELD_INFO = extern struct {
    NameOffset: u32,
    DescriptionOffset: u32,
    Value: u64,
};

pub const PROVIDER_FIELD_INFOARRAY = extern struct {
    NumberOfElements: u32,
    FieldType: EVENT_FIELD_TYPE,
    FieldInfoArray: [1]PROVIDER_FIELD_INFO,
};

pub const TRACE_PROVIDER_INFO = extern struct {
    ProviderGuid: Guid,
    SchemaSource: u32,
    ProviderNameOffset: u32,
};

pub const PROVIDER_ENUMERATION_INFO = extern struct {
    NumberOfProviders: u32,
    Reserved: u32,
    TraceProviderInfoArray: [1]TRACE_PROVIDER_INFO,
};

pub const PROVIDER_EVENT_INFO = extern struct {
    NumberOfEvents: u32,
    Reserved: u32,
    EventDescriptorsArray: [1]EVENT_DESCRIPTOR,
};

pub const TDH_CONTEXT_TYPE = enum(i32) {
    WPP_TMFFILE = 0,
    WPP_TMFSEARCHPATH = 1,
    WPP_GMT = 2,
    POINTERSIZE = 3,
    PDB_PATH = 4,
    MAXIMUM = 5,
};
pub const TDH_CONTEXT_WPP_TMFFILE = TDH_CONTEXT_TYPE.WPP_TMFFILE;
pub const TDH_CONTEXT_WPP_TMFSEARCHPATH = TDH_CONTEXT_TYPE.WPP_TMFSEARCHPATH;
pub const TDH_CONTEXT_WPP_GMT = TDH_CONTEXT_TYPE.WPP_GMT;
pub const TDH_CONTEXT_POINTERSIZE = TDH_CONTEXT_TYPE.POINTERSIZE;
pub const TDH_CONTEXT_PDB_PATH = TDH_CONTEXT_TYPE.PDB_PATH;
pub const TDH_CONTEXT_MAXIMUM = TDH_CONTEXT_TYPE.MAXIMUM;

pub const TDH_CONTEXT = extern struct {
    ParameterValue: u64,
    ParameterType: TDH_CONTEXT_TYPE,
    ParameterSize: u32,
};

const CLSID_CTraceRelogger_Value = Guid.initString("7b40792d-05ff-44c4-9058-f440c71f17d4");
pub const CLSID_CTraceRelogger = &CLSID_CTraceRelogger_Value;

// TODO: this type is limited to platform 'windows6.1'
const IID_ITraceEvent_Value = Guid.initString("8cc97f40-9028-4ff3-9b62-7d1f79ca7bcb");
pub const IID_ITraceEvent = &IID_ITraceEvent_Value;
pub const ITraceEvent = extern struct {
    pub const VTable = extern struct {
        base: IUnknown.VTable,
        Clone: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                NewEvent: ?*?*ITraceEvent,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                NewEvent: ?*?*ITraceEvent,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        GetUserContext: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                UserContext: ?*?*anyopaque,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                UserContext: ?*?*anyopaque,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        GetEventRecord: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                EventRecord: ?*?*EVENT_RECORD,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                EventRecord: ?*?*EVENT_RECORD,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetPayload: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                Payload: [*:0]u8,
                PayloadSize: u32,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                Payload: [*:0]u8,
                PayloadSize: u32,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetEventDescriptor: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                EventDescriptor: ?*const EVENT_DESCRIPTOR,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                EventDescriptor: ?*const EVENT_DESCRIPTOR,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetProcessId: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                ProcessId: u32,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                ProcessId: u32,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetProcessorIndex: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                ProcessorIndex: u32,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                ProcessorIndex: u32,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetThreadId: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                ThreadId: u32,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                ThreadId: u32,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetThreadTimes: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                KernelTime: u32,
                UserTime: u32,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                KernelTime: u32,
                UserTime: u32,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetActivityId: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                ActivityId: ?*const Guid,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                ActivityId: ?*const Guid,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetTimeStamp: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                TimeStamp: ?*LARGE_INTEGER,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                TimeStamp: ?*LARGE_INTEGER,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetProviderId: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEvent,
                ProviderId: ?*const Guid,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEvent,
                ProviderId: ?*const Guid,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
    };
    vtable: *const VTable,
    pub fn MethodMixin(comptime T: type) type {
        return struct {
            pub usingnamespace IUnknown.MethodMixin(T);
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_Clone(self: *const T, NewEvent: ?*?*ITraceEvent) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).Clone(@as(*const ITraceEvent, @ptrCast(self)), NewEvent);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_GetUserContext(self: *const T, UserContext: ?*?*anyopaque) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).GetUserContext(@as(*const ITraceEvent, @ptrCast(self)), UserContext);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_GetEventRecord(self: *const T, EventRecord: ?*?*EVENT_RECORD) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).GetEventRecord(@as(*const ITraceEvent, @ptrCast(self)), EventRecord);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_SetPayload(self: *const T, Payload: [*:0]u8, PayloadSize: u32) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).SetPayload(@as(*const ITraceEvent, @ptrCast(self)), Payload, PayloadSize);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_SetEventDescriptor(self: *const T, EventDescriptor: ?*const EVENT_DESCRIPTOR) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).SetEventDescriptor(@as(*const ITraceEvent, @ptrCast(self)), EventDescriptor);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_SetProcessId(self: *const T, ProcessId: u32) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).SetProcessId(@as(*const ITraceEvent, @ptrCast(self)), ProcessId);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_SetProcessorIndex(self: *const T, ProcessorIndex: u32) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).SetProcessorIndex(@as(*const ITraceEvent, @ptrCast(self)), ProcessorIndex);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_SetThreadId(self: *const T, ThreadId: u32) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).SetThreadId(@as(*const ITraceEvent, @ptrCast(self)), ThreadId);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_SetThreadTimes(self: *const T, KernelTime: u32, UserTime: u32) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).SetThreadTimes(@as(*const ITraceEvent, @ptrCast(self)), KernelTime, UserTime);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_SetActivityId(self: *const T, ActivityId: ?*const Guid) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).SetActivityId(@as(*const ITraceEvent, @ptrCast(self)), ActivityId);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_SetTimeStamp(self: *const T, TimeStamp: ?*LARGE_INTEGER) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).SetTimeStamp(@as(*const ITraceEvent, @ptrCast(self)), TimeStamp);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEvent_SetProviderId(self: *const T, ProviderId: ?*const Guid) HRESULT {
                return @as(*const ITraceEvent.VTable, @ptrCast(self.vtable)).SetProviderId(@as(*const ITraceEvent, @ptrCast(self)), ProviderId);
            }
        };
    }
    pub usingnamespace MethodMixin(@This());
};

// TODO: this type is limited to platform 'windows6.1'
const IID_ITraceEventCallback_Value = Guid.initString("3ed25501-593f-43e9-8f38-3ab46f5a4a52");
pub const IID_ITraceEventCallback = &IID_ITraceEventCallback_Value;
pub const ITraceEventCallback = extern struct {
    pub const VTable = extern struct {
        base: IUnknown.VTable,
        OnBeginProcessTrace: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEventCallback,
                HeaderEvent: ?*ITraceEvent,
                Relogger: ?*ITraceRelogger,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEventCallback,
                HeaderEvent: ?*ITraceEvent,
                Relogger: ?*ITraceRelogger,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        OnFinalizeProcessTrace: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEventCallback,
                Relogger: ?*ITraceRelogger,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEventCallback,
                Relogger: ?*ITraceRelogger,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        OnEvent: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceEventCallback,
                Event: ?*ITraceEvent,
                Relogger: ?*ITraceRelogger,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceEventCallback,
                Event: ?*ITraceEvent,
                Relogger: ?*ITraceRelogger,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
    };
    vtable: *const VTable,
    pub fn MethodMixin(comptime T: type) type {
        return struct {
            pub usingnamespace IUnknown.MethodMixin(T);
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEventCallback_OnBeginProcessTrace(self: *const T, HeaderEvent: ?*ITraceEvent, Relogger: ?*ITraceRelogger) HRESULT {
                return @as(*const ITraceEventCallback.VTable, @ptrCast(self.vtable)).OnBeginProcessTrace(@as(*const ITraceEventCallback, @ptrCast(self)), HeaderEvent, Relogger);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEventCallback_OnFinalizeProcessTrace(self: *const T, Relogger: ?*ITraceRelogger) HRESULT {
                return @as(*const ITraceEventCallback.VTable, @ptrCast(self.vtable)).OnFinalizeProcessTrace(@as(*const ITraceEventCallback, @ptrCast(self)), Relogger);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceEventCallback_OnEvent(self: *const T, Event: ?*ITraceEvent, Relogger: ?*ITraceRelogger) HRESULT {
                return @as(*const ITraceEventCallback.VTable, @ptrCast(self.vtable)).OnEvent(@as(*const ITraceEventCallback, @ptrCast(self)), Event, Relogger);
            }
        };
    }
    pub usingnamespace MethodMixin(@This());
};

// TODO: this type is limited to platform 'windows6.1'
const IID_ITraceRelogger_Value = Guid.initString("f754ad43-3bcc-4286-8009-9c5da214e84e");
pub const IID_ITraceRelogger = &IID_ITraceRelogger_Value;
pub const ITraceRelogger = extern struct {
    pub const VTable = extern struct {
        base: IUnknown.VTable,
        AddLogfileTraceStream: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceRelogger,
                LogfileName: ?BSTR,
                UserContext: ?*anyopaque,
                TraceHandle: ?*u64,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceRelogger,
                LogfileName: ?BSTR,
                UserContext: ?*anyopaque,
                TraceHandle: ?*u64,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        AddRealtimeTraceStream: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceRelogger,
                LoggerName: ?BSTR,
                UserContext: ?*anyopaque,
                TraceHandle: ?*u64,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceRelogger,
                LoggerName: ?BSTR,
                UserContext: ?*anyopaque,
                TraceHandle: ?*u64,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        RegisterCallback: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceRelogger,
                Callback: ?*ITraceEventCallback,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceRelogger,
                Callback: ?*ITraceEventCallback,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        Inject: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceRelogger,
                Event: ?*ITraceEvent,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceRelogger,
                Event: ?*ITraceEvent,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        CreateEventInstance: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceRelogger,
                TraceHandle: u64,
                Flags: u32,
                Event: ?*?*ITraceEvent,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceRelogger,
                TraceHandle: u64,
                Flags: u32,
                Event: ?*?*ITraceEvent,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        ProcessTrace: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceRelogger,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceRelogger,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetOutputFilename: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceRelogger,
                LogfileName: ?BSTR,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceRelogger,
                LogfileName: ?BSTR,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        SetCompressionMode: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceRelogger,
                CompressionMode: BOOLEAN,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceRelogger,
                CompressionMode: BOOLEAN,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
        Cancel: switch (@import("builtin").zig_backend) {
            .stage1 => fn (
                self: *const ITraceRelogger,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
            else => *const fn (
                self: *const ITraceRelogger,
            ) callconv(@import("std").os.windows.WINAPI) HRESULT,
        },
    };
    vtable: *const VTable,
    pub fn MethodMixin(comptime T: type) type {
        return struct {
            pub usingnamespace IUnknown.MethodMixin(T);
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceRelogger_AddLogfileTraceStream(self: *const T, LogfileName: ?BSTR, UserContext: ?*anyopaque, TraceHandle: ?*u64) HRESULT {
                return @as(*const ITraceRelogger.VTable, @ptrCast(self.vtable)).AddLogfileTraceStream(@as(*const ITraceRelogger, @ptrCast(self)), LogfileName, UserContext, TraceHandle);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceRelogger_AddRealtimeTraceStream(self: *const T, LoggerName: ?BSTR, UserContext: ?*anyopaque, TraceHandle: ?*u64) HRESULT {
                return @as(*const ITraceRelogger.VTable, @ptrCast(self.vtable)).AddRealtimeTraceStream(@as(*const ITraceRelogger, @ptrCast(self)), LoggerName, UserContext, TraceHandle);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceRelogger_RegisterCallback(self: *const T, Callback: ?*ITraceEventCallback) HRESULT {
                return @as(*const ITraceRelogger.VTable, @ptrCast(self.vtable)).RegisterCallback(@as(*const ITraceRelogger, @ptrCast(self)), Callback);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceRelogger_Inject(self: *const T, Event: ?*ITraceEvent) HRESULT {
                return @as(*const ITraceRelogger.VTable, @ptrCast(self.vtable)).Inject(@as(*const ITraceRelogger, @ptrCast(self)), Event);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceRelogger_CreateEventInstance(self: *const T, TraceHandle: u64, Flags: u32, Event: ?*?*ITraceEvent) HRESULT {
                return @as(*const ITraceRelogger.VTable, @ptrCast(self.vtable)).CreateEventInstance(@as(*const ITraceRelogger, @ptrCast(self)), TraceHandle, Flags, Event);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceRelogger_ProcessTrace(self: *const T) HRESULT {
                return @as(*const ITraceRelogger.VTable, @ptrCast(self.vtable)).ProcessTrace(@as(*const ITraceRelogger, @ptrCast(self)));
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceRelogger_SetOutputFilename(self: *const T, LogfileName: ?BSTR) HRESULT {
                return @as(*const ITraceRelogger.VTable, @ptrCast(self.vtable)).SetOutputFilename(@as(*const ITraceRelogger, @ptrCast(self)), LogfileName);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceRelogger_SetCompressionMode(self: *const T, CompressionMode: BOOLEAN) HRESULT {
                return @as(*const ITraceRelogger.VTable, @ptrCast(self.vtable)).SetCompressionMode(@as(*const ITraceRelogger, @ptrCast(self)), CompressionMode);
            }
            // NOTE: method is namespaced with interface name to avoid conflicts for now
            pub inline fn ITraceRelogger_Cancel(self: *const T) HRESULT {
                return @as(*const ITraceRelogger.VTable, @ptrCast(self.vtable)).Cancel(@as(*const ITraceRelogger, @ptrCast(self)));
            }
        };
    }
    pub usingnamespace MethodMixin(@This());
};

//--------------------------------------------------------------------------------
// Section: Functions (80)
//--------------------------------------------------------------------------------
// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn StartTraceW(
    TraceHandle: ?*u64,
    InstanceName: ?[*:0]const u16,
    Properties: ?*EVENT_TRACE_PROPERTIES,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn StartTraceA(
    TraceHandle: ?*u64,
    InstanceName: ?[*:0]const u8,
    Properties: ?*EVENT_TRACE_PROPERTIES,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn StopTraceW(
    TraceHandle: u64,
    InstanceName: ?[*:0]const u16,
    Properties: ?*EVENT_TRACE_PROPERTIES,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn StopTraceA(
    TraceHandle: u64,
    InstanceName: ?[*:0]const u8,
    Properties: ?*EVENT_TRACE_PROPERTIES,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn QueryTraceW(
    TraceHandle: u64,
    InstanceName: ?[*:0]const u16,
    Properties: ?*EVENT_TRACE_PROPERTIES,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn QueryTraceA(
    TraceHandle: u64,
    InstanceName: ?[*:0]const u8,
    Properties: ?*EVENT_TRACE_PROPERTIES,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn UpdateTraceW(
    TraceHandle: u64,
    InstanceName: ?[*:0]const u16,
    Properties: ?*EVENT_TRACE_PROPERTIES,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn UpdateTraceA(
    TraceHandle: u64,
    InstanceName: ?[*:0]const u8,
    Properties: ?*EVENT_TRACE_PROPERTIES,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "advapi32" fn FlushTraceW(
    TraceHandle: u64,
    InstanceName: ?[*:0]const u16,
    Properties: ?*EVENT_TRACE_PROPERTIES,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "advapi32" fn FlushTraceA(
    TraceHandle: u64,
    InstanceName: ?[*:0]const u8,
    Properties: ?*EVENT_TRACE_PROPERTIES,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn ControlTraceW(
    TraceHandle: u64,
    InstanceName: ?[*:0]const u16,
    Properties: ?*EVENT_TRACE_PROPERTIES,
    ControlCode: EVENT_TRACE_CONTROL,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn ControlTraceA(
    TraceHandle: u64,
    InstanceName: ?[*:0]const u8,
    Properties: ?*EVENT_TRACE_PROPERTIES,
    ControlCode: EVENT_TRACE_CONTROL,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn QueryAllTracesW(
    PropertyArray: [*]?*EVENT_TRACE_PROPERTIES,
    PropertyArrayCount: u32,
    LoggerCount: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn QueryAllTracesA(
    PropertyArray: [*]?*EVENT_TRACE_PROPERTIES,
    PropertyArrayCount: u32,
    LoggerCount: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn EnableTrace(
    Enable: u32,
    EnableFlag: u32,
    EnableLevel: u32,
    ControlGuid: ?*const Guid,
    TraceHandle: u64,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EnableTraceEx(
    ProviderId: ?*const Guid,
    SourceId: ?*const Guid,
    TraceHandle: u64,
    IsEnabled: u32,
    Level: u8,
    MatchAnyKeyword: u64,
    MatchAllKeyword: u64,
    EnableProperty: u32,
    EnableFilterDesc: ?*EVENT_FILTER_DESCRIPTOR,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.1'
pub extern "advapi32" fn EnableTraceEx2(
    TraceHandle: u64,
    ProviderId: ?*const Guid,
    ControlCode: u32,
    Level: u8,
    MatchAnyKeyword: u64,
    MatchAllKeyword: u64,
    Timeout: u32,
    EnableParameters: ?*ENABLE_TRACE_PARAMETERS,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EnumerateTraceGuidsEx(
    TraceQueryInfoClass: TRACE_QUERY_INFO_CLASS,
    // TODO: what to do with BytesParamIndex 2?
    InBuffer: ?*anyopaque,
    InBufferSize: u32,
    // TODO: what to do with BytesParamIndex 4?
    OutBuffer: ?*anyopaque,
    OutBufferSize: u32,
    ReturnLength: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.1'
pub extern "advapi32" fn TraceSetInformation(
    SessionHandle: u64,
    InformationClass: TRACE_QUERY_INFO_CLASS,
    // TODO: what to do with BytesParamIndex 3?
    TraceInformation: ?*anyopaque,
    InformationLength: u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.0'
pub extern "advapi32" fn TraceQueryInformation(
    SessionHandle: u64,
    InformationClass: TRACE_QUERY_INFO_CLASS,
    // TODO: what to do with BytesParamIndex 3?
    TraceInformation: ?*anyopaque,
    InformationLength: u32,
    ReturnLength: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn CreateTraceInstanceId(
    RegHandle: ?HANDLE,
    InstInfo: ?*EVENT_INSTANCE_INFO,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn TraceEvent(
    TraceHandle: u64,
    EventTrace: ?*EVENT_TRACE_HEADER,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn TraceEventInstance(
    TraceHandle: u64,
    EventTrace: ?*EVENT_INSTANCE_HEADER,
    InstInfo: ?*EVENT_INSTANCE_INFO,
    ParentInstInfo: ?*EVENT_INSTANCE_INFO,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn RegisterTraceGuidsW(
    RequestAddress: ?WMIDPREQUEST,
    RequestContext: ?*anyopaque,
    ControlGuid: ?*const Guid,
    GuidCount: u32,
    TraceGuidReg: ?[*]TRACE_GUID_REGISTRATION,
    MofImagePath: ?[*:0]const u16,
    MofResourceName: ?[*:0]const u16,
    RegistrationHandle: ?*u64,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn RegisterTraceGuidsA(
    RequestAddress: ?WMIDPREQUEST,
    RequestContext: ?*anyopaque,
    ControlGuid: ?*const Guid,
    GuidCount: u32,
    TraceGuidReg: ?[*]TRACE_GUID_REGISTRATION,
    MofImagePath: ?[*:0]const u8,
    MofResourceName: ?[*:0]const u8,
    RegistrationHandle: ?*u64,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "advapi32" fn EnumerateTraceGuids(
    GuidPropertiesArray: [*]?*TRACE_GUID_PROPERTIES,
    PropertyArrayCount: u32,
    GuidCount: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn UnregisterTraceGuids(
    RegistrationHandle: u64,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn GetTraceLoggerHandle(
    Buffer: ?*anyopaque,
) callconv(@import("std").os.windows.WINAPI) u64;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn GetTraceEnableLevel(
    TraceHandle: u64,
) callconv(@import("std").os.windows.WINAPI) u8;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn GetTraceEnableFlags(
    TraceHandle: u64,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn OpenTraceW(
    Logfile: ?*EVENT_TRACE_LOGFILEW,
) callconv(@import("std").os.windows.WINAPI) u64;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn ProcessTrace(
    HandleArray: [*]u64,
    HandleCount: u32,
    StartTime: ?*FILETIME,
    EndTime: ?*FILETIME,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn CloseTrace(
    TraceHandle: u64,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows10.0.16299'
pub extern "advapi32" fn QueryTraceProcessingHandle(
    ProcessingHandle: u64,
    InformationClass: ETW_PROCESS_HANDLE_INFO_TYPE,
    InBuffer: ?*anyopaque,
    InBufferSize: u32,
    OutBuffer: ?*anyopaque,
    OutBufferSize: u32,
    ReturnLength: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn OpenTraceA(
    Logfile: ?*EVENT_TRACE_LOGFILEA,
) callconv(@import("std").os.windows.WINAPI) u64;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn SetTraceCallback(
    pGuid: ?*const Guid,
    EventCallback: ?PEVENT_CALLBACK,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.0'
pub extern "advapi32" fn RemoveTraceCallback(
    pGuid: ?*const Guid,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "advapi32" fn TraceMessage(
    LoggerHandle: u64,
    MessageFlags: TRACE_MESSAGE_FLAGS,
    MessageGuid: ?*const Guid,
    MessageNumber: u16,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows5.1.2600'
pub extern "advapi32" fn TraceMessageVa(
    LoggerHandle: u64,
    MessageFlags: TRACE_MESSAGE_FLAGS,
    MessageGuid: ?*const Guid,
    MessageNumber: u16,
    MessageArgList: ?*i8,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EventRegister(
    ProviderId: ?*const Guid,
    EnableCallback: ?PENABLECALLBACK,
    CallbackContext: ?*anyopaque,
    RegHandle: ?*u64,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EventUnregister(
    RegHandle: u64,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.0'
pub extern "advapi32" fn EventSetInformation(
    RegHandle: u64,
    InformationClass: EVENT_INFO_CLASS,
    // TODO: what to do with BytesParamIndex 3?
    EventInformation: ?*anyopaque,
    InformationLength: u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EventEnabled(
    RegHandle: u64,
    EventDescriptor: ?*const EVENT_DESCRIPTOR,
) callconv(@import("std").os.windows.WINAPI) BOOLEAN;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EventProviderEnabled(
    RegHandle: u64,
    Level: u8,
    Keyword: u64,
) callconv(@import("std").os.windows.WINAPI) BOOLEAN;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EventWrite(
    RegHandle: u64,
    EventDescriptor: ?*const EVENT_DESCRIPTOR,
    UserDataCount: u32,
    UserData: ?[*]EVENT_DATA_DESCRIPTOR,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EventWriteTransfer(
    RegHandle: u64,
    EventDescriptor: ?*const EVENT_DESCRIPTOR,
    ActivityId: ?*const Guid,
    RelatedActivityId: ?*const Guid,
    UserDataCount: u32,
    UserData: ?[*]EVENT_DATA_DESCRIPTOR,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.1'
pub extern "advapi32" fn EventWriteEx(
    RegHandle: u64,
    EventDescriptor: ?*const EVENT_DESCRIPTOR,
    Filter: u64,
    Flags: u32,
    ActivityId: ?*const Guid,
    RelatedActivityId: ?*const Guid,
    UserDataCount: u32,
    UserData: ?[*]EVENT_DATA_DESCRIPTOR,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EventWriteString(
    RegHandle: u64,
    Level: u8,
    Keyword: u64,
    String: ?[*:0]const u16,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EventActivityIdControl(
    ControlCode: u32,
    ActivityId: ?*Guid,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EventAccessControl(
    Guid: ?*Guid,
    Operation: u32,
    Sid: ?PSID,
    Rights: u32,
    AllowOrDeny: BOOLEAN,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "advapi32" fn EventAccessQuery(
    Guid: ?*Guid,
    // TODO: what to do with BytesParamIndex 2?
    Buffer: ?*SECURITY_DESCRIPTOR,
    BufferSize: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

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

// TODO: this type is limited to platform 'windows8.1'
pub extern "tdh" fn TdhCreatePayloadFilter(
    ProviderGuid: ?*const Guid,
    EventDescriptor: ?*const EVENT_DESCRIPTOR,
    EventMatchANY: BOOLEAN,
    PayloadPredicateCount: u32,
    PayloadPredicates: [*]PAYLOAD_FILTER_PREDICATE,
    PayloadFilter: ?*?*anyopaque,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.1'
pub extern "tdh" fn TdhDeletePayloadFilter(
    PayloadFilter: ?*?*anyopaque,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.1'
pub extern "tdh" fn TdhAggregatePayloadFilters(
    PayloadFilterCount: u32,
    PayloadFilterPtrs: [*]?*anyopaque,
    EventMatchALLFlags: ?[*]BOOLEAN,
    EventFilterDescriptor: ?*EVENT_FILTER_DESCRIPTOR,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.1'
pub extern "tdh" fn TdhCleanupPayloadEventFilterDescriptor(
    EventFilterDescriptor: ?*EVENT_FILTER_DESCRIPTOR,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tdh" fn TdhGetEventInformation(
    Event: ?*EVENT_RECORD,
    TdhContextCount: u32,
    TdhContext: ?[*]TDH_CONTEXT,
    // TODO: what to do with BytesParamIndex 4?
    Buffer: ?*TRACE_EVENT_INFO,
    BufferSize: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tdh" fn TdhGetEventMapInformation(
    pEvent: ?*EVENT_RECORD,
    pMapName: ?PWSTR,
    // TODO: what to do with BytesParamIndex 3?
    pBuffer: ?*EVENT_MAP_INFO,
    pBufferSize: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tdh" fn TdhGetPropertySize(
    pEvent: ?*EVENT_RECORD,
    TdhContextCount: u32,
    pTdhContext: ?[*]TDH_CONTEXT,
    PropertyDataCount: u32,
    pPropertyData: [*]PROPERTY_DATA_DESCRIPTOR,
    pPropertySize: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tdh" fn TdhGetProperty(
    pEvent: ?*EVENT_RECORD,
    TdhContextCount: u32,
    pTdhContext: ?[*]TDH_CONTEXT,
    PropertyDataCount: u32,
    pPropertyData: [*]PROPERTY_DATA_DESCRIPTOR,
    BufferSize: u32,
    // TODO: what to do with BytesParamIndex 5?
    pBuffer: ?*u8,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tdh" fn TdhEnumerateProviders(
    // TODO: what to do with BytesParamIndex 1?
    pBuffer: ?*PROVIDER_ENUMERATION_INFO,
    pBufferSize: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

pub extern "tdh" fn TdhEnumerateProvidersForDecodingSource(
    filter: DECODING_SOURCE,
    // TODO: what to do with BytesParamIndex 2?
    buffer: ?*PROVIDER_ENUMERATION_INFO,
    bufferSize: u32,
    bufferRequired: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tdh" fn TdhQueryProviderFieldInformation(
    pGuid: ?*Guid,
    EventFieldValue: u64,
    EventFieldType: EVENT_FIELD_TYPE,
    // TODO: what to do with BytesParamIndex 4?
    pBuffer: ?*PROVIDER_FIELD_INFOARRAY,
    pBufferSize: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.0.6000'
pub extern "tdh" fn TdhEnumerateProviderFieldInformation(
    pGuid: ?*Guid,
    EventFieldType: EVENT_FIELD_TYPE,
    // TODO: what to do with BytesParamIndex 3?
    pBuffer: ?*PROVIDER_FIELD_INFOARRAY,
    pBufferSize: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.1'
pub extern "tdh" fn TdhEnumerateProviderFilters(
    Guid: ?*Guid,
    TdhContextCount: u32,
    TdhContext: ?[*]TDH_CONTEXT,
    FilterCount: ?*u32,
    // TODO: what to do with BytesParamIndex 5?
    Buffer: ?*?*PROVIDER_FILTER_INFO,
    BufferSize: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.1'
pub extern "tdh" fn TdhLoadManifest(
    Manifest: ?PWSTR,
) callconv(@import("std").os.windows.WINAPI) u32;

pub extern "tdh" fn TdhLoadManifestFromMemory(
    // TODO: what to do with BytesParamIndex 1?
    pData: ?*const anyopaque,
    cbData: u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.1'
pub extern "tdh" fn TdhUnloadManifest(
    Manifest: ?PWSTR,
) callconv(@import("std").os.windows.WINAPI) u32;

pub extern "tdh" fn TdhUnloadManifestFromMemory(
    // TODO: what to do with BytesParamIndex 1?
    pData: ?*const anyopaque,
    cbData: u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows6.1'
pub extern "tdh" fn TdhFormatProperty(
    EventInfo: ?*TRACE_EVENT_INFO,
    MapInfo: ?*EVENT_MAP_INFO,
    PointerSize: u32,
    PropertyInType: u16,
    PropertyOutType: u16,
    PropertyLength: u16,
    UserDataLength: u16,
    // TODO: what to do with BytesParamIndex 6?
    UserData: ?*u8,
    BufferSize: ?*u32,
    // TODO: what to do with BytesParamIndex 8?
    Buffer: ?[*]u16,
    UserDataConsumed: ?*u16,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.0'
pub extern "tdh" fn TdhOpenDecodingHandle(
    Handle: ?*TDH_HANDLE,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.0'
pub extern "tdh" fn TdhSetDecodingParameter(
    Handle: TDH_HANDLE,
    TdhContext: ?*TDH_CONTEXT,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.0'
pub extern "tdh" fn TdhGetDecodingParameter(
    Handle: TDH_HANDLE,
    TdhContext: ?*TDH_CONTEXT,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.0'
pub extern "tdh" fn TdhGetWppProperty(
    Handle: TDH_HANDLE,
    EventRecord: ?*EVENT_RECORD,
    PropertyName: ?PWSTR,
    BufferSize: ?*u32,
    // TODO: what to do with BytesParamIndex 3?
    Buffer: ?*u8,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.0'
pub extern "tdh" fn TdhGetWppMessage(
    Handle: TDH_HANDLE,
    EventRecord: ?*EVENT_RECORD,
    BufferSize: ?*u32,
    // TODO: what to do with BytesParamIndex 2?
    Buffer: ?*u8,
) callconv(@import("std").os.windows.WINAPI) u32;

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

// TODO: this type is limited to platform 'windows8.0'
pub extern "tdh" fn TdhLoadManifestFromBinary(
    BinaryPath: ?PWSTR,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.1'
pub extern "tdh" fn TdhEnumerateManifestProviderEvents(
    ProviderGuid: ?*Guid,
    // TODO: what to do with BytesParamIndex 2?
    Buffer: ?*PROVIDER_EVENT_INFO,
    BufferSize: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows8.1'
pub extern "tdh" fn TdhGetManifestEventInformation(
    ProviderGuid: ?*Guid,
    EventDescriptor: ?*EVENT_DESCRIPTOR,
    // TODO: what to do with BytesParamIndex 3?
    Buffer: ?*TRACE_EVENT_INFO,
    BufferSize: ?*u32,
) callconv(@import("std").os.windows.WINAPI) u32;

// TODO: this type is limited to platform 'windows10.0.10240'
pub extern "advapi32" fn CveEventWrite(
    CveId: ?[*:0]const u16,
    AdditionalDetails: ?[*:0]const u16,
) callconv(@import("std").os.windows.WINAPI) i32;

//--------------------------------------------------------------------------------
// Section: Unicode Aliases (11)
//--------------------------------------------------------------------------------
const thismodule = @This();
pub usingnamespace switch (@import("../../zig.zig").unicode_mode) {
    .ansi => struct {
        pub const PEVENT_TRACE_BUFFER_CALLBACK = thismodule.PEVENT_TRACE_BUFFER_CALLBACKA;
        pub const EVENT_TRACE_LOGFILE = thismodule.EVENT_TRACE_LOGFILEA;
        pub const StartTrace = thismodule.StartTraceA;
        pub const StopTrace = thismodule.StopTraceA;
        pub const QueryTrace = thismodule.QueryTraceA;
        pub const UpdateTrace = thismodule.UpdateTraceA;
        pub const FlushTrace = thismodule.FlushTraceA;
        pub const ControlTrace = thismodule.ControlTraceA;
        pub const QueryAllTraces = thismodule.QueryAllTracesA;
        pub const RegisterTraceGuids = thismodule.RegisterTraceGuidsA;
        pub const OpenTrace = thismodule.OpenTraceA;
    },
    .wide => struct {
        pub const PEVENT_TRACE_BUFFER_CALLBACK = thismodule.PEVENT_TRACE_BUFFER_CALLBACKW;
        pub const EVENT_TRACE_LOGFILE = thismodule.EVENT_TRACE_LOGFILEW;
        pub const StartTrace = thismodule.StartTraceW;
        pub const StopTrace = thismodule.StopTraceW;
        pub const QueryTrace = thismodule.QueryTraceW;
        pub const UpdateTrace = thismodule.UpdateTraceW;
        pub const FlushTrace = thismodule.FlushTraceW;
        pub const ControlTrace = thismodule.ControlTraceW;
        pub const QueryAllTraces = thismodule.QueryAllTracesW;
        pub const RegisterTraceGuids = thismodule.RegisterTraceGuidsW;
        pub const OpenTrace = thismodule.OpenTraceW;
    },
    .unspecified => if (@import("builtin").is_test) struct {
        pub const PEVENT_TRACE_BUFFER_CALLBACK = *opaque {};
        pub const EVENT_TRACE_LOGFILE = *opaque {};
        pub const StartTrace = *opaque {};
        pub const StopTrace = *opaque {};
        pub const QueryTrace = *opaque {};
        pub const UpdateTrace = *opaque {};
        pub const FlushTrace = *opaque {};
        pub const ControlTrace = *opaque {};
        pub const QueryAllTraces = *opaque {};
        pub const RegisterTraceGuids = *opaque {};
        pub const OpenTrace = *opaque {};
    } else struct {
        pub const PEVENT_TRACE_BUFFER_CALLBACK = @compileError("'PEVENT_TRACE_BUFFER_CALLBACK' requires that UNICODE be set to true or false in the root module");
        pub const EVENT_TRACE_LOGFILE = @compileError("'EVENT_TRACE_LOGFILE' requires that UNICODE be set to true or false in the root module");
        pub const StartTrace = @compileError("'StartTrace' requires that UNICODE be set to true or false in the root module");
        pub const StopTrace = @compileError("'StopTrace' requires that UNICODE be set to true or false in the root module");
        pub const QueryTrace = @compileError("'QueryTrace' requires that UNICODE be set to true or false in the root module");
        pub const UpdateTrace = @compileError("'UpdateTrace' requires that UNICODE be set to true or false in the root module");
        pub const FlushTrace = @compileError("'FlushTrace' requires that UNICODE be set to true or false in the root module");
        pub const ControlTrace = @compileError("'ControlTrace' requires that UNICODE be set to true or false in the root module");
        pub const QueryAllTraces = @compileError("'QueryAllTraces' requires that UNICODE be set to true or false in the root module");
        pub const RegisterTraceGuids = @compileError("'RegisterTraceGuids' requires that UNICODE be set to true or false in the root module");
        pub const OpenTrace = @compileError("'OpenTrace' requires that UNICODE be set to true or false in the root module");
    },
};
//--------------------------------------------------------------------------------
// Section: Imports (13)
//--------------------------------------------------------------------------------
const Guid = @import("../../zig.zig").Guid;
const BOOLEAN = @import("../../foundation.zig").BOOLEAN;
const BSTR = @import("../../foundation.zig").BSTR;
const FILETIME = @import("../../foundation.zig").FILETIME;
const HANDLE = @import("../../foundation.zig").HANDLE;
const HRESULT = @import("../../foundation.zig").HRESULT;
const IUnknown = @import("../../system/com.zig").IUnknown;
const LARGE_INTEGER = @import("../../foundation.zig").LARGE_INTEGER;
const PSID = @import("../../foundation.zig").PSID;
const PSTR = @import("../../foundation.zig").PSTR;
const PWSTR = @import("../../foundation.zig").PWSTR;
const SECURITY_DESCRIPTOR = @import("../../security.zig").SECURITY_DESCRIPTOR;
const TIME_ZONE_INFORMATION = @import("../../system/time.zig").TIME_ZONE_INFORMATION;

test {
    // The following '_ = <FuncPtrType>' lines are a workaround for https://github.com/ziglang/zig/issues/4476
    if (@hasDecl(@This(), "PEVENT_CALLBACK")) {
        _ = PEVENT_CALLBACK;
    }
    if (@hasDecl(@This(), "PEVENT_RECORD_CALLBACK")) {
        _ = PEVENT_RECORD_CALLBACK;
    }
    if (@hasDecl(@This(), "WMIDPREQUEST")) {
        _ = WMIDPREQUEST;
    }
    if (@hasDecl(@This(), "PENABLECALLBACK")) {
        _ = PENABLECALLBACK;
    }

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