| title | IGlobalRSCAQueryProvider::GetFunctionParameters Method |
|---|---|
| description | Learn how the GetFunctionParameters method returns the parameters of the dynamic function call that caused the event. |
| ms.date | 10/07/2016 |
| ms.assetid | 66f47e85-f9ad-b65a-aa82-9372115f9f82 |
Returns the parameters of the dynamic function call that caused the event.
virtual PCWSTR GetFunctionParameters(
VOID
) const = 0; This method takes no parameters.
A pointer to a constant null-terminated Unicode string that contains the parameters of the dynamic function call that caused the event.
CGlobalModule derived classes that register for GL_RSCA_QUERY events receive an IGlobalRscaQueryProvider pointer as a parameter on the CGlobalModule::OnGlobalRSCAQueryvirtual method. You can then retrieve the parameters of the function by calling the GetFunctionParameters method on the IGlobalRSCAQueryProvider pointer.
The return value of the GetFunctionParameters method depends on implementation. You should use the following information as a guideline, but it may not be correct in all scenarios:
-
The default implementer of the IProtocolManager, IPmCustomActions, IPmHealthAndIdleMonitor, and IPmListenerChannelManager interfaces raises events when you call the IRSCA_WorkerProcess::EnumerateAppDomains and IRSCA_AppDomain::Unload methods. These methods map to the PMH_App_Domain_Enum_V1 and PMH_App_Domain_Unload_V1 values, respectively, which are returned when you call the GetFunctionName method. The parameters of this function are, in turn, returned when you call
GetFunctionParameters. -
The
IGlobalRSCAQueryProviderimplementer receives the function name and function parameter values as strings when either of the IRSCA_AppDomain events is raised, and the implementer holds references to these strings. If a string is NULL,GetFunctionParametersreturns the empty string. Otherwise,GetFunctionParametersreturns a pointer to this shared string.
IGlobalRSCAQueryProvider implementers are responsible for memory management with this data; therefore, IGlobalRSCAQueryProvider implementers that use dynamic memory allocation must release or call delete on the PCWSTR pointer when it is no longer needed.
IGlobalRSCAQueryProvider implementers are responsible for memory management with this data; therefore, IGlobalRSCAQueryProvider clients must not release or call delete on the returned PCWSTR pointer when this data is no longer needed. Furthermore, clients must not cast this data to a pointer that is not a const or change the state of the memory referenced by this PCWSTR, because either an access violation will be thrown or the data will become invalid.
The following code example demonstrates how to create a global module that listens for GL_RSCA_QUERY events and then writes the function parameter information to the Event Viewer.
Caution
[!INCLUDEiisver] generates a large number of events in the Event Viewer. To avoid a log overflow error in a production environment, you should generally avoid writing cache information to the event log. For demonstration purposes, this code example writes an entry to the Event Viewer in debug mode only.
[!code-cppIGlobalRSCAQueryProvider#3]
For more information on how to create and deploy a native DLL module, see Walkthrough: Creating a Request-Level HTTP Module By Using Native Code.
The above code writes an event to the application log of the Event Viewer, where the Data box contains a string similar to the following:
Parameters:
You can optionally compile the code by using the __stdcall (/Gz) calling convention instead of explicitly declaring the calling convention for each function.
| 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 |