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 | #include "standardpch.h" |
7 | #include "iexecutionengine.h" |
8 | #include "superpmi-shim-counter.h" |
9 | |
10 | //*************************************************************************** |
11 | // IUnknown methods |
12 | //*************************************************************************** |
13 | HRESULT STDMETHODCALLTYPE interceptor_IEE::QueryInterface(REFIID id, void** pInterface) |
14 | { |
15 | return original_IEE->QueryInterface(id, pInterface); |
16 | } |
17 | ULONG STDMETHODCALLTYPE interceptor_IEE::AddRef() |
18 | { |
19 | return original_IEE->AddRef(); |
20 | } |
21 | ULONG STDMETHODCALLTYPE interceptor_IEE::Release() |
22 | { |
23 | return original_IEE->Release(); |
24 | } |
25 | |
26 | //*************************************************************************** |
27 | // IExecutionEngine methods for TLS |
28 | //*************************************************************************** |
29 | // Associate a callback for cleanup with a TLS slot |
30 | VOID STDMETHODCALLTYPE interceptor_IEE::TLS_AssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback) |
31 | { |
32 | original_IEE->TLS_AssociateCallback(slot, callback); |
33 | } |
34 | // Get the TLS block for fast Get/Set operations |
35 | LPVOID* STDMETHODCALLTYPE interceptor_IEE::TLS_GetDataBlock() |
36 | { |
37 | return original_IEE->TLS_GetDataBlock(); |
38 | } |
39 | // Get the value at a slot |
40 | LPVOID STDMETHODCALLTYPE interceptor_IEE::TLS_GetValue(DWORD slot) |
41 | { |
42 | return original_IEE->TLS_GetValue(slot); |
43 | } |
44 | |
45 | // Get the value at a slot, return FALSE if TLS info block doesn't exist |
46 | BOOL STDMETHODCALLTYPE interceptor_IEE::TLS_CheckValue(DWORD slot, LPVOID* pValue) |
47 | { |
48 | return original_IEE->TLS_CheckValue(slot, pValue); |
49 | } |
50 | // Set the value at a slot |
51 | VOID STDMETHODCALLTYPE interceptor_IEE::TLS_SetValue(DWORD slot, LPVOID pData) |
52 | { |
53 | original_IEE->TLS_SetValue(slot, pData); |
54 | } |
55 | // Free TLS memory block and make callback |
56 | VOID STDMETHODCALLTYPE interceptor_IEE::TLS_ThreadDetaching() |
57 | { |
58 | original_IEE->TLS_ThreadDetaching(); |
59 | } |
60 | |
61 | //*************************************************************************** |
62 | // IExecutionEngine methods for locking |
63 | //*************************************************************************** |
64 | CRITSEC_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateLock(LPCSTR szTag, LPCSTR level, CrstFlags flags) |
65 | { |
66 | return original_IEE->CreateLock(szTag, level, flags); |
67 | } |
68 | void STDMETHODCALLTYPE interceptor_IEE::DestroyLock(CRITSEC_COOKIE lock) |
69 | { |
70 | original_IEE->DestroyLock(lock); |
71 | } |
72 | void STDMETHODCALLTYPE interceptor_IEE::AcquireLock(CRITSEC_COOKIE lock) |
73 | { |
74 | original_IEE->AcquireLock(lock); |
75 | } |
76 | void STDMETHODCALLTYPE interceptor_IEE::ReleaseLock(CRITSEC_COOKIE lock) |
77 | { |
78 | original_IEE->ReleaseLock(lock); |
79 | } |
80 | |
81 | EVENT_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateAutoEvent(BOOL bInitialState) |
82 | { |
83 | return original_IEE->CreateAutoEvent(bInitialState); |
84 | } |
85 | EVENT_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateManualEvent(BOOL bInitialState) |
86 | { |
87 | return original_IEE->CreateManualEvent(bInitialState); |
88 | } |
89 | void STDMETHODCALLTYPE interceptor_IEE::CloseEvent(EVENT_COOKIE event) |
90 | { |
91 | original_IEE->CloseEvent(event); |
92 | } |
93 | BOOL STDMETHODCALLTYPE interceptor_IEE::ClrSetEvent(EVENT_COOKIE event) |
94 | { |
95 | return original_IEE->ClrSetEvent(event); |
96 | } |
97 | BOOL STDMETHODCALLTYPE interceptor_IEE::ClrResetEvent(EVENT_COOKIE event) |
98 | { |
99 | return original_IEE->ClrResetEvent(event); |
100 | } |
101 | DWORD STDMETHODCALLTYPE interceptor_IEE::WaitForEvent(EVENT_COOKIE event, DWORD dwMilliseconds, BOOL bAlertable) |
102 | { |
103 | return original_IEE->WaitForEvent(event, dwMilliseconds, bAlertable); |
104 | } |
105 | DWORD STDMETHODCALLTYPE interceptor_IEE::WaitForSingleObject(HANDLE handle, DWORD dwMilliseconds) |
106 | { |
107 | return original_IEE->WaitForSingleObject(handle, dwMilliseconds); |
108 | } |
109 | SEMAPHORE_COOKIE STDMETHODCALLTYPE interceptor_IEE::ClrCreateSemaphore(DWORD dwInitial, DWORD dwMax) |
110 | { |
111 | return original_IEE->ClrCreateSemaphore(dwInitial, dwMax); |
112 | } |
113 | void STDMETHODCALLTYPE interceptor_IEE::ClrCloseSemaphore(SEMAPHORE_COOKIE semaphore) |
114 | { |
115 | original_IEE->ClrCloseSemaphore(semaphore); |
116 | } |
117 | DWORD STDMETHODCALLTYPE interceptor_IEE::ClrWaitForSemaphore(SEMAPHORE_COOKIE semaphore, |
118 | DWORD dwMilliseconds, |
119 | BOOL bAlertable) |
120 | { |
121 | return original_IEE->ClrWaitForSemaphore(semaphore, dwMilliseconds, bAlertable); |
122 | } |
123 | BOOL STDMETHODCALLTYPE interceptor_IEE::ClrReleaseSemaphore(SEMAPHORE_COOKIE semaphore, |
124 | LONG lReleaseCount, |
125 | LONG* lpPreviousCount) |
126 | { |
127 | return original_IEE->ClrReleaseSemaphore(semaphore, lReleaseCount, lpPreviousCount); |
128 | } |
129 | MUTEX_COOKIE STDMETHODCALLTYPE interceptor_IEE::ClrCreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes, |
130 | BOOL bInitialOwner, |
131 | LPCTSTR lpName) |
132 | { |
133 | return original_IEE->ClrCreateMutex(lpMutexAttributes, bInitialOwner, lpName); |
134 | } |
135 | void STDMETHODCALLTYPE interceptor_IEE::ClrCloseMutex(MUTEX_COOKIE mutex) |
136 | { |
137 | original_IEE->ClrCloseMutex(mutex); |
138 | } |
139 | BOOL STDMETHODCALLTYPE interceptor_IEE::ClrReleaseMutex(MUTEX_COOKIE mutex) |
140 | { |
141 | return original_IEE->ClrReleaseMutex(mutex); |
142 | } |
143 | DWORD STDMETHODCALLTYPE interceptor_IEE::ClrWaitForMutex(MUTEX_COOKIE mutex, DWORD dwMilliseconds, BOOL bAlertable) |
144 | { |
145 | return original_IEE->ClrWaitForMutex(mutex, dwMilliseconds, bAlertable); |
146 | } |
147 | |
148 | DWORD STDMETHODCALLTYPE interceptor_IEE::ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable) |
149 | { |
150 | return original_IEE->ClrSleepEx(dwMilliseconds, bAlertable); |
151 | } |
152 | BOOL STDMETHODCALLTYPE interceptor_IEE::ClrAllocationDisallowed() |
153 | { |
154 | return original_IEE->ClrAllocationDisallowed(); |
155 | } |
156 | void STDMETHODCALLTYPE interceptor_IEE::GetLastThrownObjectExceptionFromThread(void** ppvException) |
157 | { |
158 | original_IEE->GetLastThrownObjectExceptionFromThread(ppvException); |
159 | } |
160 | |