Source code of Windows XP (NT5)
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.

116 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1990 - 1994 Microsoft Corporation
  3. Module Name:
  4. dbglocal.h
  5. Abstract:
  6. Header file for NetOle Debugger Extensions
  7. Author:
  8. Krishna Ganugapati (KrishnaG) 11-December-1994
  9. Revision History:
  10. --*/
  11. //
  12. // Macro Land
  13. // Note: if you use any of these macros within your code, you must have the
  14. // following variables present and set to the appropriate value
  15. //
  16. // HANDLE hCurrentProcess
  17. // PNTSD_GET_EXPRESSION EvalExpression
  18. //
  19. //
  20. #define move(dst, src)\
  21. try {\
  22. ReadProcessMemory(hCurrentProcess, (LPVOID)src, &dst, sizeof(dst), NULL);\
  23. } except (EXCEPTION_EXECUTE_HANDLER) {\
  24. return 0;\
  25. }
  26. #define movestruct(src, dst, type)\
  27. try {\
  28. ReadProcessMemory(hCurrentProcess, (LPVOID)src, dst, sizeof(type), NULL);\
  29. } except (EXCEPTION_EXECUTE_HANDLER) {\
  30. return 0;\
  31. }
  32. #define movemem(src, dst, sz)\
  33. try {\
  34. ReadProcessMemory(hCurrentProcess, (LPVOID)src, dst, sz, NULL);\
  35. } except (EXCEPTION_EXECUTE_HANDLER) {\
  36. return 0;\
  37. }
  38. #define GetAddress(dst, src)\
  39. try {\
  40. dst = EvalExpression(src);\
  41. } except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?\
  42. EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {\
  43. Print("NTSD: Access violation on \"%s\", switch to server context\n", src);\
  44. return(0);\
  45. }
  46. typedef void (*PNTSD_OUTPUT_ROUTINE)(char *, ...);
  47. VOID
  48. PrintData(
  49. PNTSD_OUTPUT_ROUTINE Print,
  50. LPSTR TypeString,
  51. LPSTR VarString,
  52. ...
  53. );
  54. BOOL
  55. DbgDumpSecurityDescriptor(
  56. HANDLE hCurrentProcess,
  57. PNTSD_OUTPUT_ROUTINE Print,
  58. PISECURITY_DESCRIPTOR pSecurityDescriptor
  59. );
  60. BOOL
  61. DbgDumpSid(
  62. HANDLE hCurrentProcess,
  63. PNTSD_OUTPUT_ROUTINE Print,
  64. PVOID SidAddress
  65. );
  66. BOOL
  67. DbgDumpAcl(
  68. HANDLE hCurrentProcess,
  69. PNTSD_OUTPUT_ROUTINE Print,
  70. PVOID AclAddress
  71. );
  72. VOID
  73. ConvertSidToAsciiString(
  74. PSID pSid,
  75. LPSTR String
  76. );
  77. DWORD EvalValue(
  78. LPSTR *pptstr,
  79. PNTSD_GET_EXPRESSION EvalExpression,
  80. PNTSD_OUTPUT_ROUTINE Print);
  81. #define ntsdPrintf (lpExtensionApis->lpOutputRoutine)
  82. #define ntsdGetSymbol (lpExtensionApis->lpGetSymbolRoutine)
  83. #define ntsdGetExpr (lpExtensionApis->lpGetExpressionRoutine)
  84. #define ntsdCheckC (lpExtensionApis->lpCheckControlCRoutine)