|
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using global::System.Runtime.Versioning;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{
namespace Media.Audio
{
[Guid("00000016-0000-0000-C000-000000000046")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IMessageFilter
:IVTable<IMessageFilter,IMessageFilter.Vtbl>,IComIID {
/// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/>
internal unsafe winmdroot.Foundation.HRESULT QueryInterface(in global::System.Guid riid, out void* ppvObject)
{
fixed (void** ppvObjectLocal = &ppvObject)
{
fixed (global::System.Guid* riidLocal = &riid)
{
winmdroot.Foundation.HRESULT __result = this.QueryInterface(riidLocal, ppvObjectLocal);
return __result;
}
}
}
public unsafe winmdroot.Foundation.HRESULT QueryInterface(global::System.Guid* riid, void** ppvObject)
{
return ((delegate *unmanaged [Stdcall]<IMessageFilter*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IMessageFilter*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IMessageFilter*,uint>)lpVtbl[1])((IMessageFilter*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IMessageFilter*,uint>)lpVtbl[2])((IMessageFilter*)Unsafe.AsPointer(ref this));
}
/// <inheritdoc cref="HandleInComingCall(uint, winmdroot.Media.HTASK, uint, winmdroot.System.Com.INTERFACEINFO*)"/>
internal unsafe uint HandleInComingCall(uint dwCallType, winmdroot.Media.HTASK htaskCaller, uint dwTickCount, winmdroot.System.Com.INTERFACEINFO? lpInterfaceInfo)
{
winmdroot.System.Com.INTERFACEINFO lpInterfaceInfoLocal = lpInterfaceInfo ?? default(winmdroot.System.Com.INTERFACEINFO);
uint __result = this.HandleInComingCall(dwCallType, htaskCaller, dwTickCount, lpInterfaceInfo.HasValue ? &lpInterfaceInfoLocal : null);
return __result;
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static uint HandleInComingCall(IMessageFilter* pThis, uint dwCallType, winmdroot.Media.HTASK htaskCaller, uint dwTickCount, [Optional] winmdroot.System.Com.INTERFACEINFO* lpInterfaceInfo)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
__hr.ThrowOnFailure();
return __object.HandleInComingCall(dwCallType, htaskCaller, dwTickCount, lpInterfaceInfo);
}
catch (Exception ex)
{
global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
throw;
}
}
/// <summary>Provides a single entry point for incoming calls.</summary>
/// <param name="dwCallType">The type of incoming call that has been received. Possible values are from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ne-objidl-calltype">CALLTYPE</a>.</param>
/// <param name="htaskCaller">The thread id of the caller.</param>
/// <param name="dwTickCount">The elapsed tick count since the outgoing call was made, if <i>dwCallType</i> is not CALLTYPE_TOPLEVEL. If <i>dwCallType</i> is CALLTYPE_TOPLEVEL, <i>dwTickCount</i> should be ignored.</param>
/// <param name="lpInterfaceInfo">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-interfaceinfo">INTERFACEINFO</a> structure that identifies the object, interface, and method being called. In the case of DDE calls, <i>lpInterfaceInfo</i> can be <b>NULL</b> because the DDE layer does not return interface information.</param>
/// <returns>
/// <para>This method can return the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>If implemented, <b>HandleInComingCall</b> is called by COM when an incoming COM message is received. Depending on an application's current state, a call is either accepted and processed or rejected (permanently or temporarily). If SERVERCALL_ISHANDLED is returned, the application may be able to process the call, although success depends on the interface for which the call is destined. If the call cannot be processed, COM returns RPC_E_CALL_REJECTED. Input-synchronized and asynchronous calls are dispatched even if the application returns SERVERCALL_REJECTED or SERVERCALL_RETRYLATER. <b>HandleInComingCall</b> should not be used to hold off updates to objects during operations such as band printing. For that purpose, use <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-freeze">IViewObject::Freeze</a>. You can also use <b>HandleInComingCall</b> to set up the application's state so that the call can be processed in the future. <div class="alert"><b>Note</b> Although the <i>htaskCaller</i> parameter is typed as an HTASK, it contains the thread id of the calling thread. When you implement the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imessagefilter">IMessageFilter</a> interface, you can call the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-openthread">OpenThread</a> function to get the thread handle from the <i>htaskCaller</i> parameter, and you can call the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getprocessidofthread">GetProcessIdOfThread</a> function to get the process id.</div> <div> </div></para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-imessagefilter-handleincomingcall#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe uint HandleInComingCall(uint dwCallType, winmdroot.Media.HTASK htaskCaller, uint dwTickCount, [Optional] winmdroot.System.Com.INTERFACEINFO* lpInterfaceInfo)
{
return ((delegate *unmanaged [Stdcall]<IMessageFilter*,uint ,winmdroot.Media.HTASK ,uint ,winmdroot.System.Com.INTERFACEINFO* ,uint>)lpVtbl[3])((IMessageFilter*)Unsafe.AsPointer(ref this), dwCallType, htaskCaller, dwTickCount, lpInterfaceInfo);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static uint RetryRejectedCall(IMessageFilter* pThis, winmdroot.Media.HTASK htaskCallee, uint dwTickCount, uint dwRejectType)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
__hr.ThrowOnFailure();
return __object.RetryRejectedCall(htaskCallee, dwTickCount, dwRejectType);
}
catch (Exception ex)
{
global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
throw;
}
}
/// <summary>Provides applications with an opportunity to display a dialog box offering retry, cancel, or task-switching options.</summary>
/// <param name="htaskCallee">The thread id of the called application.</param>
/// <param name="dwTickCount">The number of elapsed ticks since the call was made.</param>
/// <param name="dwRejectType">Specifies either SERVERCALL_REJECTED or SERVERCALL_RETRYLATER, as returned by the object application.</param>
/// <returns>
/// <para>This method can return the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>COM calls <b>RetryRejectedCall</b> on the caller's <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imessagefilter">IMessageFilter</a> interface immediately after receiving SERVERCALL_RETRYLATER or SERVERCALL_REJECTED from the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imessagefilter-handleincomingcall">IMessageFilter::HandleInComingCall</a> method on the callee's <b>IMessageFilter</b> interface. If a called task rejects a call, the application is probably in a state where it cannot handle such calls, possibly only temporarily. When this occurs, COM returns to the caller and issues <b>RetryRejectedCall</b> to determine whether it should retry the rejected call. Applications should silently retry calls that have returned with SERVERCALL_RETRYLATER. If, after a reasonable amount of time has passed, say about 30 seconds, the application should display the busy dialog box; a standard implementation of this dialog box is available in the OLEDLG library. The callee may momentarily be in a state where calls can be handled. The option to wait and retry is provided for special kinds of calling applications, such as background tasks executing macros or scripts, so that they can retry the calls in a nonintrusive way. If, after a dialog box is displayed, the user chooses to cancel, <b>RetryRejectedCall</b> returns -1 and the call will appear to fail with RPC_E_CALL_REJECTED. If a client implements <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imessagefilter">IMessageFilter</a> and calls a server method on a remote machine, <b>RetryRejectedCall</b> will not be called. <div class="alert"><b>Note</b> Although the <i>htaskCallee</i> parameter is typed as an HTASK, it contains the thread id of the called thread. When you implement the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imessagefilter">IMessageFilter</a> interface, you can call the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-openthread">OpenThread</a> function to get the thread handle from the <i>htaskCallee</i> parameter, and you can call the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getprocessidofthread">GetProcessIdOfThread</a> function to get the process id.</div> <div> </div></para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-imessagefilter-retryrejectedcall#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public uint RetryRejectedCall(winmdroot.Media.HTASK htaskCallee, uint dwTickCount, uint dwRejectType)
{
return ((delegate *unmanaged [Stdcall]<IMessageFilter*,winmdroot.Media.HTASK ,uint ,uint ,uint>)lpVtbl[4])((IMessageFilter*)Unsafe.AsPointer(ref this), htaskCallee, dwTickCount, dwRejectType);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static uint MessagePending(IMessageFilter* pThis, winmdroot.Media.HTASK htaskCallee, uint dwTickCount, uint dwPendingType)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
__hr.ThrowOnFailure();
return __object.MessagePending(htaskCallee, dwTickCount, dwPendingType);
}
catch (Exception ex)
{
global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
throw;
}
}
/// <summary>Indicates that a message has arrived while COM is waiting to respond to a remote call.</summary>
/// <param name="htaskCallee">The thread id of the called application.</param>
/// <param name="dwTickCount">The number of ticks since the call was made. It is calculated from the <a href="https://docs.microsoft.com/windows/desktop/api/sysinfoapi/nf-sysinfoapi-gettickcount">GetTickCount</a> function.</param>
/// <param name="dwPendingType">The type of call made during which a message or event was received. Possible values are from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ne-objidl-pendingtype">PENDINGTYPE</a>, where PENDINGTYPE_TOPLEVEL means the outgoing call was not nested within a call from another application and PENDINTGYPE_NESTED means the outgoing call was nested within a call from another application.</param>
/// <returns>
/// <para>This method can return the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>COM calls <b>MessagePending</b> after an application has made a COM method call and a Windows message occurs before the call has returned. A Windows message is sent, for example, when the user selects a menu command or double-clicks an object. Before COM makes the <b>MessagePending</b> call, it calculates the elapsed time since the original COM method call was made. COM delivers the elapsed time in the <i>dwTickCount</i> parameter. In the meantime, COM does not remove the message from the queue. Windows messages that appear in the caller's queue should remain in the queue until sufficient time has passed to ensure that the messages are probably not the result of typing ahead, but are instead an attempt to get attention. Set the delay with the <i>dwTickCount</i> parameter —a two-second or three-second delay is recommended. If that amount of time passes and the call has not been completed, the caller should flush the messages from the queue and the OLE UI busy dialog box should be displayed offering the user the choice of retrying the call (continue waiting) or switching to the specified task. This ensures the following behaviors: </para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-imessagefilter-messagepending#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public uint MessagePending(winmdroot.Media.HTASK htaskCallee, uint dwTickCount, uint dwPendingType)
{
return ((delegate *unmanaged [Stdcall]<IMessageFilter*,winmdroot.Media.HTASK ,uint ,uint ,uint>)lpVtbl[5])((IMessageFilter*)Unsafe.AsPointer(ref this), htaskCallee, dwTickCount, dwPendingType);
}
internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv)
where T : unmanaged
{
var hr = this.QueryInterface(typeof(T).GUID, out void* pv);
if (hr.Succeeded)
{
ppv = (T*)pv;
}
else
{
ppv = null;
}
return hr;
}
internal struct Vtbl
{
internal delegate *unmanaged [Stdcall]<IMessageFilter*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IMessageFilter*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IMessageFilter*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IMessageFilter*,uint ,winmdroot.Media.HTASK ,uint ,winmdroot.System.Com.INTERFACEINFO* ,uint> HandleInComingCall_4;
internal delegate *unmanaged [Stdcall]<IMessageFilter*,winmdroot.Media.HTASK ,uint ,uint ,uint> RetryRejectedCall_5;
internal delegate *unmanaged [Stdcall]<IMessageFilter*,winmdroot.Media.HTASK ,uint ,uint ,uint> MessagePending_6;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->HandleInComingCall_4 = &HandleInComingCall;
vtable->RetryRejectedCall_5 = &RetryRejectedCall;
vtable->MessagePending_6 = &MessagePending;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{00000016-0000-0000-c000-000000000046}</value>
internal static readonly Guid IID_Guid = new Guid(0x00000016, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("00000016-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
{
[PreserveSig()]
unsafe uint HandleInComingCall(uint dwCallType, winmdroot.Media.HTASK htaskCaller, uint dwTickCount, [Optional] winmdroot.System.Com.INTERFACEINFO* lpInterfaceInfo);
[PreserveSig()]
uint RetryRejectedCall(winmdroot.Media.HTASK htaskCallee, uint dwTickCount, uint dwRejectType);
[PreserveSig()]
uint MessagePending(winmdroot.Media.HTASK htaskCallee, uint dwTickCount, uint dwPendingType);
}
}
}
}
|