Added nullability to Multimedia

nullableenabled
David Hall 2023-09-06 17:06:05 -06:00
parent 8eab47487b
commit 039c96229b
22 changed files with 215 additions and 146 deletions

View File

@ -1,6 +1,3 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke;
public static partial class WinMm

View File

@ -1,8 +1,3 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using Vanara.InteropServices;
using static Vanara.PInvoke.WinMm;
namespace Vanara.PInvoke;
@ -3760,7 +3755,7 @@ public static partial class MsAcm32
/// title (that is, "Filter Selection").
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszTitle;
public string? pszTitle;
/// <summary>
/// Buffer containing a null-terminated string describing the filter tag of the filter selection when the ACMFILTERTAGDETAILS
@ -3843,7 +3838,7 @@ public static partial class MsAcm32
/// otherwise, this member should be <c>NULL</c> on input.
/// </summary>
[MarshalAs(UnmanagedType.LPStr)]
public string pszTemplateName;
public string? pszTemplateName;
/// <summary>
/// Application-defined data that the ACM passes to the hook function identified by the <c>pfnHook</c> member. The system passes
@ -4161,7 +4156,7 @@ public static partial class MsAcm32
/// title (that is, "Sound Selection").
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszTitle;
public string? pszTitle;
/// <summary>
/// Buffer containing a null-terminated string describing the format tag of the format selection when the ACMFORMATTAGDETAILS
@ -4289,7 +4284,7 @@ public static partial class MsAcm32
/// otherwise, this member should be <c>NULL</c> on input.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszTemplateName;
public string? pszTemplateName;
/// <summary>
/// Application-defined data that the ACM passes to the hook function identified by the <c>pfnHook</c> member. The system passes
@ -4662,7 +4657,7 @@ public static partial class MsAcm32
public static bool operator ==(HACMDRIVER h1, HACMDRIVER h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HACMDRIVER h && handle == h.handle;
public override bool Equals(object? obj) => obj is HACMDRIVER h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -4710,7 +4705,7 @@ public static partial class MsAcm32
public static bool operator ==(HACMDRIVERID h1, HACMDRIVERID h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HACMDRIVERID h && handle == h.handle;
public override bool Equals(object? obj) => obj is HACMDRIVERID h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -4758,7 +4753,7 @@ public static partial class MsAcm32
public static bool operator ==(HACMOBJ h1, HACMOBJ h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HACMOBJ h && handle == h.handle;
public override bool Equals(object? obj) => obj is HACMOBJ h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -4806,7 +4801,7 @@ public static partial class MsAcm32
public static bool operator ==(HACMSTREAM h1, HACMSTREAM h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HACMSTREAM h && handle == h.handle;
public override bool Equals(object? obj) => obj is HACMSTREAM h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();

View File

@ -1,6 +1,3 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke;
/// <summary>Items from the WinMm.dll</summary>

View File

@ -1,8 +1,3 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
using Vanara.InteropServices;
namespace Vanara.PInvoke;
public static partial class WinMm
@ -970,6 +965,113 @@ public static partial class WinMm
[PInvokeData("mmiscapi.h", MSDNShortId = "NF:mmiscapi.mmioDescend")]
public static extern MMRESULT mmioDescend(HMMIO hmmio, ref MMCKINFO pmmcki, in MMCKINFO pmmckiParent, MMIODESC fuDescend);
/// <summary>
/// The <c>mmioDescend</c> function descends into a chunk of a RIFF file that was opened by using the mmioOpen function. It can also
/// search for a given chunk.
/// </summary>
/// <param name="hmmio">File handle of an open RIFF file.</param>
/// <param name="pmmcki">Pointer to a buffer that receives an MMCKINFO structure.</param>
/// <param name="pmmckiParent">
/// Pointer to an optional application-defined MMCKINFO structure identifying the parent of the chunk being searched for. If this
/// parameter is not <c>NULL</c>, <c>mmioDescend</c> assumes the <c>MMCKINFO</c> structure it refers to was filled when
/// <c>mmioDescend</c> was called to descend into the parent chunk, and <c>mmioDescend</c> searches for a chunk within the parent
/// chunk. Set this parameter to <c>NULL</c> if no parent chunk is being specified.
/// </param>
/// <param name="fuDescend">
/// <para>
/// Search flags. If no flags are specified, <c>mmioDescend</c> descends into the chunk beginning at the current file position. The
/// following values are defined.
/// </para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>MMIO_FINDCHUNK</term>
/// <term>Searches for a chunk with the specified chunk identifier.</term>
/// </item>
/// <item>
/// <term>MMIO_FINDLIST</term>
/// <term>Searches for a chunk with the chunk identifier "LIST" and with the specified form type.</term>
/// </item>
/// <item>
/// <term>MMIO_FINDRIFF</term>
/// <term>Searches for a chunk with the chunk identifier "RIFF" and with the specified form type.</term>
/// </item>
/// </list>
/// </param>
/// <returns>
/// <para>Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following.</para>
/// <list type="table">
/// <listheader>
/// <term>Return code</term>
/// <term>Description</term>
/// </listheader>
/// <item>
/// <term>MMIOERR_CHUNKNOTFOUND</term>
/// <term>The end of the file (or the end of the parent chunk, if given) was reached before the desired chunk was found.</term>
/// </item>
/// </list>
/// </returns>
/// <remarks>
/// <para>
/// A "RIFF" chunk consists of a four-byte chunk identifier (type <c>FOURCC</c>), followed by a four-byte chunk size (type
/// <c>DWORD</c>), followed by the data portion of the chunk, followed by a null pad byte if the size of the data portion is odd. If
/// the chunk identifier is "RIFF" or "LIST", the first four bytes of the data portion of the chunk are a form type or list type
/// (type <c>FOURCC</c>).
/// </para>
/// <para>
/// If you use <c>mmioDescend</c> to search for a chunk, make sure the file position is at the beginning of a chunk before calling
/// the function. The search begins at the current file position and continues to the end of the file. If a parent chunk is
/// specified, the file position should be somewhere within the parent chunk before calling <c>mmioDescend</c>. In this case, the
/// search begins at the current file position and continues to the end of the parent chunk.
/// </para>
/// <para>
/// If <c>mmioDescend</c> is unsuccessful in searching for a chunk, the current file position is undefined. If <c>mmioDescend</c> is
/// successful, the current file position is changed. If the chunk is a "RIFF" or "LIST" chunk, the new file position will be just
/// after the form type or list type (12 bytes from the beginning of the chunk). For other chunks, the new file position will be the
/// start of the data portion of the chunk (8 bytes from the beginning of the chunk).
/// </para>
/// <para>The <c>mmioDescend</c> function fills the MMCKINFO structure pointed to by the lpck parameter with the following information:</para>
/// <list type="bullet">
/// <item>
/// <term>
/// The <c>ckid</c> member is the chunk. If the MMIO_FINDCHUNK, MMIO_FINDRIFF, or MMIO_FINDLIST flag is specified for <c>wFlags</c>,
/// the MMCKINFO structure is also used to pass parameters to <c>mmioDescend</c>. In this case, the <c>ckid</c> member specifies the
/// four-character code of the chunk identifier, form type, or list type to search for.
/// </term>
/// </item>
/// <item>
/// <term>
/// The <c>cksize</c> member is the size, in bytes, of the data portion of the chunk. The size includes the form type or list type
/// (if any), but does not include the 8-byte chunk header or the pad byte at the end of the data (if any).
/// </term>
/// </item>
/// <item>
/// <term>
/// The <c>fccType</c> member is the form type if <c>ckid</c> is "RIFF", or the list type if <c>ckid</c> is "LIST". Otherwise, it is <c>NULL</c>.
/// </term>
/// </item>
/// <item>
/// <term>
/// The <c>dwDataOffset</c> member is the file offset of the beginning of the data portion of the chunk. If the chunk is a "RIFF"
/// chunk or a "LIST" chunk, this member is the offset of the form type or list type.
/// </term>
/// </item>
/// <item>
/// <term>
/// The <c>dwFlags</c> member contains other information about the chunk. Currently, this information is not used and is set to zero.
/// </term>
/// </item>
/// </list>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/mmiscapi/nf-mmiscapi-mmiodescend MMRESULT mmioDescend( HMMIO hmmio, LPMMCKINFO
// pmmcki, const MMCKINFO *pmmckiParent, UINT fuDescend );
[DllImport(Lib_Winmm, SetLastError = false, ExactSpelling = true)]
[PInvokeData("mmiscapi.h", MSDNShortId = "NF:mmiscapi.mmioDescend")]
public static extern MMRESULT mmioDescend(HMMIO hmmio, ref MMCKINFO pmmcki, [In, Optional] IntPtr pmmckiParent, MMIODESC fuDescend);
/// <summary>The <c>mmioFlush</c> function writes the I/O buffer of a file to disk if the buffer has been written to.</summary>
/// <param name="hmmio">File handle of a file opened by using the mmioOpen function.</param>
/// <param name="fuFlush">
@ -1108,7 +1210,7 @@ public static partial class WinMm
[DllImport(Lib_Winmm, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("mmiscapi.h", MSDNShortId = "NF:mmiscapi.mmioInstallIOProc")]
[return: MarshalAs(UnmanagedType.FunctionPtr)]
public static extern MMIOPROC mmioInstallIOProc(uint fccIOProc, [In, Optional] MMIOPROC pIOProc, MMIOINST dwFlags);
public static extern MMIOPROC mmioInstallIOProc(uint fccIOProc, [In, Optional] MMIOPROC? pIOProc, MMIOINST dwFlags);
/// <summary>
/// <para>
@ -1364,7 +1466,7 @@ public static partial class WinMm
// pmmioinfo, DWORD fdwOpen );
[DllImport(Lib_Winmm, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("mmiscapi.h", MSDNShortId = "NF:mmiscapi.mmioOpen")]
public static extern HMMIO mmioOpen([In, Out, MarshalAs(UnmanagedType.LPTStr)] StringBuilder pszFileName, ref MMIOINFO pmmioinfo, MMIO fdwOpen);
public static extern HMMIO mmioOpen([In, Out, MarshalAs(UnmanagedType.LPTStr)] StringBuilder? pszFileName, ref MMIOINFO pmmioinfo, MMIO fdwOpen);
/// <summary>
/// <para>
@ -1620,7 +1722,7 @@ public static partial class WinMm
// pmmioinfo, DWORD fdwOpen );
[DllImport(Lib_Winmm, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("mmiscapi.h", MSDNShortId = "NF:mmiscapi.mmioOpen")]
public static extern HMMIO mmioOpen([In, Out, MarshalAs(UnmanagedType.LPTStr)] StringBuilder pszFileName, [In, Optional] IntPtr pmmioinfo, MMIO fdwOpen);
public static extern HMMIO mmioOpen([In, Out, MarshalAs(UnmanagedType.LPTStr)] StringBuilder? pszFileName, [In, Optional] IntPtr pmmioinfo, MMIO fdwOpen);
/// <summary>The <c>mmioRead</c> function reads a specified number of bytes from a file opened by using the mmioOpen function.</summary>
/// <param name="hmmio">File handle of the file to be read.</param>
@ -1772,7 +1874,7 @@ public static partial class WinMm
// pchBuffer, LONG cchBuffer, UINT fuBuffer );
[DllImport(Lib_Winmm, SetLastError = false, ExactSpelling = true)]
[PInvokeData("mmiscapi.h", MSDNShortId = "NF:mmiscapi.mmioSetBuffer")]
public static extern MMRESULT mmioSetBuffer(HMMIO hmmio, [Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder pchBuffer, int cchBuffer, uint fuBuffer = 0);
public static extern MMRESULT mmioSetBuffer(HMMIO hmmio, [Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder? pchBuffer, int cchBuffer, uint fuBuffer = 0);
/// <summary>
/// The <c>mmioSetInfo</c> function updates the information retrieved by the mmioGetInfo function about a file opened by using the
@ -1969,7 +2071,7 @@ public static partial class WinMm
public static bool operator ==(HDRVR h1, HDRVR h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HDRVR h && handle == h.handle;
public override bool Equals(object? obj) => obj is HDRVR h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -2017,7 +2119,7 @@ public static partial class WinMm
public static bool operator ==(HMMIO h1, HMMIO h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HMMIO h && handle == h.handle;
public override bool Equals(object? obj) => obj is HMMIO h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();

View File

@ -1,6 +1,3 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke;
/// <summary>Items from the WinMm.dll</summary>

View File

@ -1,6 +1,3 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke;
public static partial class WinMm

View File

@ -1,6 +1,3 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke;
/// <summary>Items from the WinMm.dll</summary>
@ -369,5 +366,5 @@ public static partial class WinMm
[DllImport(Lib_Winmm, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("Mmsystem.h")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool sndPlaySound([In, Optional] string? lpszSound, uint fuSound);
public static extern bool sndPlaySound([In, Optional] string? lpszSound, SND fuSound);
}

View File

@ -1,9 +1,3 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Vanara.PInvoke;
/// <summary>Items from the WinMm.dll</summary>

View File

@ -1,9 +1,3 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Vanara.PInvoke;
/// <summary>Items from the WinMm.dll</summary>
@ -2299,7 +2293,7 @@ public static partial class WinMm
public static bool operator ==(HMIDI h1, HMIDI h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HMIDI h && handle == h.handle;
public override bool Equals(object? obj) => obj is HMIDI h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -2347,7 +2341,7 @@ public static partial class WinMm
public static bool operator ==(HMIDIIN h1, HMIDIIN h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HMIDIIN h && handle == h.handle;
public override bool Equals(object? obj) => obj is HMIDIIN h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -2395,7 +2389,7 @@ public static partial class WinMm
public static bool operator ==(HMIDIOUT h1, HMIDIOUT h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HMIDIOUT h && handle == h.handle;
public override bool Equals(object? obj) => obj is HMIDIOUT h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -2443,7 +2437,7 @@ public static partial class WinMm
public static bool operator ==(HMIDISTRM h1, HMIDISTRM h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HMIDISTRM h && handle == h.handle;
public override bool Equals(object? obj) => obj is HMIDISTRM h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();

View File

@ -1,8 +1,4 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke;
/// <summary>Items from the WinMm.dll</summary>
@ -1637,7 +1633,7 @@ public static partial class WinMm
public static bool operator ==(HMIXER h1, HMIXER h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HMIXER h && handle == h.handle;
public override bool Equals(object? obj) => obj is HMIXER h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -1685,7 +1681,7 @@ public static partial class WinMm
public static bool operator ==(HMIXEROBJ h1, HMIXEROBJ h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HMIXEROBJ h && handle == h.handle;
public override bool Equals(object? obj) => obj is HMIXEROBJ h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();

View File

@ -1,9 +1,3 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Vanara.PInvoke;
/// <summary>Items from the WinMm.dll</summary>
@ -2124,7 +2118,7 @@ public static partial class WinMm
public static bool operator ==(HWAVEIN h1, HWAVEIN h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HWAVEIN h && handle == h.handle;
public override bool Equals(object? obj) => obj is HWAVEIN h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -2172,7 +2166,7 @@ public static partial class WinMm
public static bool operator ==(HWAVEOUT h1, HWAVEOUT h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HWAVEOUT h && handle == h.handle;
public override bool Equals(object? obj) => obj is HWAVEOUT h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();

View File

@ -1,5 +1,3 @@
using System.Runtime.InteropServices;
namespace Vanara.PInvoke;
/// <summary>Items from the WinMm.dll</summary>

View File

@ -1,10 +1,5 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using System.Text;
using Vanara.InteropServices;
#pragma warning disable IL2050 // Correctness of COM interop cannot be guaranteed after trimming. Interfaces and interface members might be removed.
#pragma warning disable IDE1006 // Naming Styles
namespace Vanara.PInvoke;
/// <summary>Items from the AviFil32.dll</summary>
@ -1485,7 +1480,7 @@ public static partial class AviFil32
[DllImport(Lib_Avifil32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.AVIStreamGetFrameOpen")]
[return: MarshalAs(UnmanagedType.Interface)]
public static extern IGetFrame AVIStreamGetFrameOpen(IAVIStream pavi, in Gdi32.BITMAPINFOHEADER lpbiWanted);
public static extern IGetFrame? AVIStreamGetFrameOpen(IAVIStream pavi, in Gdi32.BITMAPINFOHEADER lpbiWanted);
/// <summary>The <c>AVIStreamGetFrameOpen</c> function prepares to decompress video frames from the specified video stream.</summary>
/// <param name="pavi">Pointer to the video stream used as the video source.</param>
@ -1505,7 +1500,7 @@ public static partial class AviFil32
[DllImport(Lib_Avifil32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.AVIStreamGetFrameOpen")]
[return: MarshalAs(UnmanagedType.Interface)]
public static extern IGetFrame AVIStreamGetFrameOpen(IAVIStream pavi, [In, Optional] IntPtr lpbiWanted);
public static extern IGetFrame? AVIStreamGetFrameOpen(IAVIStream pavi, [In, Optional] IntPtr lpbiWanted);
/// <summary>The <c>AVIStreamInfo</c> function obtains stream header information.</summary>
/// <param name="pavi">Handle to an open stream.</param>
@ -1979,7 +1974,7 @@ public static partial class AviFil32
// LONG lPos, LPVOID lpFormat, LONG *lpcbFormat );
[DllImport(Lib_Avifil32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.AVIStreamReadFormat")]
public static extern HRESULT AVIStreamReadFormat(IAVIStream pavi, int lPos, IntPtr lpFormat, ref int lpcbFormat);
public static extern HRESULT AVIStreamReadFormat(IAVIStream pavi, int lPos, [In, Optional] IntPtr lpFormat, ref int lpcbFormat);
/// <summary>
/// <para>
@ -2187,7 +2182,7 @@ public static partial class AviFil32
// *ppsEditable, PAVISTREAM psSource );
[DllImport(Lib_Avifil32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.CreateEditableStream")]
public static extern HRESULT CreateEditableStream(out IAVIStream ppsEditable, [In] IAVIStream psSource);
public static extern HRESULT CreateEditableStream(out IAVIStream ppsEditable, [In] IAVIStream? psSource);
/// <summary>The <c>EditStreamClone</c> function creates a duplicate editable stream.</summary>
/// <param name="pavi">Handle to an editable stream that will be copied.</param>

View File

@ -1,10 +1,6 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Vanara.InteropServices;
using System.Runtime.CompilerServices;
using static Vanara.PInvoke.Gdi32;
using static Vanara.PInvoke.Kernel32;
namespace Vanara.PInvoke;
@ -875,7 +871,7 @@ public static partial class Msvfw32
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibDraw")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibDraw([In] HDRAWDIB hdd, [In] HDC hdc, int xDst, int yDst, int dxDst, int dyDst, [In, Optional] IntPtr lpbi, [In, Optional] IntPtr lpBits, int xSrc, int ySrc, int dxSrc, int dySrc, DDF wFlags);
public static extern bool DrawDibDraw([In] HDRAWDIB hdd, [In] HDC hdc, int xDst, int yDst, [Optional] int dxDst, [Optional] int dyDst, [In, Optional] IntPtr lpbi, [In, Optional] IntPtr lpBits, [Optional] int xSrc, [Optional] int ySrc, [Optional] int dxSrc, [Optional] int dySrc, DDF wFlags);
/// <summary>
/// The <c>DrawDibEnd</c> function clears the flags and other settings of a DrawDib DC that are set by the DrawDibBegin or
@ -980,6 +976,51 @@ public static partial class Msvfw32
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibProfileDisplay")]
public static extern IntPtr DrawDibProfileDisplay(in BITMAPINFOHEADER lpbi);
/// <summary>The <c>DrawDibProfileDisplay</c> function determines settings for the display system when using DrawDib functions.</summary>
/// <param name="lpbi">
/// Pointer to a BITMAPINFOHEADER structure that contains bitmap information. You can also specify <c>NULL</c> to verify that the
/// profile information is current. If the profile information is not current, DrawDib will rerun the profile tests to obtain a
/// current set of information. When you call <c>DrawDibProfileDisplay</c> with this parameter set to <c>NULL</c>, the return value
/// is meaningless.
/// </param>
/// <returns>
/// <para>
/// Returns a value that indicates the fastest drawing and stretching capabilities of the display system. This value can be zero if
/// the bitmap format is not supported or one or more of the following values.
/// </para>
/// <list type="table">
/// <listheader>
/// <term>Return code</term>
/// <term>Description</term>
/// </listheader>
/// <item>
/// <term>PD_CAN_DRAW_DIB</term>
/// <term>DrawDib can draw images using this format. Stretching might or might not also be supported.</term>
/// </item>
/// <item>
/// <term>PD_CAN_STRETCHDIB</term>
/// <term>DrawDib can stretch and draw images using this format.</term>
/// </item>
/// <item>
/// <term>PD_STRETCHDIB_1_1_OK</term>
/// <term>StretchDIBits draws unstretched images using this format faster than an alternative method.</term>
/// </item>
/// <item>
/// <term>PD_STRETCHDIB_1_2_OK</term>
/// <term>StretchDIBits draws stretched images (in a 1:2 ratio) using this format faster than an alternative method.</term>
/// </item>
/// <item>
/// <term>PD_STRETCHDIB_1_N_OK</term>
/// <term>StretchDIBits draws stretched images (in a 1:N ratio) using this format faster than an alternative method.</term>
/// </item>
/// </list>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibprofiledisplay LRESULT VFWAPI DrawDibProfileDisplay(
// LPBITMAPINFOHEADER lpbi );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibProfileDisplay")]
public static extern IntPtr DrawDibProfileDisplay([In, Optional] IntPtr lpbi);
/// <summary>The <c>DrawDibRealize</c> function realizes the palette of the DrawDib DC for use with the specified DC.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="hdc">Handle to the DC containing the palette.</param>
@ -1060,7 +1101,7 @@ public static partial class Msvfw32
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibupdate void DrawDibUpdate( hdd, hdc, x, y );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibUpdate")]
public static bool DrawDibUpdate([In] HDRAWDIB hdd, [In] HDC hdc, int x, int y) => DrawDibDraw(hdd, hdc, x, y, 0, 0, default, default, 0, 0, 0, 0, DDF.DDF_UPDATE);
public static bool DrawDibUpdate([In] HDRAWDIB hdd, [In] HDC hdc, int x, int y) => DrawDibDraw(hdd, hdc, x, y, wFlags: DDF.DDF_UPDATE);
/// <summary>
/// The <c>GetOpenFileNamePreview</c> function selects a file by using the Open dialog box. The dialog box also allows the user to
@ -1774,13 +1815,14 @@ public static partial class Msvfw32
// lpbiDst, LPVOID lpDst, int xDst, int yDst, int dxDst, int dyDst );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.ICDecompressExQuery")]
public static ICERR ICDecompressExQuery([In] HIC hic, in BITMAPINFOHEADER lpbiSrc, int xSrc, int ySrc,
int dxSrc, int dySrc, in BITMAPINFOHEADER lpbiDst, [Out] IntPtr lpDst, int xDst, int yDst, int dxDst, int dyDst)
int dxSrc, int dySrc, [In] BITMAPINFOHEADER? lpbiDst, [Out] IntPtr lpDst, int xDst, int yDst, int dxDst, int dyDst)
{
unsafe
{
fixed (void* pIn = &lpbiSrc, pOut = &lpbiDst)
var biDst = lpbiDst.GetValueOrDefault();
fixed (void* pIn = &lpbiSrc)
{
ICDECOMPRESSEX ic = new ICDECOMPRESSEX
ICDECOMPRESSEX ic = new()
{
dwFlags = 0,
lpbiSrc = (IntPtr)pIn,
@ -1789,7 +1831,7 @@ public static partial class Msvfw32
ySrc = ySrc,
dxSrc = dxSrc,
dySrc = dySrc,
lpbiDst = (IntPtr)pOut,
lpbiDst = lpbiDst.HasValue ? (IntPtr)(void*)&biDst: IntPtr.Zero,
lpDst = lpDst,
xDst = xDst,
yDst = yDst,
@ -1966,7 +2008,7 @@ public static partial class Msvfw32
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-icdecompresssetpalette void ICDecompressSetPalette( hic,
// lpbiPalette );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.ICDecompressSetPalette")]
public static ICERR ICDecompressSetPalette([In] HIC hic, [In, Optional] SafeBITMAPINFO lpbiPalette) =>
public static ICERR ICDecompressSetPalette([In] HIC hic, [In, Optional] SafeBITMAPINFO? lpbiPalette) =>
(ICERR)ICSendMessage(hic, ICM_Message.ICM_DECOMPRESS_SET_PALETTE, lpbiPalette).ToInt32();
/// <summary>The <c>ICDraw</c> function decompresses an image for drawing.</summary>
@ -2207,7 +2249,7 @@ public static partial class Msvfw32
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-icdrawquery void ICDrawQuery( hic, lpbiInput );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.ICDrawQuery")]
public static ICERR ICDrawQuery([In] HIC hic, [In, Optional] SafeBITMAPINFO lpbiInput) =>
public static ICERR ICDrawQuery([In] HIC hic, [In, Optional] SafeBITMAPINFO? lpbiInput) =>
(ICERR)ICSendMessage(hic, ICM_Message.ICM_DRAW_QUERY, lpbiInput).ToInt32();
/// <summary>
@ -2478,7 +2520,7 @@ public static partial class Msvfw32
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-icgetstate void ICGetState( hic, pv, cb );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.ICGetState")]
public static ICERR ICGetState([In] HIC hic, IntPtr pv, uint cb) => (ICERR)ICSendMessage(hic, ICM_Message.ICM_GETSTATE, pv, new IntPtr((int)cb)).ToInt32();
public static ICERR ICGetState([In] HIC hic, [Optional] IntPtr pv, uint cb) => (ICERR)ICSendMessage(hic, ICM_Message.ICM_GETSTATE, pv, new IntPtr((int)cb)).ToInt32();
/// <summary>
/// The <c>ICGetStateSize</c> macro queries a video compression driver to determine the amount of memory required to retrieve the
@ -2533,7 +2575,7 @@ public static partial class Msvfw32
// uiFlags, LPBITMAPINFO lpbiIn, LPVOID lpBits, LPBITMAPINFO lpbiOut, LONG lQuality, LONG *plSize );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.ICImageCompress")]
public static extern SafeHGlobalHandle ICImageCompress([In] HIC hic, [Optional] uint uiFlags, in BITMAPINFO lpbiIn, [In] IntPtr lpBits, [In, Optional] IntPtr lpbiOut, int lQuality, ref int plSize);
public static extern SafeMoveableHGlobalHandle ICImageCompress([In] HIC hic, [Optional] uint uiFlags, in BITMAPINFO lpbiIn, [In] IntPtr lpBits, [In, Optional] IntPtr lpbiOut, int lQuality, ref int plSize);
/// <summary>
/// The <c>ICImageCompress</c> function compresses an image to a given size. This function does not require initialization functions.
@ -2564,7 +2606,7 @@ public static partial class Msvfw32
// uiFlags, LPBITMAPINFO lpbiIn, LPVOID lpBits, LPBITMAPINFO lpbiOut, LONG lQuality, LONG *plSize );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.ICImageCompress")]
public static extern SafeHGlobalHandle ICImageCompress([In] HIC hic, [Optional] uint uiFlags, [In] IntPtr lpbiIn, [In] IntPtr lpBits, [In, Optional] IntPtr lpbiOut, int lQuality, ref int plSize);
public static extern SafeMoveableHGlobalHandle ICImageCompress([In] HIC hic, [Optional] uint uiFlags, [In] IntPtr lpbiIn, [In] IntPtr lpBits, [In, Optional] IntPtr lpbiOut, int lQuality, ref int plSize);
/// <summary>The <c>ICImageDecompress</c> function decompresses an image without using initialization functions.</summary>
/// <param name="hic">
@ -2587,7 +2629,7 @@ public static partial class Msvfw32
// uiFlags, LPBITMAPINFO lpbiIn, LPVOID lpBits, LPBITMAPINFO lpbiOut );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.ICImageDecompress")]
public static extern SafeHGlobalHandle ICImageDecompress([In] HIC hic, [Optional] uint uiFlags, in BITMAPINFO lpbiIn, [In] IntPtr lpBits, [In, Optional] IntPtr lpbiOut);
public static extern SafeMoveableHGlobalHandle ICImageDecompress([In] HIC hic, [Optional] uint uiFlags, in BITMAPINFO lpbiIn, [In] IntPtr lpBits, [In, Optional] IntPtr lpbiOut);
/// <summary>The <c>ICImageDecompress</c> function decompresses an image without using initialization functions.</summary>
/// <param name="hic">
@ -2610,7 +2652,7 @@ public static partial class Msvfw32
// uiFlags, LPBITMAPINFO lpbiIn, LPVOID lpBits, LPBITMAPINFO lpbiOut );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.ICImageDecompress")]
public static extern SafeHGlobalHandle ICImageDecompress([In] HIC hic, [Optional] uint uiFlags, [In] IntPtr lpbiIn, [In] IntPtr lpBits, [In, Optional] IntPtr lpbiOut);
public static extern SafeMoveableHGlobalHandle ICImageDecompress([In] HIC hic, [Optional] uint uiFlags, [In] IntPtr lpbiIn, [In] IntPtr lpBits, [In, Optional] IntPtr lpbiOut);
/// <summary>
/// The <c>ICInfo</c> function retrieves information about specific installed compressors or enumerates the installed compressors.
@ -3219,7 +3261,7 @@ public static partial class Msvfw32
/// <param name="lpbiOutput">Additional message-specific information.</param>
/// <returns>Returns a message-specific result.</returns>
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.ICSendMessage")]
internal static IntPtr ICSendMessage(HIC hic, ICM_Message msg, [In] SafeBITMAPINFO lpbiInput, [In, Optional] SafeBITMAPINFO lpbiOutput) =>
internal static IntPtr ICSendMessage(HIC hic, ICM_Message msg, [In] SafeBITMAPINFO? lpbiInput, [In, Optional] SafeBITMAPINFO? lpbiOutput) =>
ICSendMessage(hic, msg, lpbiInput ?? SafeBITMAPINFO.Null, lpbiOutput ?? SafeBITMAPINFO.Null);
/// <summary>
@ -3418,7 +3460,7 @@ public static partial class Msvfw32
public static bool operator ==(HDRAWDIB h1, HDRAWDIB h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HDRAWDIB h && handle == h.handle;
public override bool Equals(object? obj) => obj is HDRAWDIB h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -3466,7 +3508,7 @@ public static partial class Msvfw32
public static bool operator ==(HIC h1, HIC h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HIC h && handle == h.handle;
public override bool Equals(object? obj) => obj is HIC h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();

View File

@ -1,9 +1,3 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using static Vanara.PInvoke.AviFil32;
namespace Vanara.PInvoke;
/// <summary>Items from the AviFil32.dll</summary>
@ -458,6 +452,6 @@ public static partial class AviFil32
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-igetframe-setformat HRESULT SetFormat( LPBITMAPINFOHEADER lpbi,
// LPVOID lpBits, int x, int y, int dx, int dy );
void SetFormat(in Gdi32.BITMAPINFOHEADER lpbi, [In, Optional] IntPtr lpBits, [In] int x, [In] int y, [In] int dx, [In] int dy);
void SetFormat([In, Optional] IntPtr lpbi, [In, Optional] IntPtr lpBits, [In] int x, [In] int y, [In] int dx, [In] int dy);
}
}

View File

@ -1,8 +1,3 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using System.Text;
using static Vanara.PInvoke.User32;
namespace Vanara.PInvoke;
@ -1643,7 +1638,7 @@ public static partial class Vfw32
private static int MCIWndSM<TEnum>(HWND hwnd, TEnum msg, [Optional] IntPtr wparam, [Optional] IntPtr lparam) where TEnum : struct, IConvertible => SendMessage(hwnd, msg, wparam, lparam).ToInt32();
private static int MCIWndSM<TEnum>(HWND hwnd, TEnum msg, StringBuilder lparam) where TEnum : struct, IConvertible => SendMessage(hwnd, msg, (IntPtr)(lparam?.Capacity ?? 0), lparam).ToInt32();
private static int MCIWndSM<TEnum>(HWND hwnd, TEnum msg, StringBuilder lparam) where TEnum : struct, IConvertible => SendMessage(hwnd, msg, (IntPtr)lparam.Capacity, lparam).ToInt32();
private static int MCIWndSM<TEnum, TLP>(HWND hwnd, TEnum msg, out TLP lparam, int size = -1) where TEnum : struct, IConvertible where TLP : struct
{

View File

@ -1,8 +1,4 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using System.Text;
using static Vanara.PInvoke.WinMm;
namespace Vanara.PInvoke;
@ -1233,7 +1229,7 @@ public static partial class Vfw32
/// </summary>
/// <param name="hwnd">Handle to a capture window.</param>
/// <param name="fpProc">
/// Pointer to the callback function, of type capControlCallback . Specify <c>NULL</c> for this parameter to disable a previously
/// Pointer to the callback function, of type capControlCallback. Specify <c>NULL</c> for this parameter to disable a previously
/// installed callback function.
/// </param>
/// <returns>None</returns>
@ -1248,7 +1244,7 @@ public static partial class Vfw32
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-capsetcallbackoncapcontrol void capSetCallbackOnCapControl( hwnd,
// fpProc );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.capSetCallbackOnCapControl")]
public static bool capSetCallbackOnCapControl(HWND hwnd, [Optional] capControlCallback fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_CAPCONTROL, 0, fpProc);
public static bool capSetCallbackOnCapControl(HWND hwnd, [Optional] capControlCallback? fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_CAPCONTROL, 0, fpProc);
/// <summary>
/// The <c>capSetCallbackOnError</c> macro sets an error callback function in the client application. AVICap calls this procedure
@ -1284,7 +1280,7 @@ public static partial class Vfw32
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-capsetcallbackonerror void capSetCallbackOnError( hwnd, fpProc );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.capSetCallbackOnError")]
public static bool capSetCallbackOnError(HWND hwnd, [Optional] capErrorCallback fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_ERROR, 0, fpProc);
public static bool capSetCallbackOnError(HWND hwnd, [Optional] capErrorCallback? fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_ERROR, 0, fpProc);
/// <summary>
/// The <c>capSetCallbackOnFrame</c> macro sets a preview callback function in the application. AVICap calls this procedure when the
@ -1302,7 +1298,7 @@ public static partial class Vfw32
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-capsetcallbackonframe void capSetCallbackOnFrame( hwnd, fpProc );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.capSetCallbackOnFrame")]
public static bool capSetCallbackOnFrame(HWND hwnd, capVideoStreamCallback fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_FRAME, 0, fpProc);
public static bool capSetCallbackOnFrame(HWND hwnd, capVideoStreamCallback? fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_FRAME, 0, fpProc);
/// <summary>
/// The <c>capSetCallbackOnStatus</c> macro sets a status callback function in the application. AVICap calls this procedure whenever
@ -1333,7 +1329,7 @@ public static partial class Vfw32
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-capsetcallbackonstatus void capSetCallbackOnStatus( hwnd, fpProc );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.capSetCallbackOnStatus")]
public static bool capSetCallbackOnStatus(HWND hwnd, [Optional] capStatusCallback fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_STATUS, 0, fpProc);
public static bool capSetCallbackOnStatus(HWND hwnd, [Optional] capStatusCallback? fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_STATUS, 0, fpProc);
/// <summary>
/// The <c>capSetCallbackOnVideoStream</c> macro sets a callback function in the application. AVICap calls this procedure during
@ -1358,7 +1354,7 @@ public static partial class Vfw32
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-capsetcallbackonvideostream void capSetCallbackOnVideoStream( hwnd,
// fpProc );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.capSetCallbackOnVideoStream")]
public static bool capSetCallbackOnVideoStream(HWND hwnd, [Optional] capVideoStreamCallback fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, fpProc);
public static bool capSetCallbackOnVideoStream(HWND hwnd, [Optional] capVideoStreamCallback? fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, fpProc);
/// <summary>
/// The <c>capSetCallbackOnWaveStream</c> macro sets a callback function in the application. AVICap calls this procedure during
@ -1384,7 +1380,7 @@ public static partial class Vfw32
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-capsetcallbackonwavestream void capSetCallbackOnWaveStream( hwnd,
// fpProc );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.capSetCallbackOnWaveStream")]
public static bool capSetCallbackOnWaveStream(HWND hwnd, [Optional] capWaveStreamCallback fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_WAVESTREAM, 0, fpProc);
public static bool capSetCallbackOnWaveStream(HWND hwnd, [Optional] capWaveStreamCallback? fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_WAVESTREAM, 0, fpProc);
/// <summary>
/// The <c>capSetCallbackOnYield</c> macro sets a callback function in the application. AVICap calls this procedure when the capture
@ -1418,7 +1414,7 @@ public static partial class Vfw32
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-capsetcallbackonyield void capSetCallbackOnYield( hwnd, fpProc );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.capSetCallbackOnYield")]
public static bool capSetCallbackOnYield(HWND hwnd, [Optional] capYieldCallback fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_YIELD, 0, fpProc);
public static bool capSetCallbackOnYield(HWND hwnd, [Optional] capYieldCallback? fpProc) => AVICapSM(hwnd, capMessage.WM_CAP_SET_CALLBACK_YIELD, 0, fpProc);
/// <summary>
/// The <c>capSetMCIDeviceName</c> macro specifies the name of the MCI video device to be used to capture data. You can use this
@ -1475,11 +1471,11 @@ public static partial class Vfw32
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.capSetVideoFormat")]
public static bool capSetVideoFormat(HWND hwnd, [In] Gdi32.SafeBITMAPINFO s) => AVICapSM(hwnd, capMessage.WM_CAP_SET_VIDEOFORMAT, (IntPtr)(int)s.Size, s.DangerousGetHandle());
private static bool AVICapSM(HWND hwnd, capMessage msg, int v, Delegate d) => User32.SendMessage(hwnd, unchecked((uint)msg), (IntPtr)v, Marshal.GetFunctionPointerForDelegate(d)) != IntPtr.Zero;
private static bool AVICapSM(HWND hwnd, capMessage msg, int v, Delegate? d) => User32.SendMessage(hwnd, unchecked((uint)msg), (IntPtr)v, d is null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(d)) != IntPtr.Zero;
private static bool AVICapSM(HWND hwnd, capMessage msg, [Optional] IntPtr wparam, [Optional] IntPtr lparam) => User32.SendMessage(hwnd, unchecked((uint)msg), wparam, lparam) != IntPtr.Zero;
private static bool AVICapSM(HWND hwnd, capMessage msg, StringBuilder lparam) => User32.SendMessage(hwnd, unchecked((uint)msg), (IntPtr)(lparam?.Capacity ?? 0), lparam) != IntPtr.Zero;
private static bool AVICapSM(HWND hwnd, capMessage msg, StringBuilder lparam) => User32.SendMessage(hwnd, unchecked((uint)msg), (IntPtr)lparam.Capacity, lparam) != IntPtr.Zero;
private static int AVICapSM<TLP>(HWND hwnd, capMessage msg, int size, in TLP lparam) where TLP : struct
{

View File

@ -1,8 +1,3 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using static Vanara.PInvoke.Gdi32;
using static Vanara.PInvoke.WinMm;
namespace Vanara.PInvoke;

View File

@ -3,6 +3,9 @@
<AssemblyName>UnitTest.PInvoke.Multimedia</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\PInvoke\Multimedia\Vanara.PInvoke.Multimedia.csproj" />
</ItemGroup>

View File

@ -1,7 +1,5 @@
using NUnit.Framework;
using NUnit.Framework.Internal;
using System;
using System.Runtime.InteropServices;
using static Vanara.PInvoke.Gdi32;
using static Vanara.PInvoke.Msvfw32;

View File

@ -1,12 +1,8 @@
using NUnit.Framework;
using NUnit.Framework.Internal;
using System;
using System.Runtime.InteropServices;
using System.Threading;
using static Vanara.PInvoke.Gdi32;
using static Vanara.PInvoke.AviFil32;
using static Vanara.PInvoke.WinMm;
using Vanara.InteropServices;
using System.Drawing;
using System.Drawing.Imaging;

View File

@ -1,9 +1,6 @@
using NUnit.Framework;
using NUnit.Framework.Internal;
using System;
using System.Runtime.InteropServices;
using System.Threading;
using static Vanara.PInvoke.Gdi32;
using static Vanara.PInvoke.WinMm;
namespace Vanara.PInvoke.Tests;