| OLD | NEW |
| 1 // Copyright 2013 Google Inc. All Rights Reserved. | 1 // Copyright 2013 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 std::string old_asan_options_env_; | 136 std::string old_asan_options_env_; |
| 137 | 137 |
| 138 // Redirection files for the logger. | 138 // Redirection files for the logger. |
| 139 base::ScopedFILE logger_stdin_file_; | 139 base::ScopedFILE logger_stdin_file_; |
| 140 base::ScopedFILE logger_stdout_file_; | 140 base::ScopedFILE logger_stdout_file_; |
| 141 base::ScopedFILE logger_stderr_file_; | 141 base::ScopedFILE logger_stderr_file_; |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 // Shorthand for discussing all the asan runtime functions. | 144 // Shorthand for discussing all the asan runtime functions. |
| 145 #ifndef _WIN64 | 145 #ifndef _WIN64 |
| 146 #define ASAN_RTL_FUNCTIONS(F) \ | 146 #define ASAN_RTL_FUNCTIONS(F) \ |
| 147 F(WINAPI, HANDLE, GetProcessHeap, (), ()) \ | 147 F(WINAPI, HANDLE, GetProcessHeap, (), ()) \ |
| 148 F(WINAPI, HANDLE, HeapCreate, \ | 148 F(WINAPI, HANDLE, HeapCreate, \ |
| 149 (DWORD options, SIZE_T initial_size, SIZE_T maximum_size), \ | 149 (DWORD options, SIZE_T initial_size, SIZE_T maximum_size), \ |
| 150 (options, initial_size, maximum_size)) \ | 150 (options, initial_size, maximum_size)) \ |
| 151 F(WINAPI, BOOL, HeapDestroy, \ | 151 F(WINAPI, BOOL, HeapDestroy, (HANDLE heap), (heap)) \ |
| 152 (HANDLE heap), (heap)) \ | 152 F(WINAPI, LPVOID, HeapAlloc, (HANDLE heap, DWORD flags, SIZE_T bytes), \ |
| 153 F(WINAPI, LPVOID, HeapAlloc, \ | 153 (heap, flags, bytes)) \ |
| 154 (HANDLE heap, DWORD flags, SIZE_T bytes), (heap, flags, bytes)) \ | 154 F(WINAPI, LPVOID, HeapReAlloc, \ |
| 155 F(WINAPI, LPVOID, HeapReAlloc, \ | 155 (HANDLE heap, DWORD flags, LPVOID mem, SIZE_T bytes), \ |
| 156 (HANDLE heap, DWORD flags, LPVOID mem, SIZE_T bytes), \ | 156 (heap, flags, mem, bytes)) \ |
| 157 (heap, flags, mem, bytes)) \ | 157 F(WINAPI, BOOL, HeapFree, (HANDLE heap, DWORD flags, LPVOID mem), \ |
| 158 F(WINAPI, BOOL, HeapFree, \ | 158 (heap, flags, mem)) \ |
| 159 (HANDLE heap, DWORD flags, LPVOID mem), (heap, flags, mem)) \ | 159 F(WINAPI, SIZE_T, HeapSize, (HANDLE heap, DWORD flags, LPCVOID mem), \ |
| 160 F(WINAPI, SIZE_T, HeapSize, \ | 160 (heap, flags, mem)) \ |
| 161 (HANDLE heap, DWORD flags, LPCVOID mem), (heap, flags, mem)) \ | 161 F(WINAPI, BOOL, HeapValidate, (HANDLE heap, DWORD flags, LPCVOID mem), \ |
| 162 F(WINAPI, BOOL, HeapValidate, \ | 162 (heap, flags, mem)) \ |
| 163 (HANDLE heap, DWORD flags, LPCVOID mem), (heap, flags, mem)) \ | 163 F(WINAPI, SIZE_T, HeapCompact, (HANDLE heap, DWORD flags), (heap, flags)) \ |
| 164 F(WINAPI, SIZE_T, HeapCompact, \ | 164 F(WINAPI, BOOL, HeapLock, (HANDLE heap), (heap)) \ |
| 165 (HANDLE heap, DWORD flags), (heap, flags)) \ | 165 F(WINAPI, BOOL, HeapUnlock, (HANDLE heap), (heap)) \ |
| 166 F(WINAPI, BOOL, HeapLock, (HANDLE heap), (heap)) \ | 166 F(WINAPI, BOOL, HeapWalk, (HANDLE heap, LPPROCESS_HEAP_ENTRY entry), \ |
| 167 F(WINAPI, BOOL, HeapUnlock, (HANDLE heap), (heap)) \ | 167 (heap, entry)) \ |
| 168 F(WINAPI, BOOL, HeapWalk, \ | 168 F(WINAPI, BOOL, HeapSetInformation, \ |
| 169 (HANDLE heap, LPPROCESS_HEAP_ENTRY entry), (heap, entry)) \ | 169 (HANDLE heap, HEAP_INFORMATION_CLASS info_class, PVOID info, \ |
| 170 F(WINAPI, BOOL, HeapSetInformation, \ | 170 SIZE_T info_length), \ |
| 171 (HANDLE heap, HEAP_INFORMATION_CLASS info_class, \ | 171 (heap, info_class, info, info_length)) \ |
| 172 PVOID info, SIZE_T info_length), \ | 172 F(WINAPI, BOOL, HeapQueryInformation, \ |
| 173 (heap, info_class, info, info_length)) \ | 173 (HANDLE heap, HEAP_INFORMATION_CLASS info_class, PVOID info, \ |
| 174 F(WINAPI, BOOL, HeapQueryInformation, \ | 174 SIZE_T info_length, PSIZE_T return_length), \ |
| 175 (HANDLE heap, HEAP_INFORMATION_CLASS info_class, \ | 175 (heap, info_class, info, info_length, return_length)) \ |
| 176 PVOID info, SIZE_T info_length, PSIZE_T return_length), \ | 176 F(WINAPI, void, SetCallBack, (void (*callback)(AsanErrorInfo * error_info)), \ |
| 177 (heap, info_class, info, info_length, return_length)) \ | 177 (callback)) \ |
| 178 F(WINAPI, void, SetCallBack, \ | 178 F(_cdecl, void*, memcpy, \ |
| 179 (void (*callback)(AsanErrorInfo* error_info)), \ | 179 (void* destination, const void* source, size_t num), \ |
| 180 (callback)) \ | 180 (destination, source, num)) \ |
| 181 F(_cdecl, void*, memcpy, \ | 181 F(_cdecl, void*, memmove, \ |
| 182 (void* destination, const void* source, size_t num), \ | 182 (void* destination, const void* source, size_t num), \ |
| 183 (destination, source, num)) \ | 183 (destination, source, num)) \ |
| 184 F(_cdecl, void*, memmove, \ | 184 F(_cdecl, void*, memset, (void* ptr, int value, size_t num), \ |
| 185 (void* destination, const void* source, size_t num), \ | 185 (ptr, value, num)) \ |
| 186 (destination, source, num)) \ | 186 F(_cdecl, const void*, memchr, (const void* ptr, int value, size_t num), \ |
| 187 F(_cdecl, void*, memset, (void* ptr, int value, size_t num), \ | 187 (ptr, value, num)) \ |
| 188 (ptr, value, num)) \ | 188 F(_cdecl, size_t, strcspn, (const char* str1, const char* str2), \ |
| 189 F(_cdecl, const void*, memchr, (const void* ptr, int value, size_t num), \ | 189 (str1, str2)) \ |
| 190 (ptr, value, num)) \ | 190 F(_cdecl, size_t, strlen, (const char* str), (str)) \ |
| 191 F(_cdecl, size_t, strcspn, (const char* str1, const char* str2), \ | 191 F(_cdecl, size_t, strnlen, (const char* str, size_t max_len), \ |
| 192 (str1, str2)) \ | 192 (str, max_len)) \ |
| 193 F(_cdecl, size_t, strlen, (const char* str), (str)) \ | 193 F(_cdecl, const char*, strrchr, (const char* str, int character), \ |
| 194 F(_cdecl, size_t, strnlen, (const char* str, size_t max_len), \ | 194 (str, character)) \ |
| 195 (str, max_len)) \ | 195 F(_cdecl, const wchar_t*, wcsrchr, (const wchar_t* str, int character), \ |
| 196 F(_cdecl, const char*, strrchr, (const char* str, int character), \ | 196 (str, character)) \ |
| 197 (str, character)) \ | 197 F(_cdecl, const wchar_t*, wcschr, (const wchar_t* str, int character), \ |
| 198 F(_cdecl, const wchar_t*, wcsrchr, (const wchar_t* str, int character), \ | 198 (str, character)) \ |
| 199 (str, character)) \ | 199 F(_cdecl, int, strcmp, (const char* str1, const char* str2), (str1, str2)) \ |
| 200 F(_cdecl, const wchar_t*, wcschr, (const wchar_t* str, int character), \ | 200 F(_cdecl, const char*, strpbrk, (const char* str1, const char* str2), \ |
| 201 (str, character)) \ | 201 (str1, str2)) \ |
| 202 F(_cdecl, int, strcmp, (const char* str1, const char* str2), \ | 202 F(_cdecl, const char*, strstr, (const char* str1, const char* str2), \ |
| 203 (str1, str2)) \ | 203 (str1, str2)) \ |
| 204 F(_cdecl, const char*, strpbrk, (const char* str1, const char* str2), \ | 204 F(_cdecl, size_t, wcsnlen, (const wchar_t* str, size_t max_len), \ |
| 205 (str1, str2)) \ | 205 (str, max_len)) \ |
| 206 F(_cdecl, const char*, strstr, (const char* str1, const char* str2), \ | 206 F(_cdecl, const wchar_t*, wcsstr, \ |
| 207 (str1, str2)) \ | 207 (const wchar_t* str1, const wchar_t* str2), (str1, str2)) \ |
| 208 F(_cdecl, size_t, wcsnlen, (const wchar_t* str, size_t max_len), \ | 208 F(_cdecl, size_t, strspn, (const char* str1, const char* str2), \ |
| 209 (str, max_len)) \ | 209 (str1, str2)) \ |
| 210 F(_cdecl, const wchar_t*, wcsstr, (const wchar_t* str1, \ | 210 F(_cdecl, char*, strncpy, \ |
| 211 const wchar_t* str2), (str1, str2)) \ | 211 (char* destination, const char* source, size_t num), \ |
| 212 F(_cdecl, size_t, strspn, (const char* str1, const char* str2), \ | 212 (destination, source, num)) \ |
| 213 (str1, str2)) \ | 213 F(_cdecl, char*, strncat, \ |
| 214 F(_cdecl, char*, strncpy, \ | 214 (char* destination, const char* source, size_t num), \ |
| 215 (char* destination, const char* source, size_t num), \ | 215 (destination, source, num)) \ |
| 216 (destination, source, num)) \ | 216 F(WINAPI, BOOL, ReadFile, \ |
| 217 F(_cdecl, char*, strncat, \ | 217 (HANDLE file_handle, LPVOID buffer, DWORD bytes_to_read, \ |
| 218 (char* destination, const char* source, size_t num), \ | 218 LPDWORD bytes_read, LPOVERLAPPED overlapped), \ |
| 219 (destination, source, num)) \ | 219 (file_handle, buffer, bytes_to_read, bytes_read, overlapped)) \ |
| 220 F(WINAPI, BOOL, ReadFile, \ | 220 F(WINAPI, BOOL, WriteFile, \ |
| 221 (HANDLE file_handle, LPVOID buffer, DWORD bytes_to_read, \ | 221 (HANDLE file_handle, LPCVOID buffer, DWORD bytes_to_write, \ |
| 222 LPDWORD bytes_read, LPOVERLAPPED overlapped), \ | 222 LPDWORD bytes_written, LPOVERLAPPED overlapped), \ |
| 223 (file_handle, buffer, bytes_to_read, bytes_read, overlapped)) \ | 223 (file_handle, buffer, bytes_to_write, bytes_written, overlapped)) \ |
| 224 F(WINAPI, BOOL, WriteFile, \ | 224 F(_cdecl, void, SetInterceptorCallback, (void (*callback)()), (callback)) \ |
| 225 (HANDLE file_handle, LPCVOID buffer, DWORD bytes_to_write, \ | 225 F(WINAPI, agent::asan::AsanRuntime*, GetActiveRuntime, (), ()) \ |
| 226 LPDWORD bytes_written, LPOVERLAPPED overlapped), \ | 226 F(WINAPI, void, InitializeCrashReporter, (), ()) \ |
| 227 (file_handle, buffer, bytes_to_write, bytes_written, overlapped)) \ | 227 F(WINAPI, void, SetAllocationFilterFlag, (), ()) \ |
| 228 F(_cdecl, void, SetInterceptorCallback, (void (*callback)()), (callback)) \ | 228 F(WINAPI, void, ClearAllocationFilterFlag, (), ()) |
| 229 F(WINAPI, agent::asan::AsanRuntime*, GetActiveRuntime, (), ()) \ | |
| 230 F(WINAPI, void, SetAllocationFilterFlag, (), ()) \ | |
| 231 F(WINAPI, void, ClearAllocationFilterFlag, (), ()) | |
| 232 #else | 229 #else |
| 233 // A copy of the previous block minus {Set,Clear}AllocationFilterFlag functions, | 230 // A copy of the previous block minus {Set,Clear}AllocationFilterFlag functions, |
| 234 // as they're not implemented on win64. | 231 // as they're not implemented on win64. |
| 235 // TODO: remove this once {Set,Clear}AllocationFilterFlag are implemented. | 232 // TODO: remove this once {Set,Clear}AllocationFilterFlag are implemented. |
| 236 #define ASAN_RTL_FUNCTIONS(F) \ | 233 #define ASAN_RTL_FUNCTIONS(F) \ |
| 237 F(WINAPI, HANDLE, GetProcessHeap, (), ()) \ | 234 F(WINAPI, HANDLE, GetProcessHeap, (), ()) \ |
| 238 F(WINAPI, HANDLE, HeapCreate, \ | 235 F(WINAPI, HANDLE, HeapCreate, \ |
| 239 (DWORD options, SIZE_T initial_size, SIZE_T maximum_size), \ | 236 (DWORD options, SIZE_T initial_size, SIZE_T maximum_size), \ |
| 240 (options, initial_size, maximum_size)) \ | 237 (options, initial_size, maximum_size)) \ |
| 241 F(WINAPI, BOOL, HeapDestroy, \ | 238 F(WINAPI, BOOL, HeapDestroy, (HANDLE heap), (heap)) \ |
| 242 (HANDLE heap), (heap)) \ | 239 F(WINAPI, LPVOID, HeapAlloc, (HANDLE heap, DWORD flags, SIZE_T bytes), \ |
| 243 F(WINAPI, LPVOID, HeapAlloc, \ | 240 (heap, flags, bytes)) \ |
| 244 (HANDLE heap, DWORD flags, SIZE_T bytes), (heap, flags, bytes)) \ | 241 F(WINAPI, LPVOID, HeapReAlloc, \ |
| 245 F(WINAPI, LPVOID, HeapReAlloc, \ | 242 (HANDLE heap, DWORD flags, LPVOID mem, SIZE_T bytes), \ |
| 246 (HANDLE heap, DWORD flags, LPVOID mem, SIZE_T bytes), \ | 243 (heap, flags, mem, bytes)) \ |
| 247 (heap, flags, mem, bytes)) \ | 244 F(WINAPI, BOOL, HeapFree, (HANDLE heap, DWORD flags, LPVOID mem), \ |
| 248 F(WINAPI, BOOL, HeapFree, \ | 245 (heap, flags, mem)) \ |
| 249 (HANDLE heap, DWORD flags, LPVOID mem), (heap, flags, mem)) \ | 246 F(WINAPI, SIZE_T, HeapSize, (HANDLE heap, DWORD flags, LPCVOID mem), \ |
| 250 F(WINAPI, SIZE_T, HeapSize, \ | 247 (heap, flags, mem)) \ |
| 251 (HANDLE heap, DWORD flags, LPCVOID mem), (heap, flags, mem)) \ | 248 F(WINAPI, BOOL, HeapValidate, (HANDLE heap, DWORD flags, LPCVOID mem), \ |
| 252 F(WINAPI, BOOL, HeapValidate, \ | 249 (heap, flags, mem)) \ |
| 253 (HANDLE heap, DWORD flags, LPCVOID mem), (heap, flags, mem)) \ | 250 F(WINAPI, SIZE_T, HeapCompact, (HANDLE heap, DWORD flags), (heap, flags)) \ |
| 254 F(WINAPI, SIZE_T, HeapCompact, \ | 251 F(WINAPI, BOOL, HeapLock, (HANDLE heap), (heap)) \ |
| 255 (HANDLE heap, DWORD flags), (heap, flags)) \ | 252 F(WINAPI, BOOL, HeapUnlock, (HANDLE heap), (heap)) \ |
| 256 F(WINAPI, BOOL, HeapLock, (HANDLE heap), (heap)) \ | 253 F(WINAPI, BOOL, HeapWalk, (HANDLE heap, LPPROCESS_HEAP_ENTRY entry), \ |
| 257 F(WINAPI, BOOL, HeapUnlock, (HANDLE heap), (heap)) \ | 254 (heap, entry)) \ |
| 258 F(WINAPI, BOOL, HeapWalk, \ | 255 F(WINAPI, BOOL, HeapSetInformation, \ |
| 259 (HANDLE heap, LPPROCESS_HEAP_ENTRY entry), (heap, entry)) \ | 256 (HANDLE heap, HEAP_INFORMATION_CLASS info_class, PVOID info, \ |
| 260 F(WINAPI, BOOL, HeapSetInformation, \ | 257 SIZE_T info_length), \ |
| 261 (HANDLE heap, HEAP_INFORMATION_CLASS info_class, \ | 258 (heap, info_class, info, info_length)) \ |
| 262 PVOID info, SIZE_T info_length), \ | 259 F(WINAPI, BOOL, HeapQueryInformation, \ |
| 263 (heap, info_class, info, info_length)) \ | 260 (HANDLE heap, HEAP_INFORMATION_CLASS info_class, PVOID info, \ |
| 264 F(WINAPI, BOOL, HeapQueryInformation, \ | 261 SIZE_T info_length, PSIZE_T return_length), \ |
| 265 (HANDLE heap, HEAP_INFORMATION_CLASS info_class, \ | 262 (heap, info_class, info, info_length, return_length)) \ |
| 266 PVOID info, SIZE_T info_length, PSIZE_T return_length), \ | 263 F(WINAPI, void, SetCallBack, (void (*callback)(AsanErrorInfo * error_info)), \ |
| 267 (heap, info_class, info, info_length, return_length)) \ | 264 (callback)) \ |
| 268 F(WINAPI, void, SetCallBack, \ | 265 F(_cdecl, void*, memcpy, \ |
| 269 (void (*callback)(AsanErrorInfo* error_info)), \ | 266 (void* destination, const void* source, size_t num), \ |
| 270 (callback)) \ | 267 (destination, source, num)) \ |
| 271 F(_cdecl, void*, memcpy, \ | 268 F(_cdecl, void*, memmove, \ |
| 272 (void* destination, const void* source, size_t num), \ | 269 (void* destination, const void* source, size_t num), \ |
| 273 (destination, source, num)) \ | 270 (destination, source, num)) \ |
| 274 F(_cdecl, void*, memmove, \ | 271 F(_cdecl, void*, memset, (void* ptr, int value, size_t num), \ |
| 275 (void* destination, const void* source, size_t num), \ | 272 (ptr, value, num)) \ |
| 276 (destination, source, num)) \ | 273 F(_cdecl, const void*, memchr, (const void* ptr, int value, size_t num), \ |
| 277 F(_cdecl, void*, memset, (void* ptr, int value, size_t num), \ | 274 (ptr, value, num)) \ |
| 278 (ptr, value, num)) \ | 275 F(_cdecl, size_t, strcspn, (const char* str1, const char* str2), \ |
| 279 F(_cdecl, const void*, memchr, (const void* ptr, int value, size_t num), \ | 276 (str1, str2)) \ |
| 280 (ptr, value, num)) \ | 277 F(_cdecl, size_t, strlen, (const char* str), (str)) \ |
| 281 F(_cdecl, size_t, strcspn, (const char* str1, const char* str2), \ | 278 F(_cdecl, size_t, strnlen, (const char* str, size_t max_len), \ |
| 282 (str1, str2)) \ | 279 (str, max_len)) \ |
| 283 F(_cdecl, size_t, strlen, (const char* str), (str)) \ | 280 F(_cdecl, const char*, strrchr, (const char* str, int character), \ |
| 284 F(_cdecl, size_t, strnlen, (const char* str, size_t max_len), \ | 281 (str, character)) \ |
| 285 (str, max_len)) \ | 282 F(_cdecl, const wchar_t*, wcsrchr, (const wchar_t* str, int character), \ |
| 286 F(_cdecl, const char*, strrchr, (const char* str, int character), \ | 283 (str, character)) \ |
| 287 (str, character)) \ | 284 F(_cdecl, const wchar_t*, wcschr, (const wchar_t* str, int character), \ |
| 288 F(_cdecl, const wchar_t*, wcsrchr, (const wchar_t* str, int character), \ | 285 (str, character)) \ |
| 289 (str, character)) \ | 286 F(_cdecl, int, strcmp, (const char* str1, const char* str2), (str1, str2)) \ |
| 290 F(_cdecl, const wchar_t*, wcschr, (const wchar_t* str, int character), \ | 287 F(_cdecl, const char*, strpbrk, (const char* str1, const char* str2), \ |
| 291 (str, character)) \ | 288 (str1, str2)) \ |
| 292 F(_cdecl, int, strcmp, (const char* str1, const char* str2), \ | 289 F(_cdecl, const char*, strstr, (const char* str1, const char* str2), \ |
| 293 (str1, str2)) \ | 290 (str1, str2)) \ |
| 294 F(_cdecl, const char*, strpbrk, (const char* str1, const char* str2), \ | 291 F(_cdecl, size_t, wcsnlen, (const wchar_t* str, size_t max_len), \ |
| 295 (str1, str2)) \ | 292 (str, max_len)) \ |
| 296 F(_cdecl, const char*, strstr, (const char* str1, const char* str2), \ | 293 F(_cdecl, const wchar_t*, wcsstr, \ |
| 297 (str1, str2)) \ | 294 (const wchar_t* str1, const wchar_t* str2), (str1, str2)) \ |
| 298 F(_cdecl, size_t, wcsnlen, (const wchar_t* str, size_t max_len), \ | 295 F(_cdecl, size_t, strspn, (const char* str1, const char* str2), \ |
| 299 (str, max_len)) \ | 296 (str1, str2)) \ |
| 300 F(_cdecl, const wchar_t*, wcsstr, (const wchar_t* str1, \ | 297 F(_cdecl, char*, strncpy, \ |
| 301 const wchar_t* str2), (str1, str2)) \ | 298 (char* destination, const char* source, size_t num), \ |
| 302 F(_cdecl, size_t, strspn, (const char* str1, const char* str2), \ | 299 (destination, source, num)) \ |
| 303 (str1, str2)) \ | 300 F(_cdecl, char*, strncat, \ |
| 304 F(_cdecl, char*, strncpy, \ | 301 (char* destination, const char* source, size_t num), \ |
| 305 (char* destination, const char* source, size_t num), \ | 302 (destination, source, num)) \ |
| 306 (destination, source, num)) \ | 303 F(WINAPI, BOOL, ReadFile, \ |
| 307 F(_cdecl, char*, strncat, \ | 304 (HANDLE file_handle, LPVOID buffer, DWORD bytes_to_read, \ |
| 308 (char* destination, const char* source, size_t num), \ | 305 LPDWORD bytes_read, LPOVERLAPPED overlapped), \ |
| 309 (destination, source, num)) \ | 306 (file_handle, buffer, bytes_to_read, bytes_read, overlapped)) \ |
| 310 F(WINAPI, BOOL, ReadFile, \ | 307 F(WINAPI, BOOL, WriteFile, \ |
| 311 (HANDLE file_handle, LPVOID buffer, DWORD bytes_to_read, \ | 308 (HANDLE file_handle, LPCVOID buffer, DWORD bytes_to_write, \ |
| 312 LPDWORD bytes_read, LPOVERLAPPED overlapped), \ | 309 LPDWORD bytes_written, LPOVERLAPPED overlapped), \ |
| 313 (file_handle, buffer, bytes_to_read, bytes_read, overlapped)) \ | 310 (file_handle, buffer, bytes_to_write, bytes_written, overlapped)) \ |
| 314 F(WINAPI, BOOL, WriteFile, \ | 311 F(_cdecl, void, SetInterceptorCallback, (void (*callback)()), (callback)) \ |
| 315 (HANDLE file_handle, LPCVOID buffer, DWORD bytes_to_write, \ | 312 F(WINAPI, agent::asan::AsanRuntime*, GetActiveRuntime, (), ()) \ |
| 316 LPDWORD bytes_written, LPOVERLAPPED overlapped), \ | 313 F(WINAPI, void, InitializeCrashReporter, (), ()) |
| 317 (file_handle, buffer, bytes_to_write, bytes_written, overlapped)) \ | |
| 318 F(_cdecl, void, SetInterceptorCallback, (void (*callback)()), (callback)) \ | |
| 319 F(WINAPI, agent::asan::AsanRuntime*, GetActiveRuntime, (), ()) | |
| 320 #endif | 314 #endif |
| 321 | 315 |
| 322 // Declare pointer types for the intercepted functions. | 316 // Declare pointer types for the intercepted functions. |
| 323 #define DECLARE_ASAN_FUNCTION_PTR(convention, ret, name, args, argnames) \ | 317 #define DECLARE_ASAN_FUNCTION_PTR(convention, ret, name, args, argnames) \ |
| 324 typedef ret (convention* name##FunctionPtr)args; | 318 typedef ret (convention* name##FunctionPtr)args; |
| 325 ASAN_RTL_FUNCTIONS(DECLARE_ASAN_FUNCTION_PTR) | 319 ASAN_RTL_FUNCTIONS(DECLARE_ASAN_FUNCTION_PTR) |
| 326 #undef DECLARE_ASAN_FUNCTION_PTR | 320 #undef DECLARE_ASAN_FUNCTION_PTR |
| 327 | 321 |
| 328 class TestAsanRtl : public testing::TestWithAsanLogger { | 322 class TestAsanRtl : public testing::TestWithAsanLogger { |
| 329 public: | 323 public: |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 void ClearIntersection(const void* addr, size_t size); | 938 void ClearIntersection(const void* addr, size_t size); |
| 945 | 939 |
| 946 // An alternative view of shadow memory. Accessible regions are not | 940 // An alternative view of shadow memory. Accessible regions are not |
| 947 // displayed. Neighboring regions of the same type are merged. | 941 // displayed. Neighboring regions of the same type are merged. |
| 948 ShadowAddressSpace shadow_address_space_; | 942 ShadowAddressSpace shadow_address_space_; |
| 949 }; | 943 }; |
| 950 | 944 |
| 951 } // namespace testing | 945 } // namespace testing |
| 952 | 946 |
| 953 #endif // SYZYGY_AGENT_ASAN_UNITTEST_UTIL_H_ | 947 #endif // SYZYGY_AGENT_ASAN_UNITTEST_UTIL_H_ |
| OLD | NEW |