12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #pragma once
- #include <map>
- #include <string>
- #include <vector>
- #include "CcosLock.h"
- #include "CcosFileHandle.h"
- using namespace std;
- class HandleManager : public CcosLock
- {
- //[LocalProc - [ LocalADDR - [OwnerMachine - [OwnerBusId - [OwnerProc - [OwnerAddr - FLAGS]]]]]]
- //map<UINT64, map<UINT64, map<string, map<string, map<UINT64, map<UINT64, DWORD>>>>>> m_HandleMap;
- map<UINT64, CcosDevFileHandle> m_CrcMap;//CRC - FileHandle
- bool CheckNotifyPacketAccessValidity(ResDataObject &packet, DWORD Flags);
- bool CheckNormalPacketAccessValidity(ResDataObject &packet, DWORD Flags);
- public:
- HandleManager();
- virtual ~HandleManager();
- void Clear();
- bool Registhandle(CcosDevFileHandle &Handle);
- bool UnRegistHandle(UINT64 CrcCode);
- void ClearRemoteHandles();
- void ClearLocalDrvHandles(vector<UINT64> &ServerSysIFList);
-
- bool GetHandle(UINT64 CrcCode, CcosDevFileHandle& filehandle);
- bool GetFileFlag(UINT64 CrcCode, UINT64 DevAddr, DWORD &fileFlag);
- void DeviceDetached(UINT64 ProcId, UINT64 Addr);
- //bool RegistHandle(UINT64 LocalProc, UINT64 LocalAddr, CcosTargetAddress &OwnerInfo, DWORD FileFlags);
- //bool UnRegistHandle(UINT64 LocalProc, UINT64 LocalAddr, CcosTargetAddress &OwnerInfo);
- //DWORD GetHandle(UINT64 LocalProc, UINT64 LocalAddr, CcosTargetAddress &OwnerInfo);
- //big check
- //-1:ignore,0:NoTarget,1:Failed,2:OK
- CMD_ECHO CheckReqPacketValidity(ResDataObject &packet, UINT64 &Addr);
- //only notify
- bool GetNotifyOwners(ResDataObject &packet, vector<CcosDevFileHandle> &OwnerList);
- };
- extern HandleManager g_HandleManager;
|