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.

73 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name :
  4. devmgr.h
  5. Abstract:
  6. DeviceManager object creates/manages the devices
  7. Revision History:
  8. --*/
  9. #pragma once
  10. class DrDeviceManager : public TopObj, public ISessionPacketReceiver,
  11. public ISessionPacketSender
  12. {
  13. private:
  14. DoubleList _DeviceList;
  15. DrSession *_Session;
  16. VOID ProcessDeviceAnnounce(PRDPDR_DEVICE_ANNOUNCE DeviceAnnounce);
  17. NTSTATUS OnDeviceAnnounce(PRDPDR_HEADER RdpdrHeader, ULONG cbPacket,
  18. BOOL *DoDefaultRead);
  19. NTSTATUS OnDeviceListAnnounce(PRDPDR_HEADER RdpdrHeader, ULONG cbPacket,
  20. BOOL *DoDefaultRead);
  21. VOID ProcessDeviceRemove(PRDPDR_DEVICE_REMOVE DeviceRemove);
  22. NTSTATUS OnDeviceRemove(PRDPDR_HEADER RdpdrHeader, ULONG cbPacket,
  23. BOOL *DoDefaultRead);
  24. NTSTATUS OnDeviceListRemove(PRDPDR_HEADER RdpdrHeader, ULONG cbPacket,
  25. BOOL *DoDefaultRead);
  26. VOID DeviceReplyWrite(ULONG DeviceId, NTSTATUS Result);
  27. public:
  28. DrDeviceManager();
  29. virtual ~DrDeviceManager();
  30. BOOL FindDeviceById(ULONG DeviceId, SmartPtr<DrDevice> &DeviceFound,
  31. BOOL fMustBeValid = FALSE);
  32. BOOL FindDeviceByDosName(UCHAR* DeviceDosName, SmartPtr<DrDevice> &DeviceFound,
  33. BOOL fMustBeValid = FALSE);
  34. DoubleList &GetDevList() {
  35. return _DeviceList;
  36. }
  37. VOID Disconnect();
  38. VOID RemoveAll();
  39. BOOL Initialize(DrSession *Session);
  40. VOID Uninitialize();
  41. BOOL AddDevice(SmartPtr<DrDevice> &Device);
  42. VOID RemoveDevice(SmartPtr<DrDevice> &Device);
  43. //
  44. // ISessionPacketHandler methods
  45. //
  46. virtual BOOL RecognizePacket(PRDPDR_HEADER RdpdrHeader);
  47. virtual NTSTATUS HandlePacket(PRDPDR_HEADER RdpdrHeader, ULONG Length,
  48. BOOL *DoDefaultRead);
  49. //
  50. // ISessionPacketSender methods
  51. //
  52. virtual NTSTATUS SendCompleted(PVOID Context,
  53. PIO_STATUS_BLOCK IoStatusBlock);
  54. };