public NetrServerGetInfoResponse GetNetrWkstaGetInfoResponse(NetrServerGetInfoRequest request) { NetrServerGetInfoResponse response = new NetrServerGetInfoResponse(); if (request.Level == 100) { ServerInfo100 info = new ServerInfo100(); info.PlatformID = m_platformID; info.ServerName.Value = m_serverName; response.InfoStruct = new ServerInfo(info); } else if (request.Level == 101) { ServerInfo101 info = new ServerInfo101(); info.PlatformID = m_platformID; info.ServerName.Value = m_serverName; info.VerMajor = m_verMajor; info.VerMinor = m_verMinor; info.Type = m_serverType; info.Comment.Value = String.Empty; response.InfoStruct = new ServerInfo(info); } else { throw new NotImplementedException(); } response.Result = Win32Error.ERROR_SUCCESS; return(response); }
public NetrServerGetInfoResponse GetNetrWkstaGetInfoResponse(NetrServerGetInfoRequest request) { NetrServerGetInfoResponse response = new NetrServerGetInfoResponse(); switch (request.Level) { case 100: { ServerInfo100 info = new ServerInfo100(); info.PlatformID = m_platformID; info.ServerName.Value = m_serverName; response.InfoStruct = new ServerInfo(info); response.Result = Win32Error.ERROR_SUCCESS; return(response); } case 101: { ServerInfo101 info = new ServerInfo101(); info.PlatformID = m_platformID; info.ServerName.Value = m_serverName; info.VerMajor = m_verMajor; info.VerMinor = m_verMinor; info.Type = m_serverType; info.Comment.Value = String.Empty; response.InfoStruct = new ServerInfo(info); response.Result = Win32Error.ERROR_SUCCESS; return(response); } case 102: case 103: case 502: case 503: { response.InfoStruct = new ServerInfo(request.Level); response.Result = Win32Error.ERROR_NOT_SUPPORTED; return(response); } default: { response.InfoStruct = new ServerInfo(request.Level); response.Result = Win32Error.ERROR_INVALID_LEVEL; return(response); } } }
public void Read(NDRParser parser) { parser.BeginStructure(); // SERVER_INFO Union Level = parser.ReadUInt32(); switch (Level) { case 100: ServerInfo100 info100 = null; parser.ReadEmbeddedStructureFullPointer <ServerInfo100>(ref info100); Info = info100; break; case 101: ServerInfo101 info101 = null; parser.ReadEmbeddedStructureFullPointer <ServerInfo101>(ref info101); Info = info101; break; default: throw new NotImplementedException(); } ; parser.EndStructure(); // SERVER_INFO Union }
public NetrServerGetInfoResponse GetNetrWkstaGetInfoResponse(NetrServerGetInfoRequest request) { NetrServerGetInfoResponse response = new NetrServerGetInfoResponse(); switch (request.Level) { case 100: { response.InfoStruct = new ServerInfo { Info = new ServerInfo100 { PlatformID = m_platformID, ServerName = { Value = m_serverName } } }; response.Result = Win32Error.ERROR_SUCCESS; return(response); } case 101: { ServerInfo101 info = new ServerInfo101 { PlatformID = m_platformID, ServerName = { Value = m_serverName }, VerMajor = m_verMajor, VerMinor = m_verMinor, Type = m_serverType, Comment = { Value = string.Empty } }; response.InfoStruct = new ServerInfo(info); response.Result = Win32Error.ERROR_SUCCESS; return(response); } case 102: case 103: case 502: case 503: { response.InfoStruct = new ServerInfo(request.Level); response.Result = Win32Error.ERROR_NOT_SUPPORTED; return(response); } default: { response.InfoStruct = new ServerInfo(request.Level); response.Result = Win32Error.ERROR_INVALID_LEVEL; return(response); } } }