Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 4.15 KB

File metadata and controls

51 lines (38 loc) · 4.15 KB
title CGlobalModule::OnGlobalConfigurationChange Method
description Learn how the OnGlobalConfigurationChange method represents the method that handles a GlobalConfigurationChange event.
ms.date 10/07/2016
ms.assetid efed83da-974b-a67b-9e66-86061b8629a7

CGlobalModule::OnGlobalConfigurationChange Method

Represents the method that will handle a GlobalConfigurationChange event, which occurs when a change is made to a configuration file.

Syntax

virtual GLOBAL_NOTIFICATION_STATUS OnGlobalConfigurationChange(  
   IN IGlobalConfigurationChangeProvider* pProvider  
);  

Parameters

pProvider
[IN] A pointer to an IGlobalConfigurationChangeProvider interface.

Return Value

A GLOBAL_NOTIFICATION_STATUS value.

Remarks

When a global module has registered for the GL_CONFIGURATION_CHANGE event notification, IIS will call the module's OnGlobalConfigurationChange method if a configuration file is changed. For example, if the ApplicationHost.config file is changed, an event containing the configuration path will be written to the Event Viewer.

Note

Global modules can register for the GlobalConfigurationChange event notification by registering for GL_CONFIGURATION_CHANGE in the module's RegisterModule function.

Example

The following code example demonstrates how to create a global-level HTTP module that uses the IGlobalConfigurationChangeProvider::GetChangePath method to retrieve the path for a configuration change and add a log entry to the Event Viewer.

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

CGlobalModule Class
IGlobalConfigurationChangeProvider Interface