Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. ntsdextp.h
  5. Abstract:
  6. Common header file for NTSDEXTS component source files.
  7. Author:
  8. Steve Wood (stevewo) 21-Feb-1995
  9. Revision History:
  10. --*/
  11. #include <ntos.h>
  12. #include <ntrtl.h>
  13. #include <nturtl.h>
  14. #include <windows.h>
  15. #include <ntsdexts.h>
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include <wchar.h>
  20. #include <heap.h>
  21. #include <atom.h>
  22. #include <stktrace.h>
  23. #include <winsock2.h>
  24. #include <ntcsrsrv.h>
  25. #include "unasm.h"
  26. #define move(dst, src)\
  27. try {\
  28. ReadMemory((LPVOID) (src), &(dst), sizeof(dst), NULL);\
  29. } except (EXCEPTION_EXECUTE_HANDLER) {\
  30. return;\
  31. }
  32. #define moveBlock(dst, src, size)\
  33. try {\
  34. ReadMemory((LPVOID) (src), &(dst), (size), NULL);\
  35. } except (EXCEPTION_EXECUTE_HANDLER) {\
  36. return;\
  37. }
  38. #ifdef __cplusplus
  39. #define CPPMOD extern "C"
  40. #else
  41. #define CPPMOD
  42. #endif
  43. #define DECLARE_API(s) \
  44. CPPMOD VOID \
  45. s( \
  46. HANDLE hCurrentProcess, \
  47. HANDLE hCurrentThread, \
  48. DWORD dwCurrentPc, \
  49. PNTSD_EXTENSION_APIS lpExtensionApis, \
  50. LPSTR lpArgumentString \
  51. )
  52. #define INIT_API() { \
  53. ExtensionApis = *lpExtensionApis; \
  54. ExtensionCurrentProcess = hCurrentProcess; \
  55. }
  56. #define dprintf (ExtensionApis.lpOutputRoutine)
  57. #define GetExpression (ExtensionApis.lpGetExpressionRoutine)
  58. #define GetSymbol (ExtensionApis.lpGetSymbolRoutine)
  59. #define Disassm (ExtensionApis.lpDisasmRoutine)
  60. #define CheckControlC (ExtensionApis.lpCheckControlCRoutine)
  61. #define ReadMemory(a,b,c,d) ReadProcessMemory( ExtensionCurrentProcess, (LPCVOID)(a), (b), (c), (d) )
  62. #define WriteMemory(a,b,c,d) WriteProcessMemory( ExtensionCurrentProcess, (LPVOID)(a), (LPVOID)(b), (c), (d) )
  63. #ifndef malloc
  64. #define malloc( n ) HeapAlloc( GetProcessHeap(), 0, (n) )
  65. #endif
  66. #ifndef free
  67. #define free( p ) HeapFree( GetProcessHeap(), 0, (p) )
  68. #endif
  69. extern NTSD_EXTENSION_APIS ExtensionApis;
  70. extern HANDLE ExtensionCurrentProcess;