summaryrefslogtreecommitdiff
path: root/src/vm/hosting.h
blob: 0669ecfdc5ce9b3322ad1cc03192abb829d26685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//

//


#ifndef __HOSTING_H__
#define __HOSTING_H__

#include "clrhost.h"

#define ClrVirtualAlloc                 EEVirtualAlloc
#define ClrVirtualFree                  EEVirtualFree
#define ClrVirtualQuery                 EEVirtualQuery
#define ClrVirtualProtect               EEVirtualProtect
#define ClrHeapCreate                   EEHeapCreate
#define ClrHeapDestroy                  EEHeapDestroy
#define ClrHeapAlloc                    EEHeapAlloc
#define ClrHeapFree                     EEHeapFree
#define ClrHeapValidate                 EEHeapValidate
#define ClrCreateCriticalSection        EECreateCriticalSection
#define ClrDestroyCriticalSection       EEDestroyCriticalSection
#define ClrEnterCriticalSection         EEEnterCriticalSection
#define ClrLeaveCriticalSection         EELeaveCriticalSection
#define ClrSleepEx                      EESleepEx
#define ClrTlsSetValue                  EETlsSetValue
#define ClrTlsGetValue                  EETlsGetValue

#define ClrAllocationDisallowed         EEAllocationDisallowed

// memory management function
LPVOID EEVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
BOOL EEVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
SIZE_T EEVirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
BOOL EEVirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect);
HANDLE EEGetProcessHeap();
HANDLE EEHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
BOOL EEHeapDestroy(HANDLE hHeap);
LPVOID EEHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);
BOOL EEHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
BOOL EEHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);

BOOL EEAllocationDisallowed();
HANDLE EEGetProcessExecutableHeap();

// critical section functions
CRITSEC_COOKIE EECreateCriticalSection(CrstType crstType, CrstFlags flags);
void EEDeleteCriticalSection(CRITSEC_COOKIE cookie);
void EEEnterCriticalSection(CRITSEC_COOKIE cookie);
void EELeaveCriticalSection(CRITSEC_COOKIE cookie);

DWORD EESleepEx(DWORD dwMilliseconds, BOOL bAlertable);

// TLS functions
LPVOID EETlsGetValue(DWORD slot);
BOOL EETlsCheckValue(DWORD slot, LPVOID * pValue);
VOID EETlsSetValue(DWORD slot, LPVOID pData);



#endif