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.

40 lines
1.6 KiB

  1. #ifndef HandleMgr_h
  2. #define HandleMgr_h
  3. // This class manages an impedance mismatch between IOCT processing and KS stream
  4. // processing. Specifically, filters are passed KSPIN and IRP state, and keep
  5. // per-filter instance data in parent filter "context." This information is unavailable
  6. // to IOCT processing. However, the stream encryption and communication keys are
  7. // needed in both.
  8. // The common structure available in both worls is the FILE_HANDLE. This class contains
  9. // a list of FILE_HANDLES that can be used to map between worlds.
  10. // This is only used and referenced on IOCTL processing and for filter creation and
  11. // destruction.
  12. // todo - efficiency
  13. //-----------------------------------------------------------------------------
  14. struct ConnectStruct{
  15. PVOID handleRef; // the FILE_HANDLE
  16. STREAMKEY serverKey; // stream key for SAC in kernel
  17. CBCKey serverCBCKey; // MAC key in kernel
  18. CBCState serverCBCState; // MAC state
  19. bool secureStreamStarted; // whether we're running encrypted
  20. DWORD streamId; // StreamId
  21. };
  22. //-----------------------------------------------------------------------------
  23. class HandleMgr{
  24. public:
  25. HandleMgr();
  26. ~HandleMgr();
  27. bool newHandle(PVOID HandleRef, OUT ConnectStruct*& TheConnect);
  28. bool deleteHandle(PVOID HandleRef);
  29. ConnectStruct* getConnection(PVOID HandleRef);
  30. KCritMgr& getCritMgr(){return critMgr;};
  31. protected:
  32. KList<ConnectStruct*> connects;
  33. KCritMgr critMgr;
  34. };
  35. extern HandleMgr* TheHandleMgr;
  36. #endif