HttpGetCommandLine Function  
 
INT WINAPI HttpGetCommandLine(
  HSERVER hServer,  
  UINT nClientId,  
  LPTSTR lpszCmdLine,  
  INT nMaxLength  
);

Return the complete command line issued by the client.

Parameters

hServer
The server handle.
nClientId
An unsigned integer which uniquely identifies the client session.
lpszCmdLine
A null-terminated string buffer that will contain the command, including all arguments. The string buffer will be null-terminated and must be large enough to store the complete command line. If this parameter is NULL, the function will return the length of the command line.
nMaxLength
An integer value that specifies the maximum number of characters that can be copied into the string buffer. The internal limit on the maximum length of a command is 1024 characters. If the maximum length specified is smaller than the actual length of the complete command, this function will fail.

Return Value

An integer value which specifies the number of characters copied into the buffer, not including the terminating null character. If the function fails, the return value will be zero and the HttpGetServerError function can be used to retrieve the last error code. If the last error code has a value of zero then no command has been issued by the client.

Remarks

The HttpGetCommandLine function is used to obtain the command that was issued by the client, and is commonly used inside HTTP_CLIENT_COMMAND and HTTP_CLIENT_RESULT event handlers to pre-process and post-process client commands, respectively. When the function returns, the string buffer provided by the caller will contain the complete command, including the resource path and requested HTTP version. Any extraneous whitespace will be removed, however all encoding will be preserved.

To obtain the complete URL associated with the request issued by the client, use the HttpGetCommandUrl function. If the command sent by the client is used to perform an action on a file or directory, the HttpGetCommandFile function should be called to obtain the full path to the local file rather than using the resource path.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: cshtsv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also