#ifndef __OEMCLIENTAUTH_H__
#define __OEMCLIENTAUTH_H__

/*======================================================

FILE:  OEMClientAuth.h

SERVICES:
        IClientAuth

GENERAL DESCRIPTION:
        Enhanced IWeb interface.
        Handles SSL client auth internally.

=====================================================

      Copyright © 1999-2002 QUALCOMM Incorporated 
              All Rights Reserved.
           QUALCOMM Proprietary/GTDR

=====================================================*/
#include "AEE.h"
#include "AEESource.h"
#include "AEEError.h"
#include "AEEWebOpts.h"
#include "AEEWeb.h"
#include "AEEClientAuth.h"
#include "AEERSA.h"
#include "AEEStdLib.h"
#include "OEMClientAuthDisp.h"
//makise[S]
//#include "ClientAuth.bid"
//#include "WIMPrompt.bid"
#include "OEMClassIDs.h"
//makise[E]

typedef struct SSLTransaction SSLTransaction;

struct SSLTransaction
{
	IWebResp ** ppiwresp;
	AEECallback * pcb;
	char * cpszUrl;
	IWebOpts * pOpts;
	SSLTransaction * pNext;
};

typedef struct ClientAuth ClientAuth;

struct ClientAuth
{
	AEEVTBL(IWeb) *pvt;
	
	uint32 m_nRefs;
	IShell * m_pIShell;
	IModule * m_pIModule;
	IWeb * m_pIWeb;
	IWebResp ** m_ppIWebRespUser;
	IWebOpts * m_pIWebOptsCerts;
	IWebOpts * m_pIWebOptsRenegotiate;
	IWebUtil * m_pIWebUtil;
	IRSA * m_pIRSA;
	IWIMPrompt * m_pIWim;

	SSLTransaction * pReq;
	
	POEMCLIENTAUTHDISP pDisp;
	AEECallback * m_pcbWebResponseUser;  // The placeholder of the user's AEECallback pointer which is passed in IClientAuth_GetResponse/V.
	void * m_pWebStatusUserContext;  // The placeholder of the user's WEBOPT_HANDLERDATA. 
	PFNWEBSTATUS m_pfnWebStatusUser;  // The placeholder of the user's WEBOPT_STATUSHANDLER.
	char * m_cpszUrl;                 // The placeholder of the user's target URL.

	AEECallback m_cbWebResponsePriv;  // Internal AEECallback for first IWEB_GetResponse call.
	AEECallback m_cbWimResponse;      // Internal AEECallback for IWIMPrompt.
	AEECallback * m_pcbSSLNegHandlerResume; // Pointer to store pcb in NegHandler.
	int * m_pnResultCode;                     // Placeholder of the result code.
	PFNNEGHANDLER m_pfnSSLNegHandlerUser;   // Pointer to store user's NegHandler.
	void * m_pSSLNegHandlerDataUser;        // Pointer to store user's NegHandlerData.
	ClientAuthStatus m_nState;
	int m_nWimPromptError;
	
	IWebResp * m_pIWebRespNoMemError;
};

typedef struct NoMemResp NoMemResp;

struct NoMemResp
{
	AEEVTBL(IWebResp) * pvt;
	
	uint32 m_uRefs;
	IShell * m_pIShell;
	WebRespInfo wri;
};
#endif //__OEMCLIENTAUTH_H__
