Skip to content

Latest commit

 

History

History
60 lines (45 loc) · 4.82 KB

File metadata and controls

60 lines (45 loc) · 4.82 KB
title IHttpContext::DisableNotifications Method
description This article contains information about syntax, return value, and requirements for the IHttpContext::DisableNotifications method.
ms.date 10/07/2016
ms.assetid 9014508e-a74b-8efe-bde1-426df6728b34

IHttpContext::DisableNotifications Method

Disables specific notifications that are pending for this request in the current module.

Syntax

virtual VOID DisableNotifications(  
   IN DWORD dwNotifications,  
   IN DWORD dwPostNotifications  
) = 0;  

Parameters

dwNotifications
[IN] A DWORD that contains a bitmask that specifies the request notifications to disable for this module.

dwPostNotifications
[IN] A DWORD that contains a bitmask that specifies the post-request notifications to disable for this module.

Return Value

VOID.

Remarks

You can use the DisableNotifications method to specify which notifications or post-request notifications you want to disable for the current request. For example, if a module that you are creating has registered for the RQ_AUTHENTICATE_REQUEST and RQ_AUTHORIZE_REQUEST notifications, your module could be configured to ignore the RQ_AUTHORIZE_REQUEST notification based on conditions that are processed in the RQ_AUTHENTICATE_REQUEST notification.

Note

Notifications can be disabled only for the current request and in the current module. The only way to disable notifications that are implemented in other modules would be to return RQ_NOTIFICATION_FINISH_REQUEST from your module.

Note

Notifications can be disabled only for deterministic events; they cannot be disabled for nondeterministic events. For more information, see Comparing Native-Code and Managed-Code Notifications.

Example

The following example demonstrates how to use the DisableNotifications method to create an HTTP module that disables a pending CHttpModule::OnPostBeginRequest notification on the current request.

[!code-cppIHttpContextDisableNotifications#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

IHttpContext Interface
IHttpContext::GetIsLastNotification Method
IHttpContext::GetNextNotification Method
PFN_REGISTERMODULE Function