Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 6.31 KB

File metadata and controls

67 lines (47 loc) · 6.31 KB
title IGlobalRSCAQueryProvider::GetFunctionName Method
description Learn how the GetFunctionName method returns the name of the dynamic function call that caused the event.
ms.date 10/07/2016
ms.assetid c55da23c-5526-427f-6583-55b584e6ada3

IGlobalRSCAQueryProvider::GetFunctionName Method

Returns the name of the dynamic function call that caused the event.

Syntax

virtual PCWSTR GetFunctionName(  
   VOID  
) const = 0;  

Parameters

This method takes no parameters.

Return Value

A pointer to a constant null-terminated Unicode string that contains name of the function that caused the event.

Remarks

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 function name by calling the GetFunctionName method on the IGlobalRSCAQueryProvider pointer.

The return value of the GetFunctionName method depends on implementation. You should use the following information as a guideline, but it may not be correct in all scenarios:

Notes for Implementers

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.

Notes for Callers

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 raised or the data will become invalid.

Example

The following code example demonstrates how to create a global module that listens for GL_RSCA_QUERY events and then writes the function name 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#2]

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 two new events to the application log of the Event Viewer, where the Data box contains a string similar to the following:

Function Name: PMH_App_Domain_Enum_V1  

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

IGlobalRSCAQueryProvider Interface