' ########################################################################################
' Microsoft Windows
' File: cfg.inc
' Contents: Common Configuration Manager definitions for both user mode and kernel mode code.
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_cfg_PBI)
#DEFINE PBX_cfg_PBI
%EQUATE `CFG_INC = 1
#INCLUDE ONCE "Core/Windows.inc"
'//
'// The following definitions are also used by kernel mode code to
'// set up the registry.
'//
'//
'// VetoType used in
'// CM_Disable_DevNode
'// CM_Uninstall_DevNode
'// CM_Query_And_Remove_SubTree
'//
' enum PNP_VETO_TYPE
%EQUATE `PNP_VetoTypeUnknown = 0 ' // Name is unspecified
%EQUATE `PNP_VetoLegacyDevice = 1 ' // Name is an Instance Path
%EQUATE `PNP_VetoPendingClose = 2 ' // Name is an Instance Path
%EQUATE `PNP_VetoWindowsApp = 3 ' // Name is a Module
%EQUATE `PNP_VetoWindowsService = 4 ' // Name is a Service
%EQUATE `PNP_VetoOutstandingOpen = 5 ' // Name is an Instance Path
%EQUATE `PNP_VetoDevice = 6 ' // Name is an Instance Path
%EQUATE `PNP_VetoDriver = 7 ' // Name is a Driver Service Name
%EQUATE `PNP_VetoIllegalDeviceRequest = 8 ' // Name is an Instance Path
%EQUATE `PNP_VetoInsufficientPower = 9 ' // Name is unspecified
%EQUATE `PNP_VetoNonDisableable = 10 ' // Name is an Instance Path
%EQUATE `PNP_VetoLegacyDriver = 11 ' // Name is a Service
%EQUATE `PNP_VetoInsufficientRights = 12 ' // Name is unspecified
'//
'// DevInst problem values, returned by call to CM_Get_DevInst_Status
'//
%EQUATE `CM_PROB_NOT_CONFIGURED = &H00000001 ' // no config for device
%EQUATE `CM_PROB_DEVLOADER_FAILED = &H00000002 ' // service load failed
%EQUATE `CM_PROB_OUT_OF_MEMORY = &H00000003 ' // out of memory
%EQUATE `CM_PROB_ENTRY_IS_WRONG_TYPE = &H00000004 ' //
%EQUATE `CM_PROB_LACKED_ARBITRATOR = &H00000005 ' //
%EQUATE `CM_PROB_BOOT_CONFIG_CONFLICT = &H00000006 ' // boot config conflict
%EQUATE `CM_PROB_FAILED_FILTER = &H00000007 ' //
%EQUATE `CM_PROB_DEVLOADER_NOT_FOUND = &H00000008 ' // Devloader not found
%EQUATE `CM_PROB_INVALID_DATA = &H00000009 ' // Invalid ID
%EQUATE `CM_PROB_FAILED_START = &H0000000A ' //
%EQUATE `CM_PROB_LIAR = &H0000000B ' //
%EQUATE `CM_PROB_NORMAL_CONFLICT = &H0000000C ' // config conflict
%EQUATE `CM_PROB_NOT_VERIFIED = &H0000000D ' //
%EQUATE `CM_PROB_NEED_RESTART = &H0000000E ' // requires restart
%EQUATE `CM_PROB_REENUMERATION = &H0000000F ' //
%EQUATE `CM_PROB_PARTIAL_LOG_CONF = &H00000010 ' //
%EQUATE `CM_PROB_UNKNOWN_RESOURCE = &H00000011 ' // unknown res type
%EQUATE `CM_PROB_REINSTALL = &H00000012 ' //
%EQUATE `CM_PROB_REGISTRY = &H00000013 ' //
%EQUATE `CM_PROB_VXDLDR = &H00000014 ' // WINDOWS 95 ONLY
%EQUATE `CM_PROB_WILL_BE_REMOVED = &H00000015 ' // devinst will remove
%EQUATE `CM_PROB_DISABLED = &H00000016 ' // devinst is disabled
%EQUATE `CM_PROB_DEVLOADER_NOT_READY = &H00000017 ' // Devloader not ready
%EQUATE `CM_PROB_DEVICE_NOT_THERE = &H00000018 ' // device doesn't exist
%EQUATE `CM_PROB_MOVED = &H00000019 ' //
%EQUATE `CM_PROB_TOO_EARLY = &H0000001A ' //
%EQUATE `CM_PROB_NO_VALID_LOG_CONF = &H0000001B ' // no valid log config
%EQUATE `CM_PROB_FAILED_INSTALL = &H0000001C ' // install failed
%EQUATE `CM_PROB_HARDWARE_DISABLED = &H0000001D ' // device disabled
%EQUATE `CM_PROB_CANT_SHARE_IRQ = &H0000001E ' // can't share IRQ
%EQUATE `CM_PROB_FAILED_ADD = &H0000001F ' // driver failed add
%EQUATE `CM_PROB_DISABLED_SERVICE = &H00000020 ' // service's Start = 4
%EQUATE `CM_PROB_TRANSLATION_FAILED = &H00000021 ' // resource translation failed
%EQUATE `CM_PROB_NO_SOFTCONFIG = &H00000022 ' // no soft config
%EQUATE `CM_PROB_BIOS_TABLE = &H00000023 ' // device missing in BIOS table
%EQUATE `CM_PROB_IRQ_TRANSLATION_FAILED = &H00000024 ' // IRQ translator failed
%EQUATE `CM_PROB_FAILED_DRIVER_ENTRY = &H00000025 ' // DriverEntry(??? failed.
%EQUATE `CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD = &H00000026 ' // Driver should have unloaded.
%EQUATE `CM_PROB_DRIVER_FAILED_LOAD = &H00000027 ' // Driver load unsuccessful.
%EQUATE `CM_PROB_DRIVER_SERVICE_KEY_INVALID = &H00000028 ' // Error accessing driver's service key
%EQUATE `CM_PROB_LEGACY_SERVICE_NO_DEVICES = &H00000029 ' // Loaded legacy service created no devices
%EQUATE `CM_PROB_DUPLICATE_DEVICE = &H0000002A ' // Two devices were discovered with the same name
%EQUATE `CM_PROB_FAILED_POST_START = &H0000002B ' // The drivers set the device state to failed
%EQUATE `CM_PROB_HALTED = &H0000002C ' // This device was failed post start via usermode
%EQUATE `CM_PROB_PHANTOM = &H0000002D ' // The devinst currently exists only in the registry
%EQUATE `CM_PROB_SYSTEM_SHUTDOWN = &H0000002E ' // The system is shutting down
%EQUATE `CM_PROB_HELD_FOR_EJECT = &H0000002F ' // The device is offline awaiting removal
%EQUATE `CM_PROB_DRIVER_BLOCKED = &H00000030 ' // One or more drivers is blocked from loading
%EQUATE `CM_PROB_REGISTRY_TOO_LARGE = &H00000031 ' // System hive has grown too large
%EQUATE `CM_PROB_SETPROPERTIES_FAILED = &H00000032 ' // Failed to apply one or more registry properties
%EQUATE `CM_PROB_WAITING_ON_DEPENDENCY = &H00000033 ' // Device is stalled waiting on a dependency to start
%EQUATE `CM_PROB_UNSIGNED_DRIVER = &H00000034 ' // Failed load driver due to unsigned image.
%EQUATE `NUM_CM_PROB_V1 = &H00000025
%EQUATE `NUM_CM_PROB_V2 = &H00000032
%EQUATE `NUM_CM_PROB_V3 = &H00000033
%EQUATE `NUM_CM_PROB_V4 = &H00000034
%EQUATE `NUM_CM_PROB_V5 = &H00000035
'#if (NTDDI_VERSION >= NTDDI_WIN7)
#IF %WINVER >= &H0601
%EQUATE `NUM_CM_PROB = %NUM_CM_PROB_V5
'#elif (NTDDI_VERSION >= NTDDI_WS08)
#ELSEIF %WINVER >= &H0600
%EQUATE `NUM_CM_PROB = %NUM_CM_PROB_V4
'#elif (NTDDI_VERSION >= NTDDI_WS03)
#ELSEIF %WINVER >= &H0502
%EQUATE `NUM_CM_PROB = %NUM_CM_PROB_V3
'#elif (NTDDI_VERSION >= NTDDI_WINXP)
#ELSEIF %WINVER >= &H0501
%EQUATE `NUM_CM_PROB = %NUM_CM_PROB_V2
'#elif (NTDDI_VERSION >= WIN2K)
#ELSEIF %WINVER >= &H0500
%EQUATE `NUM_CM_PROB = %NUM_CM_PROB_V1
#ENDIF
'//
'// Device Instance status flags, returned by call to CM_Get_DevInst_Status
'//
%EQUATE `DN_ROOT_ENUMERATED = &H00000001 ' // Was enumerated by ROOT
%EQUATE `DN_DRIVER_LOADED = &H00000002 ' // Has Register_Device_Driver
%EQUATE `DN_ENUM_LOADED = &H00000004 ' // Has Register_Enumerator
%EQUATE `DN_STARTED = &H00000008 ' // Is currently configured
%EQUATE `DN_MANUAL = &H00000010 ' // Manually installed
%EQUATE `DN_NEED_TO_ENUM = &H00000020 ' // May need reenumeration
%EQUATE `DN_NOT_FIRST_TIME = &H00000040 ' // Has received a config
%EQUATE `DN_HARDWARE_ENUM = &H00000080 ' // Enum generates hardware ID
%EQUATE `DN_LIAR = &H00000100 ' // Lied about can reconfig once
%EQUATE `DN_HAS_MARK = &H00000200 ' // Not CM_Create_DevInst lately
%EQUATE `DN_HAS_PROBLEM = &H00000400 ' // Need device installer
%EQUATE `DN_FILTERED = &H00000800 ' // Is filtered
%EQUATE `DN_MOVED = &H00001000 ' // Has been moved
%EQUATE `DN_DISABLEABLE = &H00002000 ' // Can be disabled
%EQUATE `DN_REMOVABLE = &H00004000 ' // Can be removed
%EQUATE `DN_PRIVATE_PROBLEM = &H00008000 ' // Has a private problem
%EQUATE `DN_MF_PARENT = &H00010000 ' // Multi function parent
%EQUATE `DN_MF_CHILD = &H00020000 ' // Multi function child
%EQUATE `DN_WILL_BE_REMOVED = &H00040000 ' // DevInst is being removed
'//
'// Windows 4 OPK2 Flags
'//
%EQUATE `DN_NOT_FIRST_TIMEE = &H00080000 ' // S: Has received a config enumerate
%EQUATE `DN_STOP_FREE_RES = &H00100000 ' // S: When child is stopped, free resources
%EQUATE `DN_REBAL_CANDIDATE = &H00200000 ' // S: Don't skip during rebalance
%EQUATE `DN_BAD_PARTIAL = &H00400000 ' // S: This devnode's log_confs do not have same resources
%EQUATE `DN_NT_ENUMERATOR = &H00800000 ' // S: This devnode's is an NT enumerator
%EQUATE `DN_NT_DRIVER = &H01000000 ' // S: This devnode's is an NT driver
'//
'// Windows 4.1 Flags
'//
%EQUATE `DN_NEEDS_LOCKING = &H02000000 ' // S: Devnode need lock resume processing
%EQUATE `DN_ARM_WAKEUP = &H04000000 ' // S: Devnode can be the wakeup device
%EQUATE `DN_APM_ENUMERATOR = &H08000000 ' // S: APM aware enumerator
%EQUATE `DN_APM_DRIVER = &H10000000 ' // S: APM aware driver
%EQUATE `DN_SILENT_INSTALL = &H20000000 ' // S: Silent install
%EQUATE `DN_NO_SHOW_IN_DM = &H40000000 ' // S: No show in device manager
%EQUATE `DN_BOOT_LOG_PROB = &H80000000 ' // S: Had a problem during preassignment of boot log conf
'//
'// Windows NT Flags
'//
'// These are overloaded on top of unused Win 9X flags
'//
'//%DN_LIAR = &H00000100) // Lied about can reconfig once
'#if (NTDDI_VERSION >= NTDDI_WINXP)
%EQUATE `DN_NEED_RESTART = %DN_LIAR ' // System needs to be restarted for this Devnode to work properly
'// %DN_NOT_FIRST_TIME = &H00000040) // Has Register_Enumerator
%EQUATE `DN_DRIVER_BLOCKED = %DN_NOT_FIRST_TIME ' // One or more drivers are blocked from loading for this Devnode
'//%DN_MOVED = &H00001000) // Has been moved
%EQUATE `DN_LEGACY_DRIVER = %DN_MOVED ' // This device is using a legacy driver
'//%DN_HAS_MARK = &H00000200) // Not CM_Create_DevInst lately
%EQUATE `DN_CHILD_WITH_INVALID_ID = %DN_HAS_MARK ' // One or more children have invalid ID(s)
'#elif (NTDDI_VERSION >= NTDDI_WIN2K)
%EQUATE `DN_NEED_RESTART = &H00000100 ' // System needs to be restarted for this Devnode to work properly
'#endif
%EQUATE `DN_CHANGEABLE_FLAGS = %DN_NOT_FIRST_TIME + %DN_HARDWARE_ENUM + %DN_HAS_MARK + %DN_DISABLEABLE + %DN_REMOVABLE + %DN_MF_CHILD + %DN_MF_PARENT + %DN_NOT_FIRST_TIMEE + %DN_STOP_FREE_RES + %DN_REBAL_CANDIDATE + %DN_NT_ENUMERATOR + %DN_NT_DRIVER + %DN_SILENT_INSTALL + %DN_NO_SHOW_IN_DM
'//
'// Logical configuration Priority values
'//
'// These priority values are used in user-mode calls to CM_Add_Empty_Log_Conf.
'// Drivers may also specify priority values for a given IO_RESOURCE_LIST
'// structure by including a ConfigData member union as the first
'// IO_RESOURCE_DESCRIPTOR in the IO_RESOURCE_LIST. In this case, the descriptor
'// type would be CmResourceTypeConfigData.
'//
%EQUATE `LCPRI_FORCECONFIG = &H00000000 ' // Coming from a forced config
%EQUATE `LCPRI_BOOTCONFIG = &H00000001 ' // Coming from a boot config
%EQUATE `LCPRI_DESIRED = &H00002000 ' // Preferable (better performance???
%EQUATE `LCPRI_NORMAL = &H00003000 ' // Workable (acceptable performance???
%EQUATE `LCPRI_LASTBESTCONFIG = &H00003FFF ' // CM only--do not use
%EQUATE `LCPRI_SUBOPTIMAL = &H00005000 ' // Not desired, but will work
%EQUATE `LCPRI_LASTSOFTCONFIG = &H00007FFF ' // CM only--do not use
%EQUATE `LCPRI_RESTART = &H00008000 ' // Need to restart
%EQUATE `LCPRI_REBOOT = &H00009000 ' // Need to reboot
%EQUATE `LCPRI_POWEROFF = &H0000A000 ' // Need to shutdown/power-off
%EQUATE `LCPRI_HARDRECONFIG = &H0000C000 ' // Need to change a jumper
%EQUATE `LCPRI_HARDWIRED = &H0000E000 ' // Cannot be changed
%EQUATE `LCPRI_IMPOSSIBLE = &H0000F000 ' // Impossible configuration
%EQUATE `LCPRI_DISABLED = &H0000FFFF ' // Disabled configuration
%EQUATE `MAX_LCPRI = &H0000FFFF ' // Maximum known LC Priority
#ENDIF
