Posts tagged Pipeline

What notifications are delivered to IIS7 native modules

Here is the output of getmreg tool for all the modules listed under <system.webServer/globalModules> section in IIS7 full install. This tells what notifications are delivered to native modules shipped with IIS7.

1. UriCacheModule – getmreg.exe %windir%\system32\inetsrv\cachuri.dll
Global notifications
GL_CACHE_CLEANUP
GL_CACHE_OPERATION
GL_CONFIGURATION_CHANGE

Tool to find native module’s pipeline events registration (source code)

//
// Filename – getmreg.cxx 
// Build this as an executable.
// Keep this exe and module dll
// in the same folder
//
// Run using "getmreg.exe <path to module>"
//
// This tool uses hostable web core functionality
// of IIS7. So this will only run on machine with

Execution order of modules in IIS7

Each request received by IIS 7.0 goes through multiple stages in the IIS request pipeline (read more about request pipeline here). In IIS, request processing move from one stage to the next stage in a fixed sequence. If any of the modules in system.webServer/modules section have subscribed to the event for the current stage then IIS calls each of those modules one by one before moving on to next stage. If there are multiple modules which subscribe to the same event (say RQ_BEGIN_REQUEST), module with higher priority is called first. Native modules can set execution priority for itself in RegisterModule using SetPriorityForRequestNotification. The following code snippet illustrates this for RQ_BEGIN_REQUEST.

HRESULT
RegisterModule(