// ------------------------------------------------------------------------------ // <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,SYSLIB1092,CS3021,CS3019 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 UI.Shell { [Guid("D57C7288-D4AD-4768-BE02-9D969532D960")] [CLSCompliant(false)] [SupportedOSPlatform("windows6.0.6000")] [global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.287+85e3fa26dd.RR")] internal unsafe partial struct IFileOpenDialog :winmdroot.IVTable<IFileOpenDialog,IFileOpenDialog.Vtbl>,IComIID { /// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/> [OverloadResolutionPriority(1)] 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]<IFileOpenDialog*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IFileOpenDialog*)Unsafe.AsPointer(ref this), riid, ppvObject); } public uint AddRef() { return ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint>)lpVtbl[1])((IFileOpenDialog*)Unsafe.AsPointer(ref this)); } public uint Release() { return ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint>)lpVtbl[2])((IFileOpenDialog*)Unsafe.AsPointer(ref this)); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT Show(IFileOpenDialog* pThis, [Optional] winmdroot.Foundation.HWND hwndOwner) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.Show(hwndOwner); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public winmdroot.Foundation.HRESULT Show([Optional] winmdroot.Foundation.HWND hwndOwner) { return ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.HWND ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IFileOpenDialog*)Unsafe.AsPointer(ref this), hwndOwner); } /// <inheritdoc cref="SetFileTypes(uint, winmdroot.UI.Shell.Common.COMDLG_FILTERSPEC*)"/> internal unsafe void SetFileTypes(ReadOnlySpan<winmdroot.UI.Shell.Common.COMDLG_FILTERSPEC> rgFilterSpec) { fixed (winmdroot.UI.Shell.Common.COMDLG_FILTERSPEC* rgFilterSpecLocal = rgFilterSpec) { this.SetFileTypes((uint )rgFilterSpec.Length, rgFilterSpecLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetFileTypes(IFileOpenDialog* pThis, uint cFileTypes, winmdroot.UI.Shell.Common.COMDLG_FILTERSPEC* rgFilterSpec) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetFileTypes(cFileTypes, rgFilterSpec); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void SetFileTypes(uint cFileTypes, winmdroot.UI.Shell.Common.COMDLG_FILTERSPEC* rgFilterSpec) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint ,winmdroot.UI.Shell.Common.COMDLG_FILTERSPEC* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IFileOpenDialog*)Unsafe.AsPointer(ref this), cFileTypes, rgFilterSpec).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetFileTypeIndex(IFileOpenDialog* pThis, uint iFileType) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetFileTypeIndex(iFileType); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void SetFileTypeIndex(uint iFileType) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IFileOpenDialog*)Unsafe.AsPointer(ref this), iFileType).ThrowOnFailure(); } /// <inheritdoc cref="GetFileTypeIndex(uint*)"/> [OverloadResolutionPriority(1)] internal unsafe void GetFileTypeIndex(out uint piFileType) { fixed (uint* piFileTypeLocal = &piFileType) { this.GetFileTypeIndex(piFileTypeLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetFileTypeIndex(IFileOpenDialog* pThis, uint* piFileType) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetFileTypeIndex(piFileType); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void GetFileTypeIndex(uint* piFileType) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IFileOpenDialog*)Unsafe.AsPointer(ref this), piFileType).ThrowOnFailure(); } /// <inheritdoc cref="Advise(winmdroot.UI.Shell.IFileDialogEvents*, uint*)"/> [OverloadResolutionPriority(1)] internal unsafe void Advise(winmdroot.UI.Shell.IFileDialogEvents* pfde, out uint pdwCookie) { fixed (uint* pdwCookieLocal = &pdwCookie) { this.Advise(pfde, pdwCookieLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT Advise(IFileOpenDialog* pThis, winmdroot.UI.Shell.IFileDialogEvents* pfde, uint* pdwCookie) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.Advise(pfde, pdwCookie); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void Advise(winmdroot.UI.Shell.IFileDialogEvents* pfde, uint* pdwCookie) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IFileDialogEvents* ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IFileOpenDialog*)Unsafe.AsPointer(ref this), pfde, pdwCookie).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT Unadvise(IFileOpenDialog* pThis, uint dwCookie) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.Unadvise(dwCookie); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void Unadvise(uint dwCookie) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IFileOpenDialog*)Unsafe.AsPointer(ref this), dwCookie).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetOptions(IFileOpenDialog* pThis, winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS fos) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetOptions(fos); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void SetOptions(winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS fos) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IFileOpenDialog*)Unsafe.AsPointer(ref this), fos).ThrowOnFailure(); } /// <inheritdoc cref="GetOptions(winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS*)"/> [OverloadResolutionPriority(1)] internal unsafe void GetOptions(out winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS pfos) { fixed (winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS* pfosLocal = &pfos) { this.GetOptions(pfosLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetOptions(IFileOpenDialog* pThis, winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS* pfos) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetOptions(pfos); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void GetOptions(winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS* pfos) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS* ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IFileOpenDialog*)Unsafe.AsPointer(ref this), pfos).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetDefaultFolder(IFileOpenDialog* pThis, winmdroot.UI.Shell.IShellItem* psi) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetDefaultFolder(psi); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void SetDefaultFolder(winmdroot.UI.Shell.IShellItem* psi) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem* ,winmdroot.Foundation.HRESULT>)lpVtbl[11])((IFileOpenDialog*)Unsafe.AsPointer(ref this), psi).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetFolder(IFileOpenDialog* pThis, winmdroot.UI.Shell.IShellItem* psi) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetFolder(psi); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void SetFolder(winmdroot.UI.Shell.IShellItem* psi) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem* ,winmdroot.Foundation.HRESULT>)lpVtbl[12])((IFileOpenDialog*)Unsafe.AsPointer(ref this), psi).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetFolder(IFileOpenDialog* pThis, winmdroot.UI.Shell.IShellItem** ppsi) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetFolder(ppsi); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void GetFolder(winmdroot.UI.Shell.IShellItem** ppsi) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem** ,winmdroot.Foundation.HRESULT>)lpVtbl[13])((IFileOpenDialog*)Unsafe.AsPointer(ref this), ppsi).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetCurrentSelection(IFileOpenDialog* pThis, winmdroot.UI.Shell.IShellItem** ppsi) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetCurrentSelection(ppsi); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void GetCurrentSelection(winmdroot.UI.Shell.IShellItem** ppsi) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem** ,winmdroot.Foundation.HRESULT>)lpVtbl[14])((IFileOpenDialog*)Unsafe.AsPointer(ref this), ppsi).ThrowOnFailure(); } /// <inheritdoc cref="SetFileName(winmdroot.Foundation.PCWSTR)"/> [OverloadResolutionPriority(1)] internal unsafe void SetFileName(string pszName) { fixed (char* pszNameLocal = pszName) { this.SetFileName(pszNameLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetFileName(IFileOpenDialog* pThis, winmdroot.Foundation.PCWSTR pszName) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetFileName(pszName); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void SetFileName(winmdroot.Foundation.PCWSTR pszName) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[15])((IFileOpenDialog*)Unsafe.AsPointer(ref this), pszName).ThrowOnFailure(); } /// <inheritdoc cref="GetFileName(winmdroot.Foundation.PWSTR*)"/> [OverloadResolutionPriority(1)] internal unsafe void GetFileName(out winmdroot.Foundation.PWSTR pszName) { fixed (winmdroot.Foundation.PWSTR* pszNameLocal = &pszName) { this.GetFileName(pszNameLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetFileName(IFileOpenDialog* pThis, winmdroot.Foundation.PWSTR* pszName) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetFileName(pszName); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void GetFileName(winmdroot.Foundation.PWSTR* pszName) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PWSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[16])((IFileOpenDialog*)Unsafe.AsPointer(ref this), pszName).ThrowOnFailure(); } /// <inheritdoc cref="SetTitle(winmdroot.Foundation.PCWSTR)"/> [OverloadResolutionPriority(1)] internal unsafe void SetTitle(string pszTitle) { fixed (char* pszTitleLocal = pszTitle) { this.SetTitle(pszTitleLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetTitle(IFileOpenDialog* pThis, winmdroot.Foundation.PCWSTR pszTitle) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetTitle(pszTitle); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void SetTitle(winmdroot.Foundation.PCWSTR pszTitle) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[17])((IFileOpenDialog*)Unsafe.AsPointer(ref this), pszTitle).ThrowOnFailure(); } /// <inheritdoc cref="SetOkButtonLabel(winmdroot.Foundation.PCWSTR)"/> [OverloadResolutionPriority(1)] internal unsafe void SetOkButtonLabel(string pszText) { fixed (char* pszTextLocal = pszText) { this.SetOkButtonLabel(pszTextLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetOkButtonLabel(IFileOpenDialog* pThis, winmdroot.Foundation.PCWSTR pszText) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetOkButtonLabel(pszText); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void SetOkButtonLabel(winmdroot.Foundation.PCWSTR pszText) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[18])((IFileOpenDialog*)Unsafe.AsPointer(ref this), pszText).ThrowOnFailure(); } /// <inheritdoc cref="SetFileNameLabel(winmdroot.Foundation.PCWSTR)"/> [OverloadResolutionPriority(1)] internal unsafe void SetFileNameLabel(string pszLabel) { fixed (char* pszLabelLocal = pszLabel) { this.SetFileNameLabel(pszLabelLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetFileNameLabel(IFileOpenDialog* pThis, winmdroot.Foundation.PCWSTR pszLabel) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetFileNameLabel(pszLabel); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void SetFileNameLabel(winmdroot.Foundation.PCWSTR pszLabel) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[19])((IFileOpenDialog*)Unsafe.AsPointer(ref this), pszLabel).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetResult(IFileOpenDialog* pThis, winmdroot.UI.Shell.IShellItem** ppsi) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetResult(ppsi); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void GetResult(winmdroot.UI.Shell.IShellItem** ppsi) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem** ,winmdroot.Foundation.HRESULT>)lpVtbl[20])((IFileOpenDialog*)Unsafe.AsPointer(ref this), ppsi).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT AddPlace(IFileOpenDialog* pThis, winmdroot.UI.Shell.IShellItem* psi, winmdroot.UI.Shell.FDAP fdap) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.AddPlace(psi, fdap); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void AddPlace(winmdroot.UI.Shell.IShellItem* psi, winmdroot.UI.Shell.FDAP fdap) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem* ,winmdroot.UI.Shell.FDAP ,winmdroot.Foundation.HRESULT>)lpVtbl[21])((IFileOpenDialog*)Unsafe.AsPointer(ref this), psi, fdap).ThrowOnFailure(); } /// <inheritdoc cref="SetDefaultExtension(winmdroot.Foundation.PCWSTR)"/> [OverloadResolutionPriority(1)] internal unsafe void SetDefaultExtension(string pszDefaultExtension) { fixed (char* pszDefaultExtensionLocal = pszDefaultExtension) { this.SetDefaultExtension(pszDefaultExtensionLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetDefaultExtension(IFileOpenDialog* pThis, winmdroot.Foundation.PCWSTR pszDefaultExtension) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetDefaultExtension(pszDefaultExtension); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void SetDefaultExtension(winmdroot.Foundation.PCWSTR pszDefaultExtension) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[22])((IFileOpenDialog*)Unsafe.AsPointer(ref this), pszDefaultExtension).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT Close(IFileOpenDialog* pThis, winmdroot.Foundation.HRESULT hr) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.Close(hr); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void Close(winmdroot.Foundation.HRESULT hr) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.HRESULT ,winmdroot.Foundation.HRESULT>)lpVtbl[23])((IFileOpenDialog*)Unsafe.AsPointer(ref this), hr).ThrowOnFailure(); } /// <inheritdoc cref="SetClientGuid(global::System.Guid*)"/> [OverloadResolutionPriority(1)] internal unsafe void SetClientGuid(in global::System.Guid guid) { fixed (global::System.Guid* guidLocal = &guid) { this.SetClientGuid(guidLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetClientGuid(IFileOpenDialog* pThis, global::System.Guid* guid) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetClientGuid(guid); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void SetClientGuid(global::System.Guid* guid) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,global::System.Guid* ,winmdroot.Foundation.HRESULT>)lpVtbl[24])((IFileOpenDialog*)Unsafe.AsPointer(ref this), guid).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT ClearClientData(IFileOpenDialog* pThis) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.ClearClientData(); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void ClearClientData() { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.HRESULT>)lpVtbl[25])((IFileOpenDialog*)Unsafe.AsPointer(ref this)).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT SetFilter(IFileOpenDialog* pThis, winmdroot.UI.Shell.IShellItemFilter* pFilter) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.SetFilter(pFilter); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void SetFilter(winmdroot.UI.Shell.IShellItemFilter* pFilter) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItemFilter* ,winmdroot.Foundation.HRESULT>)lpVtbl[26])((IFileOpenDialog*)Unsafe.AsPointer(ref this), pFilter).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetResults(IFileOpenDialog* pThis, winmdroot.UI.Shell.IShellItemArray** ppenum) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetResults(ppenum); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Gets the user's choices in a dialog that allows multiple selection.</summary> /// <param name="ppenum"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitemarray">IShellItemArray</a>**</b> The address of a pointer to an <b>IShellItemArray</b> through which the items selected in the dialog can be accessed.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileopendialog-getresults#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para> /// </returns> /// <remarks> /// <para>This method can be used whether the selection consists of a single item or multiple items. <b>IFileOpenDialog::GetResults</b> can be called after the dialog has closed or during the handling of an IFileDialogEvents::OnFileOk event. Calling this method at any other time will fail.</para> /// <para><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nf-shobjidl_core-imodalwindow-show">Show</a> must return a success code for a result to be available to <b>IFileOpenDialog::GetResults</b>.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileopendialog-getresults#">Read more on learn.microsoft.com</see>.</para> /// </remarks> public unsafe winmdroot.Foundation.HRESULT GetResults(winmdroot.UI.Shell.IShellItemArray** ppenum) { return ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItemArray** ,winmdroot.Foundation.HRESULT>)lpVtbl[27])((IFileOpenDialog*)Unsafe.AsPointer(ref this), ppenum); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetSelectedItems(IFileOpenDialog* pThis, winmdroot.UI.Shell.IShellItemArray** ppsai) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetSelectedItems(ppsai); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Gets the currently selected items in the dialog. These items may be items selected in the view, or text selected in the file name edit box.</summary> /// <param name="ppsai"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitemarray">IShellItemArray</a>**</b> The address of a pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitemarray">IShellItemArray</a> through which the selected items can be accessed.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileopendialog-getselecteditems#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para> /// </returns> /// <remarks>This method can be used for single item or multiple item selections. If the user has entered new text in the file name field, this can be a time-consuming operation. When the application calls this method, the application parses the text in the <c>filename</c> field. For example, if this is a network share, the operation could take some time. However, this operation will not block the UI, since the user should able to stop the operation, which will result in <b>IFileOpenDialog::GetSelectedItems</b> returning a failure code).</remarks> public unsafe void GetSelectedItems(winmdroot.UI.Shell.IShellItemArray** ppsai) { ((delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItemArray** ,winmdroot.Foundation.HRESULT>)lpVtbl[28])((IFileOpenDialog*)Unsafe.AsPointer(ref this), ppsai).ThrowOnFailure(); } internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv) where T : unmanaged { Guid guid = typeof(T).GUID; void* pv; var hr = this.QueryInterface(&guid, &pv); if (hr.Succeeded) { ppv = (T*)pv; } else { ppv = null; } return hr; } internal struct Vtbl { internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint> AddRef_2; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint> Release_3; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.HWND ,winmdroot.Foundation.HRESULT> Show_4; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint ,winmdroot.UI.Shell.Common.COMDLG_FILTERSPEC* ,winmdroot.Foundation.HRESULT> SetFileTypes_5; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint ,winmdroot.Foundation.HRESULT> SetFileTypeIndex_6; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint* ,winmdroot.Foundation.HRESULT> GetFileTypeIndex_7; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IFileDialogEvents* ,uint* ,winmdroot.Foundation.HRESULT> Advise_8; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,uint ,winmdroot.Foundation.HRESULT> Unadvise_9; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS ,winmdroot.Foundation.HRESULT> SetOptions_10; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS* ,winmdroot.Foundation.HRESULT> GetOptions_11; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem* ,winmdroot.Foundation.HRESULT> SetDefaultFolder_12; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem* ,winmdroot.Foundation.HRESULT> SetFolder_13; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem** ,winmdroot.Foundation.HRESULT> GetFolder_14; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem** ,winmdroot.Foundation.HRESULT> GetCurrentSelection_15; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT> SetFileName_16; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PWSTR* ,winmdroot.Foundation.HRESULT> GetFileName_17; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT> SetTitle_18; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT> SetOkButtonLabel_19; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT> SetFileNameLabel_20; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem** ,winmdroot.Foundation.HRESULT> GetResult_21; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItem* ,winmdroot.UI.Shell.FDAP ,winmdroot.Foundation.HRESULT> AddPlace_22; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT> SetDefaultExtension_23; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.HRESULT ,winmdroot.Foundation.HRESULT> Close_24; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,global::System.Guid* ,winmdroot.Foundation.HRESULT> SetClientGuid_25; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.Foundation.HRESULT> ClearClientData_26; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItemFilter* ,winmdroot.Foundation.HRESULT> SetFilter_27; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItemArray** ,winmdroot.Foundation.HRESULT> GetResults_28; internal delegate *unmanaged [Stdcall]<IFileOpenDialog*,winmdroot.UI.Shell.IShellItemArray** ,winmdroot.Foundation.HRESULT> GetSelectedItems_29; } public static void PopulateVTable(Vtbl* vtable) { vtable->Show_4 = &Show; vtable->SetFileTypes_5 = &SetFileTypes; vtable->SetFileTypeIndex_6 = &SetFileTypeIndex; vtable->GetFileTypeIndex_7 = &GetFileTypeIndex; vtable->Advise_8 = &Advise; vtable->Unadvise_9 = &Unadvise; vtable->SetOptions_10 = &SetOptions; vtable->GetOptions_11 = &GetOptions; vtable->SetDefaultFolder_12 = &SetDefaultFolder; vtable->SetFolder_13 = &SetFolder; vtable->GetFolder_14 = &GetFolder; vtable->GetCurrentSelection_15 = &GetCurrentSelection; vtable->SetFileName_16 = &SetFileName; vtable->GetFileName_17 = &GetFileName; vtable->SetTitle_18 = &SetTitle; vtable->SetOkButtonLabel_19 = &SetOkButtonLabel; vtable->SetFileNameLabel_20 = &SetFileNameLabel; vtable->GetResult_21 = &GetResult; vtable->AddPlace_22 = &AddPlace; vtable->SetDefaultExtension_23 = &SetDefaultExtension; vtable->Close_24 = &Close; vtable->SetClientGuid_25 = &SetClientGuid; vtable->ClearClientData_26 = &ClearClientData; vtable->SetFilter_27 = &SetFilter; vtable->GetResults_28 = &GetResults; vtable->GetSelectedItems_29 = &GetSelectedItems; } private void** lpVtbl; /// <summary>The IID guid for this interface.</summary> /// <value>{d57c7288-d4ad-4768-be02-9d969532d960}</value> internal static readonly Guid IID_Guid = new Guid(0xD57C7288, 0xD4AD, 0x4768, 0xBE, 0x02, 0x9D, 0x96, 0x95, 0x32, 0xD9, 0x60); static ref readonly Guid IComIID.Guid { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ReadOnlySpan<byte> data = new byte[] { 0x88,0x72,0x7C,0xD5,0xAD,0xD4,0x68,0x47,0xBE,0x02,0x9D,0x96,0x95,0x32,0xD9,0x60 }; return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data)); } } [Guid("D57C7288-D4AD-4768-BE02-9D969532D960"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()] [SupportedOSPlatform("windows6.0.6000")] internal interface Interface :winmdroot.UI.Shell.IFileDialog.Interface { [PreserveSig()] new winmdroot.Foundation.HRESULT Show([Optional] winmdroot.Foundation.HWND hwndOwner); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT SetFileTypes(uint cFileTypes, winmdroot.UI.Shell.Common.COMDLG_FILTERSPEC* rgFilterSpec); [PreserveSig()] new winmdroot.Foundation.HRESULT SetFileTypeIndex(uint iFileType); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT GetFileTypeIndex(uint* piFileType); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT Advise(winmdroot.UI.Shell.IFileDialogEvents* pfde, uint* pdwCookie); [PreserveSig()] new winmdroot.Foundation.HRESULT Unadvise(uint dwCookie); [PreserveSig()] new winmdroot.Foundation.HRESULT SetOptions(winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS fos); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT GetOptions(winmdroot.UI.Shell.FILEOPENDIALOGOPTIONS* pfos); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT SetDefaultFolder(winmdroot.UI.Shell.IShellItem* psi); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT SetFolder(winmdroot.UI.Shell.IShellItem* psi); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT GetFolder(winmdroot.UI.Shell.IShellItem** ppsi); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT GetCurrentSelection(winmdroot.UI.Shell.IShellItem** ppsi); [PreserveSig()] new winmdroot.Foundation.HRESULT SetFileName(winmdroot.Foundation.PCWSTR pszName); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT GetFileName(winmdroot.Foundation.PWSTR* pszName); [PreserveSig()] new winmdroot.Foundation.HRESULT SetTitle(winmdroot.Foundation.PCWSTR pszTitle); [PreserveSig()] new winmdroot.Foundation.HRESULT SetOkButtonLabel(winmdroot.Foundation.PCWSTR pszText); [PreserveSig()] new winmdroot.Foundation.HRESULT SetFileNameLabel(winmdroot.Foundation.PCWSTR pszLabel); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT GetResult(winmdroot.UI.Shell.IShellItem** ppsi); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT AddPlace(winmdroot.UI.Shell.IShellItem* psi, winmdroot.UI.Shell.FDAP fdap); [PreserveSig()] new winmdroot.Foundation.HRESULT SetDefaultExtension(winmdroot.Foundation.PCWSTR pszDefaultExtension); [PreserveSig()] new winmdroot.Foundation.HRESULT Close(winmdroot.Foundation.HRESULT hr); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT SetClientGuid(global::System.Guid* guid); [PreserveSig()] new winmdroot.Foundation.HRESULT ClearClientData(); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT SetFilter(winmdroot.UI.Shell.IShellItemFilter* pFilter); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetResults(winmdroot.UI.Shell.IShellItemArray** ppenum); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetSelectedItems(winmdroot.UI.Shell.IShellItemArray** ppsai); } } } }