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.

99 lines
1.8 KiB

  1. //depot/Lab01_N/drivers/storage/kdext/minipkd/kdext.cpp#1 - add change 1876 (text)
  2. /*++
  3. Copyright (C) Microsoft Corporation, 1993 - 1999
  4. Module Name:
  5. kdexts.c
  6. Abstract:
  7. This file contains the generic routines and initialization code
  8. for the kernel debugger extensions dll.
  9. Author:
  10. Wesley Witt (wesw) 26-Aug-1993
  11. Environment:
  12. User Mode
  13. --*/
  14. #include "pch.h"
  15. #pragma hdrstop
  16. #include <ntverp.h>
  17. //
  18. // globals
  19. //
  20. WINDBG_EXTENSION_APIS ExtensionApis;
  21. DllInit(
  22. HANDLE hModule,
  23. DWORD dwReason,
  24. DWORD dwReserved
  25. )
  26. {
  27. switch (dwReason) {
  28. case DLL_THREAD_ATTACH:
  29. break;
  30. case DLL_THREAD_DETACH:
  31. break;
  32. case DLL_PROCESS_DETACH:
  33. break;
  34. case DLL_PROCESS_ATTACH:
  35. break;
  36. }
  37. return TRUE;
  38. }
  39. extern "C" HRESULT CALLBACK DebugExtensionInitialize(PULONG Version, PULONG Flags)
  40. {
  41. IDebugClient *DebugClient;
  42. PDEBUG_CONTROL DebugControl;
  43. HRESULT Hr;
  44. *Version = DEBUG_EXTENSION_VERSION(1, 0);
  45. *Flags = 0;
  46. if ((Hr = DebugCreate(__uuidof(IDebugClient),
  47. (void **)&DebugClient)) != S_OK)
  48. {
  49. return Hr;
  50. }
  51. if ((Hr = DebugClient->QueryInterface(__uuidof(IDebugControl),
  52. (void **)&DebugControl)) != S_OK)
  53. {
  54. return Hr;
  55. }
  56. ExtensionApis.nSize = sizeof (ExtensionApis);
  57. if ((Hr = DebugControl->GetWindbgExtensionApis64(&ExtensionApis)) != S_OK) {
  58. return Hr;
  59. }
  60. DebugControl->Release();
  61. DebugClient->Release();
  62. return S_OK;
  63. }
  64. extern "C" void CALLBACK
  65. DebugExtensionUninitialize(void)
  66. {
  67. // g_ExcepCallbacks.Uninitialize();
  68. // g_FnProfCallbacks.Uninitialize();
  69. }