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.

87 lines
2.2 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. #if 0
  12. #include <nt.h>
  13. #include <ntrtl.h>
  14. #include <nturtl.h>
  15. #include <windows.h>
  16. #include <winsock.h>
  17. #include <ntsdexts.h>
  18. #include <stdio.h>
  19. #include <string.h>
  20. #include <wchar.h>
  21. #endif
  22. #define move(dst, src)\
  23. __try {\
  24. ReadMemory((LPVOID) (src), &(dst), sizeof(dst), NULL);\
  25. } __except (EXCEPTION_EXECUTE_HANDLER) {\
  26. return;\
  27. }
  28. #define moveBlock(dst, src, size)\
  29. __try {\
  30. ReadMemory((LPVOID) (src), &(dst), (size), NULL);\
  31. } __except (EXCEPTION_EXECUTE_HANDLER) {\
  32. return;\
  33. }
  34. #ifdef __cplusplus
  35. #define CPPMOD extern "C"
  36. #else
  37. #define CPPMOD
  38. #endif
  39. #define DECLARE_API(s) \
  40. CPPMOD VOID \
  41. s( \
  42. HANDLE hCurrentProcess, \
  43. HANDLE hCurrentThread, \
  44. DWORD dwCurrentPc, \
  45. PNTSD_EXTENSION_APIS lpExtensionApis, \
  46. LPSTR lpArgumentString \
  47. )
  48. #define INIT_API() { \
  49. ExtensionApis = *lpExtensionApis; \
  50. ExtensionCurrentProcess = hCurrentProcess; \
  51. }
  52. #define dprintf (ExtensionApis.lpOutputRoutine)
  53. #define GetExpression (ExtensionApis.lpGetExpressionRoutine)
  54. #define GetSymbol (ExtensionApis.lpGetSymbolRoutine)
  55. #define Disassm (ExtensionApis.lpDisasmRoutine)
  56. #define CheckControlC (ExtensionApis.lpCheckControlCRoutine)
  57. #define ReadMemory(a,b,c,d) ReadProcessMemory( ExtensionCurrentProcess, (LPCVOID)(a), (b), (c), (d) )
  58. #define WriteMemory(a,b,c,d) WriteProcessMemory( ExtensionCurrentProcess, (LPVOID)(a), (LPVOID)(b), (c), (d) )
  59. #ifndef DbgAlloc
  60. #define DbgAlloc( n ) HeapAlloc( GetProcessHeap(), 0, (n) )
  61. #endif
  62. #ifndef DbgFree
  63. #define DbgFree( p ) HeapFree( GetProcessHeap(), 0, (p) )
  64. #define DbgFreeEx( p ) if( (p) ) DbgFree( (p) )
  65. #endif
  66. extern NTSD_EXTENSION_APIS ExtensionApis;
  67. extern HANDLE ExtensionCurrentProcess;