BOOL GetServerVariable( LPTSTR lpszVariableName, LPVOID lpvBuffer, LPDWORD lpdwSize );
Return Value
Nonzero if successful, otherwise 0. The Win32 API call GetLastError can be used to determine why the call failed. Possible error values include:
Value | Meaning |
ERROR_INVALID_PARAMETER | Bad connection handle. |
ERROR_INVALID_INDEX | Bad or unsupported variable identifier. |
ERROR_INSUFFICIENT_BUFFER | Buffer too small; the required size is returned in lpdwSize. |
ERROR_MORE_DATA | Buffer too small, only part of data returned. The total size of the data is not returned. |
ERROR_NO_DATA | The data requested is not available. |
Parameters
lpszVariableName
Null-terminated string indicating which variable is being requested. See the Remarks section below for a selection of possible names. All variable names are as defined in the CGI specification located at http://hoohoo.ncsa.uiuc.edu/cgi/env.html.
lpvBuffer
Pointer to buffer to receive the requested information.
lpdwSize
Pointer to DWORD indicating the number of bytes available in the buffer. On successful completion the DWORD contains the number of bytes transferred into the buffer (including the null-terminating byte).
Remarks
This member function is called by the framework to copy information relating to an HTTP connection, or to the server itself, into a buffer supplied by the caller. Possible lpszVariableNames include:
Value | Meaning |
ALL_HTTP | All HTTP headers that were not already parsed into one of the above variables. These variables are of the form HTTP_<header field name>. |
AUTH_TYPE | Contains the type of authentication used. For example, if Basic authentication is used, the string will be "Basic". For Windows NT Challenge-response, it will be "NTLM". Other authentication schemes will have other strings. Because new authentication types can be added to Internet Server, it is not possible to list all possible strings. If the string is empty then no authentication is used. |
CONTENT_LENGTH | The number of bytes which the script can expect to receive from the client. |
CONTENT_TYPE | The content type of the information supplied in the body of a POST request. |
GATEWAY_INTERFACE | The revision of the CGI specification to which this server complies. The current version is CGI/1.1. |
HTTP_ACCEPT | Special case HTTP header. Values of the Accept: fields are concatenated, separated by ", ". For example, if the following lines are part of the HTTP header:
then the HTTP_ACCEPT variable will have a value of:
|
PATH_INFO | Additional path information, as given by the client. This comprises the trailing part of the URL after the script name but before the query string (if any). |
PATH_TRANSLATED | This is the value of PATH_INFO, but with any virtual path name expanded into a directory specification. |
QUERY_STRING | The information which follows the ? in the URL which referenced this script. |
REMOTE_ADDR | The IP address of the client. |
REMOTE_HOST | The hostname of the client. |
REMOTE_USER | This contains the username supplied by the client and authenticated by the server. |
REQUEST_METHOD | The HTTP request method. |
SCRIPT_NAME | The name of the script program being executed. |
SERVER_NAME | The server's hostname (or IP address) as it should appear in self-referencing URLs. |
SERVER_PORT | The TCP/IP port on which the request was received. |
SERVER_PROTOCOL | The name and version of the information retrieval protocol relating to this request. Normally HTTP/1.0. |
SERVER_SOFTWARE | The name and version of the web server under which the CGI program is running. |
CHttpFilterContext Overview | Class Members | Hierarchy Chart