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.

104 lines
2.5 KiB

  1. // Gemplus (C) 1999
  2. // Version 1.0
  3. // Author: Sergey Ivanov
  4. // Date of creation - 18.05.1999
  5. // Change log:
  6. //
  7. #ifndef __IO_PACKET__
  8. #define __IO_PACKET__
  9. #include "generic.h"
  10. // This class will manage creation and
  11. // manipulation of driver IRPs
  12. class CIrp;
  13. class CMemory;
  14. class CEvent;
  15. class CDebug;
  16. #pragma LOCKEDCODE
  17. NTSTATUS onRequestComplete(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context);
  18. #pragma PAGEDCODE
  19. class CIoPacket;
  20. class CIoPacket
  21. {
  22. public:
  23. NTSTATUS m_Status;
  24. SAFE_DESTRUCTORS();
  25. virtual VOID dispose(){self_delete();};
  26. private:
  27. IO_STACK_LOCATION Stack;
  28. //Cancel;
  29. PIRP m_Irp;
  30. UCHAR StackSize;
  31. CIrp* irp;
  32. CMemory* memory;
  33. CEvent* event;
  34. CDebug* debug;
  35. BOOL systemIrp;
  36. BOOL m_DoNotFreeIrp;
  37. // Event to signal xfer completion
  38. KEVENT DefaultCompletionEvent;
  39. PKEVENT CompletionEvent;
  40. IO_STATUS_BLOCK IoStatus;
  41. PVOID SystemBuffer;
  42. LONG m_TimeOut;
  43. protected:
  44. CIoPacket(){};
  45. virtual ~CIoPacket();
  46. public:
  47. CIoPacket(UCHAR StackSize);
  48. CIoPacket(PIRP Irp);
  49. virtual PIRP getIrpHandle(){return m_Irp;};
  50. virtual VOID setMajorIOCtl(UCHAR controlCode);
  51. virtual UCHAR getMajorIOCtl();
  52. virtual VOID setMinorIOCtl(UCHAR controlCode);
  53. virtual NTSTATUS buildStack(PDEVICE_OBJECT DeviceObject, ULONG Major=IRP_MJ_INTERNAL_DEVICE_CONTROL, UCHAR Minor=0, ULONG IoCtl=0, PVOID Context=NULL);
  54. virtual PIO_STACK_LOCATION getStack();
  55. virtual VOID copyStackToNext();
  56. virtual VOID copyCurrentStackToNext();
  57. virtual VOID setCompletion(PIO_COMPLETION_ROUTINE CompletionFunction=NULL);
  58. virtual VOID setDefaultCompletionFunction();
  59. virtual NTSTATUS waitForCompletion();
  60. virtual NTSTATUS waitForCompletion(LONG TimeOut);
  61. virtual VOID setDefaultCompletionEvent();
  62. virtual VOID setCompletionEvent(PKEVENT CompletionEvent);
  63. virtual VOID setStackDefaults();
  64. virtual VOID setCurrentStack();
  65. virtual NTSTATUS onRequestComplete();
  66. virtual NTSTATUS copyBuffer(PUCHAR pBuffer, ULONG BufferLength);
  67. virtual PVOID getBuffer();
  68. virtual ULONG getReadLength();
  69. virtual VOID setReadLength(ULONG length);
  70. virtual ULONG getWriteLength();
  71. virtual VOID setWriteLength(ULONG length);
  72. virtual VOID setInformation(ULONG_PTR information);
  73. virtual ULONG_PTR getInformation();
  74. virtual VOID updateInformation();
  75. virtual NTSTATUS getSystemReply(PUCHAR pReply,ULONG Length);
  76. virtual VOID setStatus(NTSTATUS status);
  77. virtual NTSTATUS getStatus();
  78. virtual VOID setTimeout(LONG TimeOut);
  79. virtual ULONG getTimeout();
  80. };
  81. #endif//IRP