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.

66 lines
2.1 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: rptcrpt.cxx
  7. //
  8. // Contents: CFwCorruptionEvent Class
  9. //
  10. // History: 14-Jan-97 mohamedn Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #include <pch.cxx>
  14. #pragma hdrstop
  15. #include <cievtmsg.h>
  16. #include <alocdbg.hxx>
  17. #include <rptcrpt.hxx>
  18. #include <fwevent.hxx>
  19. //+-------------------------------------------------------------------------
  20. //
  21. // Method: CFwCorruptionEvent::CFwCorruptionEvent
  22. //
  23. // Purpose: encapsulates packaging an eventlog item and a stack trace
  24. // to be posted in the eventlog via CDmFwEventItem class.
  25. //
  26. // Arguments: [pwszVolumeName] - Volume name from pStorage->GetVolumeName()
  27. // [pwszComponent] - string to be displayed in eventlog
  28. // [adviseStatus ] - a reference to ICiCAdviseStatus interface
  29. //
  30. // History: 14-Jan-97 MohamedN Created
  31. //
  32. //--------------------------------------------------------------------------
  33. CFwCorruptionEvent::CFwCorruptionEvent( WCHAR const * pwszVolumeName,
  34. WCHAR const * pwszComponent,
  35. ICiCAdviseStatus & adviseStatus )
  36. {
  37. TRY
  38. {
  39. CDmFwEventItem item( EVENTLOG_INFORMATION_TYPE,
  40. MSG_CI_CORRUPT_INDEX_COMPONENT,
  41. 3 );
  42. item.AddArg ( pwszComponent );
  43. item.AddArg ( pwszVolumeName);
  44. char szStackTrace[4096];
  45. GetStackTrace( szStackTrace,sizeof(szStackTrace));
  46. item.AddArg( szStackTrace );
  47. item.ReportEvent(adviseStatus);
  48. }
  49. CATCH ( CException, e )
  50. {
  51. ciDebugOut(( DEB_ERROR, "Error 0x%X in ReportCorruption::ReportCorruption(3)\n",
  52. e.GetErrorCode() ));
  53. }
  54. END_CATCH
  55. }