示例#1
0
        public NetrWkstaGetInfoResponse GetNetrWkstaGetInfoResponse(NetrWkstaGetInfoRequest request)
        {
            NetrWkstaGetInfoResponse response = new NetrWkstaGetInfoResponse();

            if (request.Level == 100)
            {
                WorkstationInfo100 info = new WorkstationInfo100();
                info.PlatformID         = m_platformID;
                info.ComputerName.Value = m_computerName;
                info.LanGroup.Value     = m_lanGroup;
                info.VerMajor           = m_verMajor;
                info.VerMinor           = m_verMinor;
                response.WkstaInfo      = new WorkstationInfo(info);
            }
            else if (request.Level == 101)
            {
                WorkstationInfo101 info = new WorkstationInfo101();
                info.PlatformID         = m_platformID;
                info.ComputerName.Value = m_computerName;
                info.LanGroup.Value     = m_lanGroup;
                info.VerMajor           = m_verMajor;
                info.VerMinor           = m_verMinor;
                info.LanRoot.Value      = m_lanGroup;
                response.WkstaInfo      = new WorkstationInfo(info);
            }
            else
            {
                throw new NotImplementedException();
            }
            response.Result = Win32Error.ERROR_SUCCESS;
            return(response);
        }
示例#2
0
        public override byte[] GetResponseBytes(ushort opNum, byte[] requestBytes)
        {
            switch ((WorkstationServiceOpName)opNum)
            {
            case WorkstationServiceOpName.NetrWkstaGetInfo:
                NetrWkstaGetInfoRequest  request  = new NetrWkstaGetInfoRequest(requestBytes);
                NetrWkstaGetInfoResponse response = GetNetrWkstaGetInfoResponse(request);
                return(response.GetBytes());

            default:
                throw new UnsupportedOpNumException();
            }
        }
示例#3
0
        public override byte[] GetResponseBytes(ushort opNum, byte[] requestBytes)
        {
            switch (opNum)
            {
            case 0:
                NetrWkstaGetInfoRequest  request  = new NetrWkstaGetInfoRequest(requestBytes);
                NetrWkstaGetInfoResponse response = GetNetrWkstaGetInfoResponse(request);
                return(response.GetBytes());

            default:
                throw new NotImplementedException();
            }
        }
        public NetrWkstaGetInfoResponse GetNetrWkstaGetInfoResponse(NetrWkstaGetInfoRequest request)
        {
            NetrWkstaGetInfoResponse response = new NetrWkstaGetInfoResponse();

            switch (request.Level)
            {
            case 100:
            {
                WorkstationInfo100 info = new WorkstationInfo100();
                info.PlatformID         = m_platformID;
                info.ComputerName.Value = m_computerName;
                info.LanGroup.Value     = m_lanGroup;
                info.VerMajor           = m_verMajor;
                info.VerMinor           = m_verMinor;
                response.WkstaInfo      = new WorkstationInfo(info);
                response.Result         = Win32Error.ERROR_SUCCESS;
                return(response);
            }

            case 101:
            {
                WorkstationInfo101 info = new WorkstationInfo101();
                info.PlatformID         = m_platformID;
                info.ComputerName.Value = m_computerName;
                info.LanGroup.Value     = m_lanGroup;
                info.VerMajor           = m_verMajor;
                info.VerMinor           = m_verMinor;
                info.LanRoot.Value      = m_lanGroup;
                response.WkstaInfo      = new WorkstationInfo(info);
                response.Result         = Win32Error.ERROR_SUCCESS;
                return(response);
            }

            case 102:
            case 502:
            {
                response.WkstaInfo = new WorkstationInfo(request.Level);
                response.Result    = Win32Error.ERROR_NOT_SUPPORTED;
                return(response);
            }

            default:
            {
                response.WkstaInfo = new WorkstationInfo(request.Level);
                response.Result    = Win32Error.ERROR_INVALID_LEVEL;
                return(response);
            }
            }
        }