// umdprovider.h
void UMDEtwLogUnmapAllocation(
ULONGLONG hD3DAllocation,
ULONGLONG hDxgAllocation,
ULONGLONG Offset,
ULONGLONG Size,
UMDETW_ALLOCATION_USAGE Usage,
UMDETW_ALLOCATION_SEMANTIC Semantic
);
View the official Windows Driver Kit DDI referenceNo description available.
Indicates that a Microsoft DirectX graphics kernel subsystem (Dxgkrnl.sys) memory allocation, or a portion of the allocation, is no longer being used. Call this function whether or not the allocation is being destroyed.
hD3DAllocationA handle to the Direct3D allocation.
For Direct3D 10 user-mode drivers, the handle will be the value of the hResource parameter of the CreateResource(D3D10) function. For Direct3D 9 user-mode drivers, the handle will be the value of the pResource parameter that the driver returns in the CreateResource function.
The driver can set this value to NULL if it uses allocations internally.
hDxgAllocationA handle to the DirectX graphics kernel subsystem (Dxgkrnl.sys) allocation that the Direct3D allocation is mapped to.
OffsetThe starting address, in bytes, of the Direct3D allocation within the Dxgkrnl allocation.
SizeThe size, in bytes, of the Direct3D allocation within the Dxgkrnl allocation.
UsageA UMDETW_ALLOCATION_USAGE structure that indicates the reason for this mapping.
SemanticIf the allocation is used internally by the user-mode driver, this is a UMDETW_ALLOCATION_SEMANTIC structure that indicates what the allocation is used for.
When called, this function logs an event that describes which API resource the allocation is, or was, being used for. If no API resource was associated with the allocation, the function logs an event that describes the purpose that the driver indicated for this allocation.
The user-mode display driver must completely account for the video memory it allocates, so it must call this function to log an event every time the allocation changes.
The driver should pass the same parameters values to UMDEtwLogUnmapAllocation as it did to UMDEtwLogMapAllocation.
UMDEtwLogUnmapAllocation is defined inline in Umdprovider.h as:
FORCEINLINE void LogMapAllocation(BOOLEAN Enter,
ULONGLONG hD3DAllocation,
ULONGLONG hDxgAllocation,
ULONGLONG Offset,
ULONGLONG Size,
UMDETW_ALLOCATION_USAGE Usage,
UMDETW_ALLOCATION_SEMANTIC Semantic)
{
if (Enabled)
{
EVENT_DATA_DESCRIPTOR Descriptors[6];
// Create a description of the event
EventDataDescCreate(&Descriptors[0], &hD3DAllocation, 8);
EventDataDescCreate(&Descriptors[1], &hDxgAllocation, 8);
EventDataDescCreate(&Descriptors[2], &Offset, 8);
EventDataDescCreate(&Descriptors[3], &Size, 8);
EventDataDescCreate(&Descriptors[4], &Usage, 4);
EventDataDescCreate(&Descriptors[5], &Semantic, 4);
// Log the event
EventWrite(
RegHandle,
Enter ? (InRundown ? &RundownAllocationEvent : &MapAllocationEvent) : &UnmapAllocationEvent,
sizeof(Descriptors) / sizeof(Descriptors[0]),
Descriptors
);
}
}
FORCEINLINE void UMDEtwLogUnmapAllocation(ULONGLONG hD3DAllocation,
ULONGLONG hDxgAllocation,
ULONGLONG Offset,
ULONGLONG Size,
UMDETW_ALLOCATION_USAGE Usage,
UMDETW_ALLOCATION_SEMANTIC Semantic)
{
LogMapAllocation(FALSE,
hD3DAllocation,
hDxgAllocation,
Offset,
Size,
Usage,
Semantic);
}