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.

43 lines
1.0 KiB

  1. #include <irda.h>
  2. #include <irioctl.h>
  3. #include <irlap.h>
  4. #include <irlmp.h>
  5. #undef offsetof
  6. #include "irevent.tmh"
  7. VOID
  8. IrdaEventCallback(struct CTEEvent *Event, PVOID Arg)
  9. {
  10. PIRDA_LINK_CB pIrdaLinkCb = (PIRDA_LINK_CB) Arg;
  11. PIRDA_EVENT pIrdaEvent = (PIRDA_EVENT) Event;
  12. if (pIrdaLinkCb)
  13. REFADD(&pIrdaLinkCb->RefCnt, 'TNVE');
  14. pIrdaEvent->Callback(pIrdaLinkCb);
  15. PAGED_CODE();
  16. if (pIrdaLinkCb)
  17. REFDEL(&pIrdaLinkCb->RefCnt, 'TNVE');
  18. }
  19. VOID
  20. IrdaEventInitialize(PIRDA_EVENT pIrdaEvent,
  21. VOID (*Callback)(PVOID Context))
  22. {
  23. CTEInitEvent(&pIrdaEvent->CteEvent, IrdaEventCallback);
  24. pIrdaEvent->Callback = Callback;
  25. }
  26. VOID
  27. IrdaEventSchedule(PIRDA_EVENT pIrdaEvent, PVOID Arg)
  28. {
  29. PIRDA_LINK_CB pIrdaLinkCb = (PIRDA_LINK_CB) Arg;
  30. if (CTEScheduleEvent(&pIrdaEvent->CteEvent, pIrdaLinkCb) == FALSE)
  31. {
  32. DEBUGMSG(DBG_ERROR, (TEXT("CTEScheduleEvent failed\n")));
  33. ASSERT(0);
  34. }
  35. }