1//
2// Copyright (c) Microsoft. All rights reserved.
3// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4//
5
6#ifndef _IEEMemoryManager
7#define _IEEMemoryManager
8
9#include "runtimedetails.h"
10
11class interceptor_IEEMM : public IEEMemoryManager
12{
13public:
14 interceptor_IEEMM() : original_IEEMM(nullptr)
15 {
16 }
17
18private:
19 //***************************************************************************
20 // IUnknown methods
21 //***************************************************************************
22 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, void** pInterface);
23 ULONG STDMETHODCALLTYPE AddRef();
24 ULONG STDMETHODCALLTYPE Release();
25
26 //***************************************************************************
27 // IEEMemoryManager methods for locking
28 //***************************************************************************
29 LPVOID STDMETHODCALLTYPE ClrVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
30 BOOL STDMETHODCALLTYPE ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
31 SIZE_T STDMETHODCALLTYPE ClrVirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
32 BOOL STDMETHODCALLTYPE ClrVirtualProtect(LPVOID lpAddress,
33 SIZE_T dwSize,
34 DWORD flNewProtect,
35 PDWORD lpflOldProtect);
36 HANDLE STDMETHODCALLTYPE ClrGetProcessHeap();
37 HANDLE STDMETHODCALLTYPE ClrHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
38 BOOL STDMETHODCALLTYPE ClrHeapDestroy(HANDLE hHeap);
39 LPVOID STDMETHODCALLTYPE ClrHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);
40 BOOL STDMETHODCALLTYPE ClrHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
41 BOOL STDMETHODCALLTYPE ClrHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);
42 HANDLE STDMETHODCALLTYPE ClrGetProcessExecutableHeap();
43
44public:
45 IEEMemoryManager* original_IEEMM;
46};
47#endif
48