Source code of Windows XP (NT5)
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.

65 lines
1.8 KiB

  1. //////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // events.cpp
  7. //
  8. // Abstract:
  9. // This module contains code which implements eventhandler
  10. // commands from the dll
  11. //
  12. //////////////////////////////////////////////////////////
  13. #include "stdafx.h"
  14. ///////////////////////////////////////////////////////////////////////
  15. // Public functions
  16. ///////////////////////////////////////////////////////////////////////
  17. // --------------------------------------------------------------------
  18. //
  19. // Function: DoEnableEventHandler
  20. //
  21. // Arguments: TdiHandle -- handle of address object
  22. // EventId -- event type number
  23. //
  24. // Returns: None
  25. //
  26. // Descript: This function causes the driver to enable the
  27. // specified event handler
  28. //
  29. //---------------------------------------------------------------------
  30. VOID
  31. DoEnableEventHandler(ULONG ulTdiHandleDriver,
  32. ULONG ulEventId)
  33. {
  34. RECEIVE_BUFFER ReceiveBuffer; // return info from command
  35. SEND_BUFFER SendBuffer; // arguments for command
  36. //
  37. // set up arguments
  38. //
  39. SendBuffer.TdiHandle = ulTdiHandleDriver;
  40. SendBuffer.COMMAND_ARGS.ulEventId = ulEventId;
  41. //
  42. // call the driver
  43. //
  44. NTSTATUS lStatus = TdiLibDeviceIO(ulSETEVENTHANDLER,
  45. &SendBuffer,
  46. &ReceiveBuffer);
  47. if (lStatus != STATUS_SUCCESS)
  48. {
  49. _tprintf(TEXT("DoEnableEventHandler: failure, status = %s\n"), TdiLibStatusMessage(lStatus));
  50. }
  51. }
  52. ////////////////////////////////////////////////////////////////////
  53. // end of file events.cpp
  54. ////////////////////////////////////////////////////////////////////