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.

111 lines
3.1 KiB

  1. //
  2. // @struct GCK_FILE_OPEN_ITEM | Status of open file handles.
  3. //
  4. typedef struct tagGCK_FILE_OPEN_ITEM
  5. {
  6. BOOLEAN fReadPending; // @field TRUE if read is pending to driver
  7. BOOLEAN fConfirmed; // @field TRUE means that the lower driver has already completed the open
  8. ULONG ulAccess; // @field represents permissions this was opened with
  9. USHORT usSharing; // @field represents sharing under which this was opened
  10. FILE_OBJECT *pFileObject; // @field Pointer to file object which this status describes
  11. struct tagGCK_FILE_OPEN_ITEM *pNextOpenItem; // @field Next structure in Linked List
  12. } GCK_FILE_OPEN_ITEM, *PGCK_FILE_OPEN_ITEM;
  13. typedef struct _SHARE_STATUS {
  14. ULONG OpenCount;
  15. ULONG Readers;
  16. ULONG Writers;
  17. //ULONG Deleters; //We are driver without delete symantics
  18. ULONG SharedRead;
  19. ULONG SharedWrite;
  20. //ULONG SharedDelete; //We are driver without delete symantics
  21. } SHARE_STATUS, *PSHARE_STATUS;
  22. //
  23. // @struct GCK_INTERNAL_POLL | Information needed for the iternal polling routines
  24. //
  25. typedef struct tagGCK_INTERNAL_POLL
  26. {
  27. KSPIN_LOCK InternalPollLock; // @field SpinLock to serialize access to this structue (not all items require it)
  28. FILE_OBJECT *pInternalFileObject; // @field Pointer to File Object that was created for internal polls
  29. PGCK_FILE_OPEN_ITEM pFirstOpenItem; // @field Head of linked list of GCK_FILE_OPEN_ITEMs for open files
  30. SHARE_STATUS ShareStatus; // @field Keeps track of file sharing.
  31. // BOOLEAN fReadPending; // @field TRUE if Read IRP to lower driver is pending
  32. LONG fReadPending; // @field TRUE if Read IRP to lower driver is pending
  33. PIRP pPrivateIrp; // @field IRP we reuse to send Read IRPs to lower driver
  34. PUCHAR pucReportBuffer; // @field Buffer for getting Report with pPrivateIrp
  35. ULONG ulInternalPollRef; // @field Reference to internal polls
  36. PKTHREAD InternalCreateThread; // @field Used to figure out if a create is for the internal file object
  37. BOOLEAN fReady; // @field TRUE whenever the internal polling module is good to go.
  38. } GCK_INTERNAL_POLL, *PGCK_INTERNAL_POLL;
  39. NTSTATUS
  40. GCK_IP_AddFileObject
  41. (
  42. IN PGCK_FILTER_EXT pFilterExt,
  43. IN PFILE_OBJECT pFileObject
  44. );
  45. NTSTATUS
  46. GCK_IP_RemoveFileObject
  47. (
  48. IN PGCK_FILTER_EXT pFilterExt,
  49. IN PFILE_OBJECT pFileObject
  50. );
  51. NTSTATUS
  52. GCK_IP_ApproveReadIrp
  53. (
  54. IN PGCK_FILTER_EXT pFilterExt,
  55. IN PIRP
  56. );
  57. NTSTAUTS
  58. GCK_IP_ReadApprovalComplete
  59. (
  60. IN PDEVICE_OBJECT pDeviceObject,
  61. IN PIRP pIrp,
  62. IN PVOID pContext
  63. );
  64. );
  65. NTSTATUS
  66. GCK_IP_OneTimePoll
  67. (
  68. IN PGCK_FILTER_EXT pFilterExt,
  69. );
  70. NTSTATUS
  71. GCK_IP_FullTimePoll
  72. (
  73. IN PGCK_FILTER_EXT pFilterExt,
  74. IN BOOLEAN fStart
  75. );
  76. NTSTATUS
  77. GCK_IP_ReadComplete (
  78. IN PDEVICE_OBJECT pDeviceObject,
  79. IN PIRP pIrp,
  80. IN PVOID pContext
  81. );
  82. NTSTATUS
  83. GCK_IP_Init
  84. (
  85. IN PGCK_FILTER_EXT pFilterExt
  86. );
  87. NTSTATUS
  88. GCK_IP_Cleanup
  89. (
  90. IN OUT PGCK_FILTER_EXT pFilterExt
  91. );
  92. NTSTATUS
  93. GCK_IP_CreateFileObject
  94. (
  95. OUT PFILE_OBJECT *ppFileObject,
  96. IN PDEVICE_OBJECT pPDO
  97. );