Example #1
0
        [CommandHipc(12)] // 3.0.0+
        // QueryAudioDeviceOutputEvent() -> handle<copy, event>
        public ResultCode QueryAudioDeviceOutputEvent(ServiceCtx context)
        {
            KEvent deviceOutputEvent = _impl.QueryAudioDeviceOutputEvent();

            if (context.Process.HandleTable.GenerateHandle(deviceOutputEvent.ReadableEvent, out int handle) != KernelResult.Success)
            {
                throw new InvalidOperationException("Out of handles!");
            }

            context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);

            Logger.Stub?.PrintStub(LogClass.ServiceAudio);

            return(ResultCode.Success);
        }