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.

95 lines
2.0 KiB

  1. #include "header.h"
  2. #if DBG
  3. char DebuggerType[] = "Checked";
  4. #else
  5. char DebuggerType[] = "Free";
  6. #endif
  7. char COMPILED[] = "File " __FILE__ "\n"
  8. "Compiled on " __DATE__ " at " __TIME__ "\n";
  9. #if defined( _WDBGEXTS_ )
  10. EXT_API_VERSION ApiVersion = { 3, 5, EXT_API_VERSION_NUMBER, 0 };
  11. WINDBG_EXTENSION_APIS ExtensionApis;
  12. USHORT SavedMajorVersion;
  13. USHORT SavedMinorVersion;
  14. BOOLEAN ChkTarget;
  15. void
  16. WinDbgExtensionDllInit(
  17. PWINDBG_EXTENSION_APIS lpExtensionApis,
  18. USHORT MajorVersion,
  19. USHORT MinorVersion
  20. )
  21. {
  22. ExtensionApis = *lpExtensionApis;
  23. SavedMajorVersion = MajorVersion;
  24. SavedMinorVersion = MinorVersion;
  25. ChkTarget = (SavedMajorVersion == 0x0c);
  26. return;
  27. }
  28. LPEXT_API_VERSION ExtensionApiVersion( void )
  29. {
  30. return &ApiVersion;
  31. }
  32. DECLARE_API( version )
  33. {
  34. dprintf( "%s Extension dll for Build %d debugging %s"
  35. "kernel for Build %d\n",
  36. DebuggerType,
  37. VER_PRODUCTBUILD,
  38. SavedMajorVersion == 0x0c ? "Checked" : "Free",
  39. SavedMinorVersion
  40. );
  41. dprintf( COMPILED );
  42. }
  43. #else // not _WDBGEXTS_
  44. //
  45. // Dummy windbg specific exports allows a common .def
  46. // file for both ntsd and windbg.
  47. //
  48. NTSD_EXTENSION_APIS ExtensionApis;
  49. HANDLE ExtensionCurrentProcess;
  50. void WinDbgExtensionDllInit( void ) { return; }
  51. void ExtensionApiVersion( void ) { return; }
  52. DECLARE_API( version )
  53. {
  54. INIT_API();
  55. dprintf( "%s Extension dll for Build %d\n",
  56. DebuggerType, VER_PRODUCTBUILD );
  57. dprintf( COMPILED );
  58. }
  59. #endif // _WDBGEXTS
  60. //
  61. // Common
  62. //
  63. void CheckVersion( void ) {
  64. return;
  65. }
  66. DllInit( HANDLE hModule, DWORD dwReason, DWORD dwReserved )
  67. {
  68. switch (dwReason) {
  69. case DLL_THREAD_ATTACH: break;
  70. case DLL_THREAD_DETACH: break;
  71. case DLL_PROCESS_DETACH: break;
  72. case DLL_PROCESS_ATTACH: break;
  73. }
  74. return TRUE;
  75. }