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.

41 lines
959 B

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