' ########################################################################################
' Microsoft Windows
' File: authen.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_authen_PBI)
#DEFINE PBX_authen_PBI
%EQUATE `AUTHEN_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/OAIdl.inc"
#INCLUDE ONCE "Legacy/Media/wmscontext.inc"
$IID_IWMSAuthenticationPlugin = GUID$("{BE185FF9-6932-11D2-8B3B-006097B01206}")
$IID_IWMSAuthenticationContext = GUID$("{BE185FFA-6932-11D2-8B3B-006097B01206}")
$IID_IWMSAuthenticationCallback = GUID$("{BE185FFB-6932-11D2-8B3B-006097B01206}")
' ########################################################################################
' Interface name = IWMSAuthenticationPlugin
' IID = {BE185FF9-6932-11D2-8B3B-006097B01206}
' Provides methods for retrieving information about an authentication plugin and for accessing the plug-ins IWMSAuthenticationContext object.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSAuthenticationPlugin_INTERFACE_DEFINED)
 %IWMSAuthenticationPlugin_INTERFACE_DEFINED = 1
' WMS_AUTHENTICATION_FLAGS enum
MACRO WMS_AUTHENTICATION_FLAGS_ENUM = DWORD
%EQUATE `WMS_AUTHENTICATION_TEXT_CHALLENGE = &H1
%EQUATE `WMS_AUTHENTICATION_CLIENT_SHOWS_UI = &H2
%EQUATE `WMS_AUTHENTICATION_ANONYMOUS = &H4
%EQUATE `WMS_AUTHENTICATION_CHALLENGE_FIRST = &H8
INTERFACE IWMSAuthenticationPlugin $IID_IWMSAuthenticationPlugin
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetPackageName ( ' VTable offset = 12
 BYREF pbstrPackageName AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD GetProtocolName ( ' VTable offset = 16
 BYREF pbstrProtocolName AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD GetFlags ( ' VTable offset = 20
 BYREF plFlags AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD CreateAuthenticationContext ( ' VTable offset = 24
 BYREF ppAuthenCtx AS IWMSAuthenticationContext
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSAuthenticationPlugin_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IWMSAuthenticationContext
' IID = {BE185FFA-6932-11D2-8B3B-006097B01206}
' Provides methods that are used to authenticate a client.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSAuthenticationContext_INTERFACE_DEFINED)
 %IWMSAuthenticationContext_INTERFACE_DEFINED = 1
INTERFACE IWMSAuthenticationContext $IID_IWMSAuthenticationContext
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetAuthenticationPlugin ( ' VTable offset = 12
 BYREF ppAuthenPlugin AS IWMSAuthenticationPlugin
 ) AS LONG
 ' =====================================================================================
 METHOD Authenticate ( ' VTable offset = 16
 BYVAL ResponseBlob AS VARIANT
 , BYVAL pUserCtx AS IWMSContext
 , BYVAL pPresentationCtx AS IWMSContext
 , BYVAL pCommandContext AS IWMSCommandContext
 , BYVAL IWMSAuthenticationCallback
 , BYVAL pCallback AS VARIANT
 ) AS LONG
 ' =====================================================================================
 METHOD GetLogicalUserID ( ' VTable offset = 20
 BYREF pbstrUserID AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD GetImpersonationAccountName ( ' VTable offset = 24
 BYREF pbstrAccountName AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD GetImpersonationToken ( ' VTable offset = 28
 BYREF plToken AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSAuthenticationContext_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IWMSAuthenticationCallback
' IID = {BE185FFB-6932-11D2-8B3B-006097B01206}
' Provides a method to notify the server of the results of an authentication request.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSAuthenticationCallback_INTERFACE_DEFINED)
 %IWMSAuthenticationCallback_INTERFACE_DEFINED = 1
' WMS_AUTHENTICATION_RESULT enum
MACRO WMS_AUTHENTICATION_RESULT_ENUM = DWORD
%EQUATE `WMS_AUTHENTICATION_SUCCESS = &H1
%EQUATE `WMS_AUTHENTICATION_DENIED = &H2
%EQUATE `WMS_AUTHENTICATION_CONTINUE = &H3
%EQUATE `WMS_AUTHENTICATION_ERROR = &H4
INTERFACE IWMSAuthenticationCallback $IID_IWMSAuthenticationCallback
 INHERIT IUnknown
 ' =====================================================================================
 METHOD OnAuthenticateComplete ( ' VTable offset = 12
 BYVAL AuthResult AS WMS_AUTHENTICATION_RESULT_ENUM
 , BYVAL ChallengeBlob AS VARIANT
 , BYVAL Context AS VARIANT
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSAuthenticationCallback_INTERFACE_DEFINED__ */
#ENDIF
