private static extern uint SetVirtualServerVariableAsInt(ulong serverID, VirtualServerProperties flag, int value);
private static extern uint SetVirtualServerVariableAsString(ulong serverID, VirtualServerProperties flag, string value);
private static extern uint GetVirtualServerVariableAsString(ulong serverID, VirtualServerProperties flag, out IntPtr result);
public int getIntVariable(ulong serverID, VirtualServerProperties property) { int value = 0; if (GetServerVariableAsInt(_connectedServerID, property, out value) != Error.ok) { notifyError(string.Format("Error getting variable: {0}", property.ToString())); return 0; } return value; }
public string getStringVariable(ulong serverID, VirtualServerProperties property) { IntPtr valuePtr = IntPtr.Zero; uint result = Error.ok; if ((result = GetServerVariableAsString(_connectedServerID, property, out valuePtr)) != Error.ok) { notifyError(string.Format("Error getting variable: {0}", property.ToString())); return string.Empty; } return getStringFromPointer(valuePtr); }
static extern uint GetServerVariableAsulong(ulong serverID, VirtualServerProperties flag, out ulong result);