| title | IReadEntityProvider::GetEntity Method |
|---|---|
| ms.date | 10/07/2016 |
| description | The IReadEntityProvider GetEntity Method retrieves the request entity and the pcbData parameter will specify the size, in bytes, of the data in the request entity. |
| ms.assetid | 84b5367c-ad22-9637-1ced-7500c0a952a8 |
Retrieves the request entity.
virtual VOID GetEntity(
PVOID* ppBuffer,
DWORD* pcbData,
DWORD* pcbBuffer
) = 0; ppBuffer
A pointer to a void buffer that contains the request entity.
pcbData
A pointer to a DWORD that contains the size of the data in ppBuffer.
pcbBuffer
A pointer to a DWORD that contains the size of the ppBuffer buffer, which should be greater than or equal to pcbData.
VOID.
After you call the GetEntity method, the ppBuffer parameter will specify the request entity; the pcbData parameter will specify the size, in bytes, of the data in the request entity that was returned in ppBuffer; and the pcbBuffer parameter will specify the size, in bytes, of the request entity buffer that is pointed to by ppBuffer.
Note
pcbBuffer should always be greater than or equal to pcbData.
The following code example demonstrates how to create an HTTP module that performs the following tasks:
-
Retrieves the request entity by using the
GetEntitymethod. -
Creates an array of strings that contain the size of the request entity data and the buffer size.
-
Writes an Event Viewer log entry that contains the request entity information, and then exits.
[!code-cppIReadEntityProviderGetEntity#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 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.
| 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 |
IReadEntityProvider Interface
IReadEntityProvider::SetEntity Method
IHttpRequest::ReadEntityBody Method
IHttpRequest::InsertEntityBody Method