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.

74 lines
2.2 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : GeneralNotifyWnd.cpp //
  3. // //
  4. // DESCRIPTION : The implementation of fax Device notification window. //
  5. // //
  6. // AUTHOR : yossg //
  7. // //
  8. // HISTORY : //
  9. // Aug 3 2000 yossg Create //
  10. // //
  11. // Copyright (C) 2000 Microsoft Corporation All Rights Reserved //
  12. /////////////////////////////////////////////////////////////////////////////
  13. #include "stdafx.h"
  14. #include "GeneralNotifyWnd.h"
  15. #include "FaxServer.h"
  16. /*
  17. - CFaxGeneralNotifyWnd::OnServerDeviceStateChanged
  18. -
  19. * Purpose:
  20. * Catch the server event of device status change and
  21. * update the change through Devices node.
  22. *
  23. * Arguments:
  24. *
  25. * Return:
  26. * 1
  27. */
  28. LRESULT CFaxGeneralNotifyWnd::OnServerEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled)
  29. {
  30. DEBUG_FUNCTION_NAME( _T("CFaxGeneralNotifyWnd::OnServerEvent"));
  31. ATLASSERT(m_pDevicesNode);
  32. UNREFERENCED_PARAMETER( wParam );
  33. UNREFERENCED_PARAMETER( fHandled );
  34. HRESULT hRc = S_OK;
  35. ATLASSERT( uiMsg == WM_GENERAL_EVENT_NOTIFICATION );
  36. //
  37. // Extract event object
  38. //
  39. PFAX_EVENT_EX pFaxEvent = NULL;
  40. pFaxEvent = reinterpret_cast<PFAX_EVENT_EX>(lParam);
  41. ATLASSERT( pFaxEvent );
  42. //
  43. // Update FaxServer object with "Devices" event
  44. //
  45. ATLASSERT(m_pFaxServer);
  46. hRc = m_pFaxServer->OnNewEvent(pFaxEvent);
  47. if (S_OK != hRc)
  48. {
  49. DebugPrintEx(
  50. DEBUG_ERR,
  51. _T("Failed to trsport new event to FaxServer object"));
  52. }
  53. //
  54. // Free buffer (any way!)
  55. //
  56. if (pFaxEvent)
  57. {
  58. FaxFreeBuffer (pFaxEvent);
  59. pFaxEvent = NULL;
  60. }
  61. return 1;
  62. }