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.

62 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1998-2000 Microsoft Corporation
  3. Module Name :
  4. channel.h
  5. Abstract:
  6. Revision History:
  7. --*/
  8. #pragma once
  9. class VirtualChannel : public RefCount
  10. {
  11. private:
  12. ULONG _LowPrioChannelWriteFlags;
  13. HANDLE _Channel; // NT handle for the channel
  14. PFILE_OBJECT _ChannelFileObject; // the fileobject for the channel
  15. PDEVICE_OBJECT _ChannelDeviceObject; // the deviceobject for the channel
  16. KernelResource _HandleLock;
  17. PKEVENT _DeletionEvent;
  18. NTSTATUS CreateTermDD(HANDLE *Channel, HANDLE hIca, ULONG SessionID,
  19. ULONG ChannelId);
  20. NTSTATUS SubmitIo(IN PIO_COMPLETION_ROUTINE CompletionRoutine OPTIONAL,
  21. IN PVOID Context, OUT PVOID Buffer, IN ULONG Length,
  22. ULONG IoOperation, BOOL bWorkerItem, BOOL LowPrioWrite);
  23. static VOID IoWorker(PDEVICE_OBJECT DeviceObject, PVOID Context);
  24. NTSTATUS Io(
  25. IN PIO_COMPLETION_ROUTINE CompletionRoutine OPTIONAL,
  26. IN PVOID Context,
  27. OUT PVOID Buffer,
  28. IN ULONG Length,
  29. ULONG IoOperation,
  30. BOOL LowPrioWrite
  31. );
  32. static VOID CloseWorker(PDEVICE_OBJECT DeviceObject, PVOID Context);
  33. NTSTATUS Close();
  34. public:
  35. VirtualChannel();
  36. virtual ~VirtualChannel();
  37. BOOL Create(HANDLE hIca, ULONG SessionID, ULONG ChannelId,
  38. PKEVENT DeletionEvent);
  39. NTSTATUS Read(IN PIO_COMPLETION_ROUTINE ReadRoutine OPTIONAL,
  40. IN PVOID Context, OUT PVOID Buffer, IN ULONG Length, IN BOOL bWorkerItem);
  41. NTSTATUS Write(IN PIO_COMPLETION_ROUTINE WriteRoutine OPTIONAL,
  42. IN PVOID Context, OUT PVOID Buffer, IN ULONG Length, IN BOOL bWorkerItem,
  43. BOOL LowPrioWrite);
  44. NTSTATUS SubmitClose();
  45. };