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.

108 lines
3.0 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Extension DLL support.
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997-2002.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef _EXTS_H_
  9. #define _EXTS_H_
  10. #define OPTION_NOEXTWARNING 0x00000001
  11. #define OPTION_NOVERSIONCHECK 0x00000002
  12. #define OPTION_COUNT 2
  13. extern DWORD g_EnvDbgOptions;
  14. #define WOW64EXTS_FLUSH_CACHE 0
  15. #define WOW64EXTS_GET_CONTEXT 1
  16. #define WOW64EXTS_SET_CONTEXT 2
  17. #define WOW64EXTS_FLUSH_CACHE_WITH_HANDLE 3
  18. typedef VOID (*WOW64EXTSPROC)(ULONG64, ULONG64, ULONG64, ULONG64);
  19. typedef ULONG (CALLBACK* WMI_FORMAT_TRACE_DATA)
  20. (PDEBUG_CONTROL Ctrl, ULONG Mask, ULONG DataLen, PVOID Data);
  21. extern ULONG64 g_ExtThread;
  22. extern WOW64EXTSPROC g_Wow64exts;
  23. extern WMI_FORMAT_TRACE_DATA g_WmiFormatTraceData;
  24. extern DEBUG_SCOPE g_ExtThreadSavedScope;
  25. extern BOOL g_ExtThreadScopeSaved;
  26. extern WINDBG_EXTENSION_APIS64 g_WindbgExtensions64;
  27. extern WINDBG_EXTENSION_APIS32 g_WindbgExtensions32;
  28. extern WINDBG_OLDKD_EXTENSION_APIS g_KdExtensions;
  29. DebugClient* FindExtClient(void);
  30. void ParseBangCmd(DebugClient* Client,
  31. BOOL BuiltInOnly);
  32. enum ExtensionType
  33. {
  34. NTSD_EXTENSION_TYPE = 1,
  35. DEBUG_EXTENSION_TYPE,
  36. WINDBG_EXTENSION_TYPE,
  37. WINDBG_OLDKD_EXTENSION_TYPE,
  38. };
  39. typedef struct _EXTDLL
  40. {
  41. struct _EXTDLL *Next;
  42. HINSTANCE Dll;
  43. EXT_API_VERSION ApiVersion;
  44. BOOL UserLoaded;
  45. ExtensionType ExtensionType;
  46. PDEBUG_EXTENSION_NOTIFY Notify;
  47. PDEBUG_EXTENSION_UNINITIALIZE Uninit;
  48. PWINDBG_EXTENSION_DLL_INIT64 Init;
  49. PWINDBG_EXTENSION_API_VERSION ApiVersionRoutine;
  50. PWINDBG_CHECK_VERSION CheckVersionRoutine;
  51. TargetInfo* Target;
  52. // Array extends to contain the full name.
  53. char Name[1];
  54. } EXTDLL;
  55. extern EXTDLL* g_ExtDlls;
  56. LONG
  57. ExtensionExceptionFilter(
  58. struct _EXCEPTION_POINTERS *ExceptionInfo,
  59. PCSTR Module,
  60. PCSTR Func
  61. );
  62. EXTDLL* AddExtensionDll(char *Name, BOOL UserLoaded, TargetInfo* Target,
  63. char **End);
  64. BOOL LoadExtensionDll(TargetInfo* Target, EXTDLL *Ext);
  65. void DeferExtensionDll(EXTDLL *Match, BOOL Verbose);
  66. void UnloadExtensionDll(EXTDLL *Match, BOOL Verbose);
  67. void UnloadTargetExtensionDlls(TargetInfo* Target);
  68. void DeferAllExtensionDlls(void);
  69. BOOL
  70. CallAnyExtension(DebugClient* Client,
  71. EXTDLL* Ext, PSTR Function, PCSTR Arguments,
  72. BOOL ModuleSpecified, BOOL ShowWarnings,
  73. HRESULT* ExtStatus);
  74. void OutputModuleIdInfo(HMODULE Mod, PSTR ModFile, LPEXT_API_VERSION ApiVer);
  75. void OutputExtensions(DebugClient* Client, BOOL Versions);
  76. void NotifyExtensions(ULONG Notify, ULONG64 Argument);
  77. void ReadDebugOptions (BOOL fQuiet, char * pszOptionsStr);
  78. VOID LoadWow64ExtsIfNeeded(ULONG64 Process);
  79. #endif // #ifndef _EXTS_H_