' ########################################################################################
' Microsoft Windows
' File: naptypes.inc
' Copyright (c) 2012 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_naptypes_PBI)
#DEFINE PBX_naptypes_PBI
%EQUATE `NAPTYPES_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/OAIdl.inc"
#INCLUDE ONCE "Legacy/COM/OCIdl.inc"
#IF NOT %DEF(%INapTypes_INTERFACE_DEFINED)
%EQUATE `INapTypes_INTERFACE_DEFINED = 1
%EQUATE `maxSoHAttributeCount = 100
%EQUATE `maxSoHAttributeSize = 4000
%EQUATE `minNetworkSoHSize = 12
%EQUATE `maxNetworkSoHSize = 4000
%EQUATE `maxDwordCountPerSoHAttribute = (%maxSoHAttributeSize / 4)
%EQUATE `maxIpv4CountPerSoHAttribute = (%maxSoHAttributeSize / 4 )
%EQUATE `maxIpv6CountPerSoHAttribute = (%maxSoHAttributeSize / 16 )
%EQUATE `maxStringLength = 1024
%EQUATE `maxStringLengthInBytes = ((%maxStringLength + 1) * 2)
%EQUATE `maxSystemHealthEntityCount = 20
%EQUATE `maxEnforcerCount = 20
%EQUATE `maxPrivateDataSize = 200
%EQUATE `maxConnectionCountPerEnforcer = 20
%EQUATE `maxCachedSoHCount = ((%maxSystemHealthEntityCount * %maxEnforcerCount) * %maxConnectionCountPerEnforcer)
%EQUATE `freshSoHRequest = &H1
%EQUATE `shaFixup = &H1
'enum tagIsolationState
%EQUATE `isolationStateNotRestricted = 1
%EQUATE `isolationStateInProbation = 2
%EQUATE `isolationStateRestrictedAccess = 3
'enum tagExtendedIsolationState
%EQUATE `extendedIsolationStateNoData = 0
%EQUATE `extendedIsolationStateTransition = &H1
%EQUATE `extendedIsolationStateInfected = &H2
%EQUATE `extendedIsolationStateUnknown = &H3
'enum tagNapTracingLevel
%EQUATE `tracingLevelUndefined = 0
%EQUATE `tracingLevelBasic = 1
%EQUATE `tracingLevelAdvanced = 2
%EQUATE `tracingLevelDebug = 3
MACRO ProbationTime = FILETIME
' // Size = 8 bytes
TYPE CountedString DWORD
 length AS WORD ' UINT16
 cstring AS WSTRINGZ PTR ' WCHAR*
END TYPE
' // Size = 20 bytes
TYPE IsolationInfo DWORD
 isolationState AS LONG ' IsolationState enum
 probEndTime AS ProbationTime ' ProbationTime
 failureUrl AS CountedString ' CountedString
END TYPE
' // Size = 24 bytes
TYPE IsolationInfoEx DWORD
 isolationState AS LONG ' IsolationState enum
 extendedIsolationState AS LONG ' ExtendedIsolationState enum
 probEndTime AS ProbationTime ' ProbationTime
 failureUrl AS CountedString ' CountedString
END TYPE
%EQUATE `failureCategoryCount = 5
'enum tagFailureCategory
%EQUATE `failureCategoryNone = 0
%EQUATE `failureCategoryOther = 1
%EQUATE `failureCategoryClientComponent = 2
%EQUATE `failureCategoryClientCommunication = 3
%EQUATE `failureCategoryServerComponent = 4
%EQUATE `failureCategoryServerCommunication = 5
' // Size = 20 bytes
TYPE FailureCategoryMapping DWORD
 mappingCompliance(4) AS LONG ' BOOL mappingCompliance[ 5 ]
END TYPE
'typedef UINT32 NapComponentId;
'typedef NapComponentId SystemHealthEntityId;
'typedef NapComponentId EnforcementEntityId;
%EQUATE `ComponentTypeEnforcementClientSoH = &H1
%EQUATE `ComponentTypeEnforcementClientRp = &H2
'typedef /* [range] */ __RPC__range(0,maxSystemHealthEntityCount) UINT16 SystemHealthEntityCount;
'typedef /* [range] */ __RPC__range(0,maxEnforcerCount) UINT16 EnforcementEntityCount;
' // Size = 24 bytes
TYPE CorrelationId DWORD
 connId AS GUID ' GUID
 timeStamp AS FILETIME ' FILETIME
END TYPE
'typedef CountedString StringCorrelationId;
MACRO StringCorrelationId = CountedString
'typedef GUID ConnectionId;
%EQUATE `percentageNotSupported = 101
'typedef /* [range] */ __RPC__range(0,percentageNotSupported) UINT8 Percentage;
'typedef UINT32 MessageId;
' // Size = 8 bytes
TYPE ResultCodes DWORD
 count AS WORD ' UINT16
 results AS LONG PTR ' HRESULT*
END TYPE
' // Size = 4 bytes
TYPE Ipv4Address BYTE
 addr(3) AS BYTE ' BYTE addr[ 4 ]
END TYPE
' // Size = 16 bytes
TYPE Ipv6Address BYTE
 addr(15) AS BYTE ' BYTE addr[ 16 ]
END TYPE
'enum tagFixupState
%EQUATE `fixupStateSuccess = 0
%EQUATE `fixupStateInProgress = 1
%EQUATE `fixupStateCouldNotUpdate = 2
' // Size = 20 bytes
TYPE FixupInfo DWORD
 state AS LONG ' FixupState enum
 percentage AS BYTE ' Percentage = UINT8
 resultCodes AS ResultCodes ' ResultCodes
 fixupMsgId AS DWORD ' MessageId = UINT32
END TYPE
MACRO FixupInfo_type = FixupInfo ' // For compatibility with PB includes
'enum tagNapNotifyType
%EQUATE `napNotifyTypeUnknown = 0
%EQUATE `napNotifyTypeServiceState = 1
%EQUATE `napNotifyTypeQuarState = 2
' // Size = 36 bytes
TYPE SystemHealthAgentState DWORD
 id AS DWORD ' SystemHealthEntityId = UINT32
 shaResultCodes AS ResultCodes ' ResultCodes
 failureCategory AS LONG ' FailureCategory enum
 fixupInfo AS FixupInfo ' FixupInfo
END TYPE
TYPE SoHAttribute_STRUCT WORD
 type AS WORD ' UINT16
 size AS WORD ' UINT16
 value AS BYTE PTR ' BYTE*
END TYPE
TYPE SoHAttribute_PBSTRUCT WORD
 ' // For compatibility with PB includes
 ntype AS WORD
 nsize AS WORD
 nvalue AS BYTE PTR
END TYPE
' // Size = 8 bytes
UNION SoHAttribute WORD
 SoHAttribute_STRUCT
 SoHAttribute_PBSTRUCT
END UNION
' // Size = 8 bytes
TYPE SoH DWORD
 count AS WORD ' UINT16
 attributes AS SoHAttribute PTR ' SoHAttribute *
END TYPE
'typedef struct tagSoH SoHRequest;
'typedef struct tagSoH SoHResponse;
MACRO SoHRequest = SoH
MACRO SoHResponse = SoH
TYPE NetworkSoH_STRUCT DWORD
 size AS WORD ' UINT16
 data AS BYTE PTR ' BYTE*
END TYPE
TYPE NetworkSoH_PBSTRUCT DWORD
 ' // For compatibility with PB includes
 nsize AS WORD
 ndata AS BYTE PTR
END TYPE
' // Size = 8 bytes
UNION NetworkSoH DWORD
 NetworkSoH_STRUCT
 NetworkSoH_PBSTRUCT
END UNION
'typedef struct tagNetworkSoH NetworkSoHRequest;
'typedef struct tagNetworkSoH NetworkSoHResponse;
MACRO NetworkSoHRequest = NetworkSoH
MACRO NetworkSoHResponse = NetworkSoH
TYPE PrivateData_STRUCT DWORD
 size AS WORD ' UINT16
 data AS BYTE PTR ' BYTE*
END TYPE
TYPE PrivateData_PBSTRUCT DWORD
 ' // For compatibility with PB includes
 nsize AS WORD
 ndata AS BYTE PTR
END TYPE
' // Size = 8 bytes
UNION PrivateData
 PrivateData_STRUCT
 PrivateData_PBSTRUCT
END UNION
' // Size = 80 bytes
TYPE NapComponentRegistrationInfo DWORD
 id AS DWORD ' NapComponentId = UINT32
 friendlyName AS CountedString ' CountedString
 description AS CountedString ' CountedString
 version AS CountedString ' CountedString
 vendorName AS CountedString ' CountedString
 infoClsid AS GUID ' CLSID
 configClsid AS GUID ' CLSID
 registrationDate AS FILETIME ' FILETIME
 componentType AS DWORD ' UINT32
END TYPE
'enum tagRemoteConfigurationType
%EQUATE `remoteConfigTypeMachine = 1
%EQUATE `remoteConfigTypeConfigBlob = %remoteConfigTypeMachine + 1
#ENDIF ' /* __INapTypes_INTERFACE_DEFINED__ */
#ENDIF
