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); }
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); } } }
public void Read(NDRParser parser) { parser.BeginStructure(); Level = parser.ReadUInt32(); switch (Level) { case 100: WorkstationInfo100 info100 = null; parser.ReadEmbeddedStructureFullPointer <WorkstationInfo100>(ref info100); Info = info100; break; case 101: WorkstationInfo101 info101 = null; parser.ReadEmbeddedStructureFullPointer <WorkstationInfo101>(ref info101); Info = info101; break; default: throw new NotImplementedException(); } parser.EndStructure(); }