HttpSetServiceConfiguration function (http.h)
The HttpSetServiceConfiguration function creates and sets a configuration record for the HTTP Server API configuration store. The call fails if the specified record already exists. To change a given configuration record, delete it and then recreate it with a different value.
Syntax
HTTPAPI_LINKAGE ULONG HttpSetServiceConfiguration(
[in] HANDLE ServiceHandle,
[in] HTTP_SERVICE_CONFIG_ID ConfigId,
[in] PVOID pConfigInformation,
[in] ULONG ConfigInformationLength,
[in] LPOVERLAPPED pOverlapped
);
Parameters
[in] ServiceHandle
Reserved. Must be zero.
[in] ConfigId
Type of configuration record to be set. This parameter can be one of the following values from the HTTP_SERVICE_CONFIG_ID enumeration.
ConfigId value | Meaning |
---|---|
|
Sets a record in the IP Listen List. |
|
Sets a specified SSL certificate record. |
|
Sets a URL reservation record. |
|
Sets a specified HTTP Server API wide connection time-out.
Windows Vista and later: This enumeration value is supported. |
|
Sets a specified SSL Server Name Indication (SNI) certificate record.
Windows 8 and later: This enumeration value is supported. |
|
Sets the SSL certificate record that specifies that Http.sys should consult the Centralized Certificate Store (CCS) store to find certificates if the port receives a Transport Layer Security (TLS) handshake. The port is specified by the KeyDesc member of the HTTP_SERVICE_CONFIG_SSL_CCS_SET structure that you pass to the pConfigInformation parameter.
Windows 8 and later: This enumeration value is supported. |
[in] pConfigInformation
A pointer to a buffer that contains the appropriate data to specify the type of record to be set.
ConfigId value | Meaning |
---|---|
|
HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM structure. |
|
HTTP_SERVICE_CONFIG_SSL_SET structure. |
|
HTTP_SERVICE_CONFIG_URLACL_SET structure. |
|
HTTP_SERVICE_CONFIG_TIMEOUT_SET structure. Windows Vista and later: This structure is supported. |
|
HTTP_SERVICE_CONFIG_SSL_SNI_SET structure. The hostname will be "*" when the SSL central certificate store is queried and wildcard bindings are used, and a host name for regular SNI. Windows 8 and later: This structure is supported. |
|
HTTP_SERVICE_CONFIG_SSL_CCS_SET structure. Windows 8 and later: This structure is supported. |
[in] ConfigInformationLength
Size, in bytes, of the pConfigInformation buffer.
[in] pOverlapped
This parameter is reserved and must be NULL.
Return value
If the function succeeds, the return value is NO_ERROR.
If the function fails, the return value is one of the following error codes.
Value | Meaning |
---|---|
|
The specified record already exists, and must be deleted in order for its value to be re-set. |
|
The buffer size specified in the ConfigInformationLength parameter is insufficient. |
|
The ServiceHandle parameter is invalid. |
|
One or more of the supplied parameters is in an unusable form. |
|
The SSL Certificate used is invalid. This can occur only if the HttpServiceConfigSSLCertInfo parameter is used. |
|
A system error code defined in WinError.h. |
Remarks
The configuration parameters set with HttpSetServiceConfiguration are applied to all the HTTP Server API applications on the machine, and persist when the HTTP Server API shuts down, or when the computer is restarted.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP with SP2 [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | http.h |
Library | Httpapi.lib |
DLL | Httpapi.dll |
See also
HTTP Server API Version 1.0 Functions