microsoft/mu_tiano_platforms
Publicmirrored fromhttps://github.com/microsoft/mu_tiano_platformsAvailable
UefiDbgExt/dbgexts.h
64lines · modecode
| 1 | /*++ |
| 2 | |
| 3 | Copyright (c) Microsoft Corporation |
| 4 | |
| 5 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 6 | |
| 7 | Module Name: |
| 8 | |
| 9 | dbgexts.h |
| 10 | |
| 11 | --*/ |
| 12 | |
| 13 | #include <windows.h> |
| 14 | #include <stdio.h> |
| 15 | #include <stdlib.h> |
| 16 | #include <string.h> |
| 17 | |
| 18 | // |
| 19 | // Define KDEXT_64BIT to make all wdbgexts APIs recognize 64 bit addresses |
| 20 | // It is recommended for extensions to use 64 bit headers from wdbgexts so |
| 21 | // the extensions could support 64 bit targets. |
| 22 | // |
| 23 | #define KDEXT_64BIT |
| 24 | #include <wdbgexts.h> |
| 25 | #include <dbgeng.h> |
| 26 | |
| 27 | #pragma warning(disable:4201) // nonstandard extension used : nameless struct |
| 28 | #include <extsfns.h> |
| 29 | |
| 30 | #ifdef __cplusplus |
| 31 | extern "C" { |
| 32 | #endif |
| 33 | |
| 34 | |
| 35 | #define INIT_API() \ |
| 36 | HRESULT Status; \ |
| 37 | if ((Status = ExtQuery(Client)) != S_OK) return Status; |
| 38 | |
| 39 | #define EXT_RELEASE(Unk) \ |
| 40 | ((Unk) != NULL ? ((Unk)->Release(), (Unk) = NULL) : NULL) |
| 41 | |
| 42 | #define EXIT_API ExtRelease |
| 43 | |
| 44 | |
| 45 | // Global variables initialized by query. |
| 46 | extern PDEBUG_CLIENT4 g_ExtClient; |
| 47 | extern PDEBUG_CONTROL g_ExtControl; |
| 48 | extern PDEBUG_SYMBOLS2 g_ExtSymbols; |
| 49 | |
| 50 | extern BOOL Connected; |
| 51 | extern ULONG TargetMachine; |
| 52 | |
| 53 | HRESULT |
| 54 | ExtQuery(PDEBUG_CLIENT4 Client); |
| 55 | |
| 56 | void |
| 57 | ExtRelease(void); |
| 58 | |
| 59 | HRESULT |
| 60 | NotifyOnTargetAccessible(PDEBUG_CONTROL Control); |
| 61 | |
| 62 | #ifdef __cplusplus |
| 63 | } |
| 64 | #endif |
| 65 | |