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.

153 lines
3.5 KiB

  1. #include "wdmirp.h"
  2. #pragma PAGEDCODE
  3. CIrp* CWDMIrp::create(VOID)
  4. { return new (NonPagedPool) CWDMIrp; }
  5. #pragma PAGEDCODE
  6. PIRP CWDMIrp::allocate(IN CCHAR StackSize,IN BOOLEAN ChargeQuota)
  7. {
  8. return ::IoAllocateIrp(StackSize,ChargeQuota);
  9. }
  10. #pragma PAGEDCODE
  11. VOID CWDMIrp::initialize(PIRP Irp,USHORT PacketSize,CCHAR StackSize)
  12. {
  13. ::IoInitializeIrp(Irp,PacketSize,StackSize);
  14. }
  15. #pragma PAGEDCODE
  16. USHORT CWDMIrp::sizeOfIrp(IN CCHAR StackSize)
  17. {
  18. return IoSizeOfIrp(StackSize);
  19. }
  20. #pragma PAGEDCODE
  21. VOID CWDMIrp::free(IN PIRP Irp)
  22. {
  23. ::IoFreeIrp(Irp);
  24. }
  25. #pragma PAGEDCODE
  26. VOID CWDMIrp::cancel(IN PIRP Irp)
  27. {
  28. ::IoCancelIrp(Irp);
  29. }
  30. #pragma PAGEDCODE
  31. PIO_STACK_LOCATION CWDMIrp::getCurrentStackLocation(IN PIRP Irp)
  32. {
  33. return IoGetCurrentIrpStackLocation(Irp);
  34. }
  35. #pragma PAGEDCODE
  36. PIO_STACK_LOCATION CWDMIrp::getNextStackLocation(IN PIRP Irp)
  37. {
  38. return IoGetNextIrpStackLocation(Irp);
  39. }
  40. #pragma PAGEDCODE
  41. VOID CWDMIrp::skipCurrentStackLocation(IN PIRP Irp)
  42. {
  43. IoSkipCurrentIrpStackLocation(Irp);
  44. }
  45. #pragma PAGEDCODE
  46. VOID CWDMIrp::copyCurrentStackLocationToNext(IN PIRP Irp)
  47. {
  48. IoCopyCurrentIrpStackLocationToNext(Irp);
  49. }
  50. #pragma PAGEDCODE
  51. VOID CWDMIrp::setNextStackLocation(IN PIRP Irp)
  52. {
  53. IoSetNextIrpStackLocation(Irp);
  54. }
  55. #pragma PAGEDCODE
  56. VOID CWDMIrp::markPending(IN PIRP Irp)
  57. {
  58. IoMarkIrpPending(Irp);
  59. }
  60. #pragma PAGEDCODE
  61. PDRIVER_CANCEL CWDMIrp::setCancelRoutine(IN PIRP Irp, PDRIVER_CANCEL NewCancelRoutine )
  62. {
  63. return IoSetCancelRoutine(Irp, NewCancelRoutine);
  64. }
  65. #pragma PAGEDCODE
  66. VOID CWDMIrp::startPacket(IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp,IN PULONG Key, IN PDRIVER_CANCEL CancelFunction)
  67. {
  68. ::IoStartPacket(DeviceObject,Irp,Key,CancelFunction);
  69. }
  70. #pragma PAGEDCODE
  71. VOID CWDMIrp::startNextPacket(IN PDEVICE_OBJECT DeviceObject,IN BOOLEAN Cancelable)
  72. {
  73. ::IoStartNextPacket(DeviceObject,Cancelable);
  74. }
  75. #pragma PAGEDCODE
  76. VOID CWDMIrp::completeRequest(IN PIRP Irp,IN CCHAR PriorityBoost)
  77. {
  78. IoCompleteRequest(Irp,PriorityBoost);
  79. }
  80. #pragma PAGEDCODE
  81. VOID CWDMIrp::requestDpc(IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp,PVOID Context)
  82. {
  83. IoRequestDpc(DeviceObject,Irp,Context);
  84. }
  85. #pragma PAGEDCODE
  86. VOID CWDMIrp::setCompletionRoutine( IN PIRP Irp, PIO_COMPLETION_ROUTINE Routine,
  87. PVOID Context, BOOLEAN Success, BOOLEAN Error, BOOLEAN Cancel )
  88. {
  89. IoSetCompletionRoutine(Irp,Routine,Context,Success,Error,Cancel);
  90. }
  91. #pragma PAGEDCODE
  92. PIRP CWDMIrp::buildDeviceIoControlRequest(
  93. IN ULONG IoControlCode,
  94. IN PDEVICE_OBJECT DeviceObject,
  95. IN PVOID InputBuffer OPTIONAL,
  96. IN ULONG InputBufferLength,
  97. IN OUT PVOID OutputBuffer OPTIONAL,
  98. IN ULONG OutputBufferLength,
  99. IN BOOLEAN InternalDeviceIoControl,
  100. IN PKEVENT Event,
  101. OUT PIO_STATUS_BLOCK IoStatusBlock
  102. )
  103. {
  104. return IoBuildDeviceIoControlRequest(IoControlCode,
  105. DeviceObject,
  106. InputBuffer,
  107. InputBufferLength,
  108. OutputBuffer,
  109. OutputBufferLength,
  110. InternalDeviceIoControl,
  111. Event,
  112. IoStatusBlock
  113. );
  114. }
  115. #pragma PAGEDCODE
  116. PIRP CWDMIrp::buildSynchronousFsdRequest(
  117. IN ULONG MajorFunction,
  118. IN PDEVICE_OBJECT DeviceObject,
  119. IN OUT PVOID Buffer OPTIONAL,
  120. IN ULONG Length OPTIONAL,
  121. IN PLARGE_INTEGER StartingOffset OPTIONAL,
  122. IN PKEVENT Event,
  123. OUT PIO_STATUS_BLOCK IoStatusBlock
  124. )
  125. {
  126. return IoBuildSynchronousFsdRequest(MajorFunction,
  127. DeviceObject, Buffer, Length, StartingOffset, Event, IoStatusBlock);
  128. };