From fe139d460e690a27cc98bb9c077eeb5964fc7877 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Tue, 11 Nov 2025 16:07:58 -0800 Subject: have the HAL layer created for correctly demo the Interface of WIfireuqest, meanwhile have the WPPTrace enabled for both um and km --- .../wlan/WIFICX/drivercode/memorymanagement.cpp | 53 +++++++++++----------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'network/wlan/WIFICX/drivercode/memorymanagement.cpp') diff --git a/network/wlan/WIFICX/drivercode/memorymanagement.cpp b/network/wlan/WIFICX/drivercode/memorymanagement.cpp index 8c6d56d0..de231d8c 100644 --- a/network/wlan/WIFICX/drivercode/memorymanagement.cpp +++ b/network/wlan/WIFICX/drivercode/memorymanagement.cpp @@ -1,36 +1,35 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - - Microsoft Confidential - - THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR - PURPOSE. - -Module Name: - - new.cpp - -Abstract: - - Test only stub WDI driver (C++ portions) - -Environment: - - Kernel mode - -Author: - - ---*/ +// Copyright (C) Microsoft Corporation. All rights reserved. #include "precomp.h" #ifndef _KERNEL_MODE #include // for _ReturnAddress for user mode #endif // UM +typedef struct _PLACEMENT_NEW_ALLOCATION_CONTEXT +{ + size_t cbMaxSize; + _Field_size_bytes_(cbMaxSize) void* pbBuffer; +} PLACEMENT_NEW_ALLOCATION_CONTEXT, * PPLACEMENT_NEW_ALLOCATION_CONTEXT; +typedef const PLACEMENT_NEW_ALLOCATION_CONTEXT* PCPLACEMENT_NEW_ALLOCATION_CONTEXT; + +// for FreeWdfMemoryBuffer to correct get +// the handle to free the memory +struct WIFI_IHV_MEMORY_HEADER +{ + size_t HeaderSize; + WDFMEMORY WdfMemoryHandle; +}; + +// for tracking memory leaks +struct WIFI_IHV_MEMORY_CONTEXT +{ + size_t ContextSize; + void* pvCaller; +}; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_MEMORY_CONTEXT, GetWificxIhvMemoryContextFromHandle); + + void* AllocateWdfMemoryBuffer(size_t Size, _In_ void* CallerForMemoryLeakTracking) { size_t totalSize = 0; -- cgit v1.3.1