Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 3.79 KB

File metadata and controls

56 lines (42 loc) · 3.79 KB
title IHttpServer::SatisfiesPrecondition Method
description Learn how the IHttpServer::SatisfiesPrecondition method determines whether a specific precondition has been met for the current request.
ms.date 10/07/2016
ms.assetid cc0beadd-fa0d-b706-02db-f4931ae6c78a

IHttpServer::SatisfiesPrecondition Method

Determines whether a specific precondition has been met for the current request.

Syntax

virtual BOOL SatisfiesPrecondition(  
   IN PCWSTR pszPrecondition  
) const = 0;  

Parameters

pszPrecondition
[IN] A pointer to a string that contains the precondition to test.

Return Value

true if the precondition has been met; otherwise, false.

Remarks

The SatisfiesPrecondition method tests whether a specific precondition has been met for the current request. For example, an HTTP handler may require a specific version of the [!INCLUDEdnprdnshort], or an HTTP module may require integrated or ISAPI mode.

The following table lists the possible preconditions for [!INCLUDEiisver].

Value Description
integratedMode or ISAPIMode Specifies the required mode of operation as integrated or ISAPI mode.
runtimeVersionv1.0, runtimeVersionv1.1, or runtimeVersionv2.0 Specifies the required version of the [!INCLUDEdnprdnshort].
bitness32 or bitness64 Specifies a 32-bit or 64-bit requirement.
appPoolName=name1;name2 Specifies the names of required application pools.

Example

The following code example demonstrates how to use the SatisfiesPrecondition method to create an HTTP module that determines whether the integratedMode precondition has been met and then returns a status message to a Web client.

[!code-cppIHttpServerSatisfiesPrecondition#1]

Your module must export the RegisterModule function. You can export this function by creating a module definition (.def) file for your project, or you can compile the module by using the /EXPORT:RegisterModule switch. For more information, see Walkthrough: Creating a Request-Level HTTP Module By Using Native Code.

You can optionally compile the code by using the __stdcall (/Gz) calling convention instead of explicitly declaring the calling convention for each function.

Requirements

Type Description
Client - IIS 7.0 on [!INCLUDEwinvista]
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on [!INCLUDEwinsrv2008]
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
- [!INCLUDEiisexp75], [!INCLUDEiisexp80], [!INCLUDEiisexp100]
Header Httpserv.h

See Also

IHttpServer Interface