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

            if (context.Process.HandleTable.GenerateHandle(deviceInputEvent.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);
        }