HttpInitialize function

The HttpInitialize function initializes the HTTP Server API driver, starts it, if it has not already been started, and allocates data structures for the calling application to support response-queue creation and other operations. Call this function before calling any other functions in the HTTP Server API.

Syntax

HTTPAPI_LINKAGE ULONG HttpInitialize(
  IN HTTPAPI_VERSION Version,
  IN ULONG           Flags,
  IN OUT PVOID       pReserved
);

Parameters

Version

HTTP version. This parameter is an HTTPAPI_VERSION structure. For the current version, declare an instance of the structure and set it to the pre-defined value HTTPAPI_VERSION_1 before passing it to HttpInitialize.

Flags

Initialization options, which can include one or both of the following values.

Value Meaning
HTTP_INITIALIZE_CONFIG
Perform initialization for applications that use the HTTP configuration functions, HttpSetServiceConfiguration, HttpQueryServiceConfiguration and HttpDeleteServiceConfiguration.
HTTP_INITIALIZE_SERVER
Perform initialization for applications that use the HTTP Server API.

pReserved

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
ERROR_INVALID_PARAMETER
The Flags parameter contains an unsupported value.
Other
A system error code defined in WinError.h.

Remarks

Call HttpTerminate when the application completes. All the same flags that were passed to HttpInitialize in the Flags parameter must also be passed to HttpTerminate. An application can call HttpInitialize repeatedly, provided that each call to HttpInitialize is later matched by a corresponding call to HttpTerminate.

Requirements

   
Minimum supported client Windows Vista, 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

HttpTerminate