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.

114 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1985 - 1999, Microsoft Corporation
  3. Module Name:
  4. kdexts.c
  5. Abstract:
  6. This file contains the generic routines and initialization code
  7. for the kernel debugger extensions dll.
  8. Author:
  9. Wesley Witt (wesw) 26-Aug-1993
  10. Environment:
  11. User Mode
  12. --*/
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. #include <imagehlp.h>
  16. #include <wdbgexts.h>
  17. #include <ntsdexts.h>
  18. #include <ntverp.h>
  19. //
  20. // globals
  21. //
  22. EXT_API_VERSION ApiVersion = { VER_PRODUCTVERSION_W >> 8,
  23. VER_PRODUCTVERSION_W & 0xff,
  24. EXT_API_VERSION_NUMBER64, 0 };
  25. WINDBG_EXTENSION_APIS ExtensionApis;
  26. USHORT SavedMajorVersion;
  27. USHORT SavedMinorVersion;
  28. BOOL bDebuggingChecked;
  29. DllInit(
  30. HANDLE hModule,
  31. DWORD dwReason,
  32. DWORD dwReserved
  33. )
  34. {
  35. UNREFERENCED_PARAMETER(hModule);
  36. UNREFERENCED_PARAMETER(dwReserved);
  37. switch (dwReason) {
  38. case DLL_THREAD_ATTACH:
  39. break;
  40. case DLL_THREAD_DETACH:
  41. break;
  42. case DLL_PROCESS_DETACH:
  43. break;
  44. case DLL_PROCESS_ATTACH:
  45. break;
  46. }
  47. return TRUE;
  48. }
  49. VOID
  50. WinDbgExtensionDllInit(
  51. WINDBG_EXTENSION_APIS *lpExtensionApis,
  52. USHORT MajorVersion,
  53. USHORT MinorVersion
  54. )
  55. {
  56. ExtensionApis = *lpExtensionApis;
  57. SavedMajorVersion = MajorVersion;
  58. SavedMinorVersion = MinorVersion;
  59. bDebuggingChecked = (SavedMajorVersion == 0x0c);
  60. return;
  61. }
  62. DECLARE_API( version )
  63. {
  64. #if DBG
  65. PCHAR DebuggerType = "Checked";
  66. #else
  67. PCHAR DebuggerType = "Free";
  68. #endif
  69. UNREFERENCED_PARAMETER(args);
  70. UNREFERENCED_PARAMETER(dwProcessor);
  71. UNREFERENCED_PARAMETER(dwCurrentPc);
  72. UNREFERENCED_PARAMETER(hCurrentThread);
  73. UNREFERENCED_PARAMETER(hCurrentProcess);
  74. dprintf( "%s Extension dll for Build %d debugging %s kernel for Build %d\n",
  75. DebuggerType,
  76. VER_PRODUCTBUILD,
  77. SavedMajorVersion == 0x0c ? "Checked" : "Free",
  78. SavedMinorVersion
  79. );
  80. }
  81. LPEXT_API_VERSION
  82. ExtensionApiVersion(
  83. VOID
  84. )
  85. {
  86. return &ApiVersion;
  87. }