1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4//
5
6//
7
8
9#ifndef __HOSTING_H__
10#define __HOSTING_H__
11
12#include "clrhost.h"
13
14#define ClrVirtualAlloc EEVirtualAlloc
15#define ClrVirtualFree EEVirtualFree
16#define ClrVirtualQuery EEVirtualQuery
17#define ClrVirtualProtect EEVirtualProtect
18#define ClrHeapCreate EEHeapCreate
19#define ClrHeapDestroy EEHeapDestroy
20#define ClrHeapAlloc EEHeapAlloc
21#define ClrHeapFree EEHeapFree
22#define ClrHeapValidate EEHeapValidate
23#define ClrCreateCriticalSection EECreateCriticalSection
24#define ClrDestroyCriticalSection EEDestroyCriticalSection
25#define ClrEnterCriticalSection EEEnterCriticalSection
26#define ClrLeaveCriticalSection EELeaveCriticalSection
27#define ClrSleepEx EESleepEx
28#define ClrTlsSetValue EETlsSetValue
29#define ClrTlsGetValue EETlsGetValue
30
31#define ClrAllocationDisallowed EEAllocationDisallowed
32
33// memory management function
34LPVOID EEVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
35BOOL EEVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
36SIZE_T EEVirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
37BOOL EEVirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect);
38HANDLE EEGetProcessHeap();
39HANDLE EEHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
40BOOL EEHeapDestroy(HANDLE hHeap);
41LPVOID EEHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);
42BOOL EEHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
43BOOL EEHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);
44
45BOOL EEAllocationDisallowed();
46HANDLE EEGetProcessExecutableHeap();
47
48// critical section functions
49CRITSEC_COOKIE EECreateCriticalSection(CrstType crstType, CrstFlags flags);
50void EEDeleteCriticalSection(CRITSEC_COOKIE cookie);
51void EEEnterCriticalSection(CRITSEC_COOKIE cookie);
52void EELeaveCriticalSection(CRITSEC_COOKIE cookie);
53
54DWORD EESleepEx(DWORD dwMilliseconds, BOOL bAlertable);
55
56// TLS functions
57LPVOID EETlsGetValue(DWORD slot);
58BOOL EETlsCheckValue(DWORD slot, LPVOID * pValue);
59VOID EETlsSetValue(DWORD slot, LPVOID pData);
60
61
62
63#endif
64
65