// GetActiveAudioDeviceName() -> buffer<bytes, 6> public ResultCode GetActiveAudioDeviceName(ServiceCtx context) { string name = _impl.GetActiveAudioDeviceName(); ulong position = context.Request.ReceiveBuff[0].Position; ulong size = context.Request.ReceiveBuff[0].Size; byte[] deviceNameBuffer = Encoding.ASCII.GetBytes(name + "\0"); if ((ulong)deviceNameBuffer.Length <= size) { context.Memory.Write(position, deviceNameBuffer); } else { Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); } return(ResultCode.Success); }