HttpInitialize function (http.h)

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

[in] 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.

[in] 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, HttpDeleteServiceConfiguration, and HttpIsFeatureSupported.
HTTP_INITIALIZE_SERVER
Perform initialization for applications that use the HTTP Server API.

[in, out] pReserved

This parameter is reserved, and must be NULL.

Return value

If the function succeeds, then the return value is NO_ERROR.

If the function fails, then 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

Requirement Value
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