From a982f7e243ac4cb584e7fa89265dc6ccd4404880 Mon Sep 17 00:00:00 2001 From: Girish Pattabiraman Date: Wed, 8 Feb 2017 15:43:47 -0800 Subject: Removing local "new and delete operators" and suppressing warning 4595 --- .../sysvad/EndpointsCommon/EndpointsCommon.vcxproj | 15 +- audio/sysvad/EndpointsCommon/NewDelete.cpp | 178 --------------------- audio/sysvad/EndpointsCommon/NewDelete.h | 117 -------------- .../PhoneAudioSample/PhoneAudioSample.vcxproj | 12 +- .../TabletAudioSample/TabletAudioSample.vcxproj | 14 +- audio/sysvad/sysvad.h | 1 - 6 files changed, 26 insertions(+), 311 deletions(-) delete mode 100644 audio/sysvad/EndpointsCommon/NewDelete.cpp delete mode 100644 audio/sysvad/EndpointsCommon/NewDelete.h diff --git a/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj b/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj index a0c0e157..1956d106 100644 --- a/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj +++ b/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj @@ -95,9 +95,10 @@ %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. - %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS + 4595;%(DisableSpecificWarnings) %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. @@ -111,9 +112,10 @@ %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. - %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS + 4595;%(DisableSpecificWarnings) %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. @@ -127,9 +129,10 @@ %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. - %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS + 4595;%(DisableSpecificWarnings) %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. @@ -143,9 +146,10 @@ %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. - %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS + 4595;%(DisableSpecificWarnings) %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. @@ -163,7 +167,6 @@ - @@ -180,4 +183,4 @@ - + \ No newline at end of file diff --git a/audio/sysvad/EndpointsCommon/NewDelete.cpp b/audio/sysvad/EndpointsCommon/NewDelete.cpp deleted file mode 100644 index 406b4245..00000000 --- a/audio/sysvad/EndpointsCommon/NewDelete.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/***************************************************************************** - * NewDelete.cpp - CPP placement new and delete operators implementation - ***************************************************************************** - * Copyright (c) Microsoft Corporation All Rights Reserved - * - * Module Name: - * - * NewDelete.cpp - * - * Abstract: - * - * Definition of placement new and delete operators. - * - */ - -#ifdef _NEW_DELETE_OPERATORS_ -#ifdef __cplusplus -extern "C" { -#include -} -#else -#include -#endif - -#include "newDelete.h" -#include "sysvad.h" - -#pragma code_seg() -/***************************************************************************** - * Functions - */ - -/***************************************************************************** - * ::new() - ***************************************************************************** - * New function for creating objects with a specified allocation tag. - */ -PVOID operator new -( - size_t iSize, - _When_((poolType & NonPagedPoolMustSucceed) != 0, - __drv_reportError("Must succeed pool allocations are forbidden. " - "Allocation failures cause a system crash")) - POOL_TYPE poolType, - ULONG tag -) -{ - PVOID result = ExAllocatePoolWithTag(poolType, iSize, tag); - - if (result) - { - RtlZeroMemory(result,iSize); - } - - return result; -} - - -/***************************************************************************** - * ::new() - ***************************************************************************** - * New function for creating objects with a specified allocation tag. - */ -PVOID operator new -( - size_t iSize, - _When_((poolType & NonPagedPoolMustSucceed) != 0, - __drv_reportError("Must succeed pool allocations are forbidden. " - "Allocation failures cause a system crash")) - POOL_TYPE poolType -) -{ - PVOID result = ExAllocatePoolWithTag(poolType, iSize, SYSVAD_POOLTAG); - - if (result) - { - RtlZeroMemory(result,iSize); - } - - return result; -} - - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Delete with tag function. - */ -void __cdecl operator delete -( - PVOID pVoid, - ULONG tag -) -{ - if (pVoid) - { - ExFreePoolWithTag(pVoid, tag); - } -} - - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Sized Delete function. - */ -void __cdecl operator delete -( - _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid, - _In_ size_t cbSize -) -{ - UNREFERENCED_PARAMETER(cbSize); - - if (pVoid) - { - ExFreePoolWithTag(pVoid, SYSVAD_POOLTAG); - } -} - - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Basic Delete function. - */ -/* Commented out as "void __cdecl operator delete(void *) is already defined - * in stdunk.lib - */ -// void __cdecl operator delete -// ( -// PVOID pVoid -// ) -// { -// if (pVoid) -// { -// ExFreePoolWithTag(pVoid, SYSVAD_POOLTAG); -// } -// } - - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Sized Array Delete function. - */ -void __cdecl operator delete[] -( - _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid, - _In_ size_t cbSize -) -{ - UNREFERENCED_PARAMETER(cbSize); - - if (pVoid) - { - ExFreePoolWithTag(pVoid, SYSVAD_POOLTAG); - } -} - - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Array Delete function. - */ -void __cdecl operator delete[] -( - _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid -) -{ - if (pVoid) - { - ExFreePoolWithTag(pVoid, SYSVAD_POOLTAG); - } -} - -#endif _NEW_DELETE_OPERATORS_ diff --git a/audio/sysvad/EndpointsCommon/NewDelete.h b/audio/sysvad/EndpointsCommon/NewDelete.h deleted file mode 100644 index 53765939..00000000 --- a/audio/sysvad/EndpointsCommon/NewDelete.h +++ /dev/null @@ -1,117 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation All Rights Reserved - -Module Name: - - NewDelete.h - -Abstract: - - Declaration of placement new and delete operators. - -//@@BEGIN_DDKSPLIT -Revision History: - -//@@END_DDKSPLIT - ---*/ -#pragma once - -#ifdef _NEW_DELETE_OPERATORS_ - -/***************************************************************************** - * Functions - */ - -/***************************************************************************** - * ::new() - ***************************************************************************** - * New function for creating objects with a specified allocation tag and - * pool type - */ -PVOID operator new -( - size_t iSize, - _When_((poolType & NonPagedPoolMustSucceed) != 0, - __drv_reportError("Must succeed pool allocations are forbidden. " - "Allocation failures cause a system crash")) - POOL_TYPE poolType, - ULONG tag -); - - -/***************************************************************************** - * ::new() - ***************************************************************************** - * New function for creating objects with a specified pool type. - */ -PVOID operator new -( - size_t iSize, - _When_((poolType & NonPagedPoolMustSucceed) != 0, - __drv_reportError("Must succeed pool allocations are forbidden. " - "Allocation failures cause a system crash")) - POOL_TYPE poolType -); - - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Delete with tag function. - */ -void __cdecl operator delete -( - PVOID pVoid, - ULONG tag -); - - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Sized Delete function. - */ -void __cdecl operator delete -( - _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid, - _In_ size_t cbSize -); - - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Basic Delete function. - */ -void __cdecl operator delete -( - PVOID pVoid -); - - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Sized Array Delete function. - */ -void __cdecl operator delete[] -( - _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid, - _In_ size_t cbSize -); - - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Array Delete function. - */ -void __cdecl operator delete[] -( - _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid -); - -#endif//_NEW_DELETE_OPERATORS_ - diff --git a/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj b/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj index 32676f56..f140a088 100644 --- a/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj +++ b/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj @@ -184,10 +184,11 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS - %(PreprocessorDefinitions);_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_IPortClsRuntimePower %(AdditionalIncludeDirectories);..\EndpointsCommon + 4595;%(DisableSpecificWarnings) %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS @@ -206,10 +207,11 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS - %(PreprocessorDefinitions);_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_IPortClsRuntimePower %(AdditionalIncludeDirectories);..\EndpointsCommon + 4595;%(DisableSpecificWarnings) %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS @@ -228,10 +230,11 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS - %(PreprocessorDefinitions);_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_IPortClsRuntimePower %(AdditionalIncludeDirectories);..\EndpointsCommon + 4595;%(DisableSpecificWarnings) %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS @@ -250,10 +253,11 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS - %(PreprocessorDefinitions);_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_IPortClsRuntimePower %(AdditionalIncludeDirectories);..\EndpointsCommon + 4595;%(DisableSpecificWarnings) %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS diff --git a/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj b/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj index dd4a8037..272a3b97 100644 --- a/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj +++ b/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj @@ -184,10 +184,11 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS - %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates %(AdditionalIncludeDirectories);..\EndpointsCommon + 4595;%(DisableSpecificWarnings) %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS @@ -206,10 +207,11 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS - %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates %(AdditionalIncludeDirectories);..\EndpointsCommon + 4595;%(DisableSpecificWarnings) %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS @@ -228,10 +230,11 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS - %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates %(AdditionalIncludeDirectories);..\EndpointsCommon + 4595;%(DisableSpecificWarnings) %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS @@ -250,10 +253,11 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS - %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates;_NEW_DELETE_OPERATORS_ + %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates %(AdditionalIncludeDirectories);..\EndpointsCommon + 4595;%(DisableSpecificWarnings) %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS @@ -292,4 +296,4 @@ - + \ No newline at end of file diff --git a/audio/sysvad/sysvad.h b/audio/sysvad/sysvad.h index 1dfaea0a..0e35aebd 100644 --- a/audio/sysvad/sysvad.h +++ b/audio/sysvad/sysvad.h @@ -23,7 +23,6 @@ Abstract: #include #include #include -#include "NewDelete.h" //============================================================================= // Defines -- cgit v1.3.1