| 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 |
| 34 | LPVOID EEVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect); |
| 35 | BOOL EEVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType); |
| 36 | SIZE_T EEVirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength); |
| 37 | BOOL EEVirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect); |
| 38 | HANDLE EEGetProcessHeap(); |
| 39 | HANDLE EEHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize); |
| 40 | BOOL EEHeapDestroy(HANDLE hHeap); |
| 41 | LPVOID EEHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes); |
| 42 | BOOL EEHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem); |
| 43 | BOOL EEHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem); |
| 44 | |
| 45 | BOOL EEAllocationDisallowed(); |
| 46 | HANDLE EEGetProcessExecutableHeap(); |
| 47 | |
| 48 | // critical section functions |
| 49 | CRITSEC_COOKIE EECreateCriticalSection(CrstType crstType, CrstFlags flags); |
| 50 | void EEDeleteCriticalSection(CRITSEC_COOKIE cookie); |
| 51 | void EEEnterCriticalSection(CRITSEC_COOKIE cookie); |
| 52 | void EELeaveCriticalSection(CRITSEC_COOKIE cookie); |
| 53 | |
| 54 | DWORD EESleepEx(DWORD dwMilliseconds, BOOL bAlertable); |
| 55 | |
| 56 | // TLS functions |
| 57 | LPVOID EETlsGetValue(DWORD slot); |
| 58 | BOOL EETlsCheckValue(DWORD slot, LPVOID * pValue); |
| 59 | VOID EETlsSetValue(DWORD slot, LPVOID pData); |
| 60 | |
| 61 | |
| 62 | |
| 63 | #endif |
| 64 | |
| 65 | |