Программирование в IIS




Пример 5.3


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Name:HttpExtensionProc

In: pECB - pointer to the Extension control block structure

Out: DWORD - HSE status code

Purpose:

main entry point for HTTP request

the possible return codes are:

HSE_STATUS_SUCCESS - everything worked great

HSE_STATUS_SUCCESS_AND_KEEP_CONN - same as HSE_STATUS_SUCCESS

since IIS 4

HSE_STATUS_PENDING - wait until effort completed

HSE_STATUS_ERROR - sends a 500 error code

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB)

{

string sDoc;

//start our XML document

sDoc = string(HEAD) + string(NEW_LINE) + string(XML_L) +

string(MAIN_ELEMENT_NAME) + string(XML_R) +

string(NEW_LINE);

//START THE ECBServerVariable VARIABLES

sDoc += string(XML_L) +

string("ECBServerVariable") + string(XML_R) +

string(NEW_LINE);

//GET the ALL_HTTP

sDoc += string(XML_L) + string("ALL_HTTP");

GetALLHTTPHeader(pECB, &sDoc);

sDoc += string(XML_R_END) +

string(NEW_LINE);//end the first main element

GetECBElement(pECB, string("AUTH_TYPE"), &sDoc);

GetECBElement(pECB, string("APPL_MD_PATH"), &sDoc);

GetECBElement(pECB, string("APPL_PHYSICAL_PATH"), &sDoc);

GetECBElement(pECB, string("CONTENT_LENGTH"), &sDoc);

GetECBElement(pECB, string("CONTENT_TYPE"), &sDoc);

GetECBElement(pECB, string("GATEWAY_INTERFACE"), &sDoc);

GetECBElement(pECB, string("HTTP_ACCEPT"), &sDoc);

GetECBElement(pECB, string("HTTPS"), &sDoc);

GetECBElement(pECB, string("HTTP_AUTHORIZATION"), &sDoc);

GetECBElement(pECB, string("LOGON_USER"), &sDoc);

GetECBElement(pECB, string("AUTH_PASSWORD"), &sDoc);

GetECBElement(pECB, string("AUTH_TYPE"), &sDoc);

GetECBElement(pECB, string("AUTH_USER"), &sDoc);

GetECBElement(pECB, string("APPL_PHYSICAL_PATH"), &sDoc);




Содержание  Назад  Вперед