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.

102 lines
1.7 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1993 - 1999
  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 "pch.h"
  14. //
  15. // globals
  16. //
  17. WINDBG_EXTENSION_APIS ExtensionApis;
  18. DllInit(
  19. HANDLE hModule,
  20. DWORD dwReason,
  21. DWORD dwReserved
  22. )
  23. {
  24. switch (dwReason) {
  25. case DLL_THREAD_ATTACH:
  26. break;
  27. case DLL_THREAD_DETACH:
  28. break;
  29. case DLL_PROCESS_DETACH:
  30. break;
  31. case DLL_PROCESS_ATTACH:
  32. break;
  33. }
  34. return TRUE;
  35. }
  36. extern "C"
  37. HRESULT
  38. CALLBACK
  39. DebugExtensionInitialize(
  40. PULONG Version,
  41. PULONG Flags
  42. )
  43. {
  44. IDebugClient *DebugClient;
  45. PDEBUG_CONTROL DebugControl;
  46. HRESULT Hr;
  47. *Version = DEBUG_EXTENSION_VERSION(1, 0);
  48. *Flags = 0;
  49. if ((Hr = DebugCreate(__uuidof(IDebugClient),
  50. (void **)&DebugClient)) != S_OK)
  51. {
  52. return Hr;
  53. }
  54. if ((Hr = DebugClient->QueryInterface(__uuidof(IDebugControl),
  55. (void **)&DebugControl)) != S_OK)
  56. {
  57. return Hr;
  58. }
  59. ExtensionApis.nSize = sizeof (ExtensionApis);
  60. if ((Hr = DebugControl->GetWindbgExtensionApis64(&ExtensionApis)) != S_OK) {
  61. return Hr;
  62. }
  63. DebugControl->Release();
  64. DebugClient->Release();
  65. return S_OK;
  66. }
  67. extern "C" void CALLBACK
  68. DebugExtensionUninitialize(void)
  69. {
  70. // g_ExcepCallbacks.Uninitialize();
  71. // g_FnProfCallbacks.Uninitialize();
  72. }