' ########################################################################################
' Microsoft Windows
' File: CertPolEng.inc
' 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_CertPolEng_PBI)
#DEFINE PBX_CertPolEng_PBI
%EQUATE `CERTPOLENG_INC = 1
#INCLUDE ONCE "Legacy/Platform/WinCrypt.inc"
#INCLUDE ONCE "Legacy/Security/schannel.inc"
#INCLUDE ONCE "Legacy/Platform/NTSecPkg.inc"
DECLARE FUNCTION PstGetTrustAnchors LIB "certpoleng.dll" ALIAS "PstGetTrustAnchors" ( BYREF pTargetName AS UNICODE_STRING , BYVAL cCriteria AS QUAD , BYREF rgpCriteria AS CERT_SELECT_CRITERIA , BYREF ppTrustedIssuers AS SecPkgContext_IssuerListInfoEx ) AS LONG ' NTSTATUS
DECLARE FUNCTION PstGetCertificates LIB "certpoleng.dll" ALIAS "PstGetCertificates" ( BYREF pTargetName AS UNICODE_STRING , BYVAL cCriteria AS QUAD , BYREF rgpCriteria AS CERT_SELECT_CRITERIA , BYVAL bIsClient AS LONG , BYREF pdwCertChainContextCount AS QUAD , BYREF ppCertChainContexts AS CERT_CHAIN_CONTEXT ) AS LONG ' NTSTATUS
DECLARE FUNCTION PstAcquirePrivateKey LIB "certpoleng.dll" ALIAS "PstAcquirePrivateKey" ( BYREF pCert AS CERT_CONTEXT ) AS LONG ' NTSTATUS
DECLARE FUNCTION PstValidate LIB "certpoleng.dll" ALIAS "PstValidate" ( BYREF pTargetName AS UNICODE_STRING , BYVAL bIsClient AS LONG , BYREF pRequestedIssuancePolicy AS CERT_USAGE_MATCH , BYVAL phAdditionalCertStore AS QUAD , BYREF pCert AS CERT_CONTEXT , OPTIONAL BYREF pProvGUID AS GUID ) AS LONG ' NTSTATUS
DECLARE FUNCTION PstMapCertificate LIB "certpoleng.dll" ALIAS "PstMapCertificate" ( BYREF pCert AS CERT_CONTEXT , BYREF pTokenInformationType AS LONG , BYREF ppTokenInformation AS ANY ) AS LONG ' NTSTATUS
DECLARE FUNCTION PstGetUserNameForCertificate LIB "certpoleng.dll" ALIAS "PstGetUserNameForCertificate" ( BYREF pCertContext AS CERT_CONTEXT , BYREF UserName AS UNICODE_STRING ) AS LONG ' NTSTATUS
#ENDIF
