IHttpContext::DisableNotifications Method

IIS 7.0
 

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

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

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.

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.

System_CAPS_noteNote

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.

System_CAPS_noteNote

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.

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 Windows Vista

  • IIS 7.5 on Windows 7

  • IIS 8.0 on Windows 8

  • IIS 10.0 on Windows 10

Server

  • IIS 7.0 on Windows Server 2008

  • 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 Technical Preview

Product

  • IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0

  • IIS Express 7.5, IIS Express 8.0, IIS Express 10.0

Header

Httpserv.h

Show: