123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- /*++
- Copyright (c) 2012 Minoca Corp. All Rights Reserved
- Module Name:
- extsp.h
- Abstract:
- This header contains private definitions for debugger extension support.
- Author:
- Evan Green 10-Sep-2012
- --*/
- //
- // ------------------------------------------------------------------- Includes
- //
- //
- // ---------------------------------------------------------------- Definitions
- //
- #define MALLOC(_x) malloc(_x)
- #define FREE(_x) free(_x)
- //
- // ------------------------------------------------------ Data Type Definitions
- //
- //
- // -------------------------------------------------------------------- Globals
- //
- //
- // -------------------------------------------------------- Function Prototypes
- //
- INT
- DbgInitializeExtensions (
- PDEBUGGER_CONTEXT Context
- );
- /*++
- Routine Description:
- This routine initializes support for debugger extensions and loads any
- extensions supplied on the command line.
- Arguments:
- Context - Supplies a pointer to the application context.
- Return Value:
- 0 on success.
- Returns an error code on failure.
- --*/
- INT
- DbgLoadExtension (
- PDEBUGGER_CONTEXT Context,
- PSTR BinaryName
- );
- /*++
- Routine Description:
- This routine loads a debugger extension library.
- Arguments:
- Context - Supplies a pointer to the application context.
- BinaryName - Supplies the path to the binary to load.
- Return Value:
- 0 on success.
- Returns an error code on failure.
- --*/
- VOID
- DbgUnloadExtension (
- PDEBUGGER_CONTEXT Context,
- PSTR BinaryName
- );
- /*++
- Routine Description:
- This routine unloads and frees a debugger extension library.
- Arguments:
- Context - Supplies a pointer to the application context.
- BinaryName - Supplies the path to the binary to unload.
- Return Value:
- None.
- --*/
- VOID
- DbgUnloadAllExtensions (
- PDEBUGGER_CONTEXT Context
- );
- /*++
- Routine Description:
- This routine unloads all debugger extensions.
- Arguments:
- Context - Supplies a pointer to the application context.
- Return Value:
- None.
- --*/
- INT
- DbgDispatchExtension (
- PDEBUGGER_CONTEXT Context,
- PSTR *Arguments,
- ULONG ArgumentCount
- );
- /*++
- Routine Description:
- This routine dispatches a debugger extension command.
- Arguments:
- Context - Supplies a pointer to the application context.
- Arguments - Supplies an array of strings containing the arguments. The
- first argument is the command itself.
- ArgumentCount - Supplies the count of arguments. This is always at least
- one.
- Return Value:
- 0 on success.
- Returns an error code on failure.
- --*/
- ULONG
- DbgLoadLibrary (
- PSTR BinaryName
- );
- /*++
- Routine Description:
- This routine loads a shared library.
- Arguments:
- BinaryName - Supplies the name of the binary to load.
- Return Value:
- Returns a non-zero handle on success.
- 0 on failure.
- --*/
- VOID
- DbgFreeLibrary (
- ULONG Handle
- );
- /*++
- Routine Description:
- This routine unloads a shared library.
- Arguments:
- Handle - Supplies the handle to to the loaded library.
- Return Value:
- None.
- --*/
- PVOID
- DbgGetProcedureAddress (
- ULONG Handle,
- PSTR ProcedureName
- );
- /*++
- Routine Description:
- This routine gets the address of a routine in a loaded shared library (DLL).
- Arguments:
- Handle - Supplies the handle to to the loaded library.
- ProcedureName - Supplies the name of the procedure to look up.
- Return Value:
- Returns a pointer to the procedure on success.
- NULL on failure.
- --*/
|