Fixed a bunch of build errors related to missing XMl docs and nullability

pull/375/head
David Hall 2023-02-04 10:53:01 -07:00
parent c34a7113d9
commit 98aba004bb
6 changed files with 25 additions and 12 deletions

View File

@ -312,13 +312,13 @@ public class DistributedRoutingTable : IDisposable
switch (pEventData.Value.type)
{
case DRT_EVENT_TYPE.DRT_EVENT_STATUS_CHANGED:
Drt.StatusChange?.Invoke(Drt, new(pEventData.Value));
Drt?.StatusChange?.Invoke(Drt, new(pEventData.Value));
break;
case DRT_EVENT_TYPE.DRT_EVENT_LEAFSET_KEY_CHANGED:
Drt.LeafSetKeyChange?.Invoke(Drt, new(pEventData.Value));
Drt?.LeafSetKeyChange?.Invoke(Drt, new(pEventData.Value));
break;
case DRT_EVENT_TYPE.DRT_EVENT_REGISTRATION_STATE_CHANGED:
Drt.RegistrationStateChange?.Invoke(Drt, new(pEventData.Value));
Drt?.RegistrationStateChange?.Invoke(Drt, new(pEventData.Value));
break;
}
}

View File

@ -11,9 +11,13 @@ public static partial class CoreAudio
/// <summary>Undocumented</summary>
public const uint AMBISONICS_PARAM_VERSION_1 = 1;
/// <summary/>
public const uint WM_APP_GRAPHNOTIFY = 0x8002;
/// <summary/>
public const uint WM_APP_SESSION_DUCKED = 0x8000;
/// <summary/>
public const uint WM_APP_SESSION_UNDUCKED = 0x8001;
/// <summary/>
public const uint WM_APP_SESSION_VOLUME_CHANGED = 0x8003;
/// <summary>Undocumented</summary>
@ -151,20 +155,25 @@ public static partial class CoreAudio
HRESULT SetEchoCancellationRenderEndpoint([MarshalAs(UnmanagedType.LPWStr)] string endpointId);
}
/// <summary>Undocumented</summary>
[PInvokeData("audioclient.h")]
[ComImport, Guid("28724C91-DF35-4856-9F76-D6A26413F3DF"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAudioAmbisonicsControl
{
/// <summary>Undocumented</summary>
[PreserveSig]
HRESULT SetData([In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] AMBISONICS_PARAMS[] pAmbisonicsParams,
uint cbAmbisonicsParams);
/// <summary>Undocumented</summary>
[PreserveSig]
HRESULT SetHeadTracking([MarshalAs(UnmanagedType.Bool)] bool bEnableHeadTracking);
/// <summary>Undocumented</summary>
[PreserveSig]
HRESULT GetHeadTracking([MarshalAs(UnmanagedType.Bool)] out bool pbEnableHeadTracking);
/// <summary>Undocumented</summary>
[PreserveSig]
HRESULT SetRotation(float X, float Y, float Z, float W);
}

View File

@ -508,7 +508,7 @@ namespace Vanara.PInvoke
return ret | VARTYPE.VT_HRESULT;
if (elemtype.IsCOMObject)
{
var intf = elemtype.GetInterfaces();
Type[] intf = elemtype.GetInterfaces();
if (intf.Contains(typeof(IStream))) return ret | VARTYPE.VT_STREAM;
if (intf.Contains(typeof(IStorage))) return ret | VARTYPE.VT_STORAGE;
return ret | VARTYPE.VT_UNKNOWN;

View File

@ -341,7 +341,7 @@ public class WindowBase : MarshalByRefObject, IDisposable, IWindowInstance, IWin
catch (Exception ex)
{
if (!OnWndProcException(ex))
throw ex;
throw;
return IntPtr.Zero;
}
finally

View File

@ -237,7 +237,7 @@ namespace Vanara.PInvoke
{
var cp = lParam.ToStructure<CREATESTRUCT>().lpCreateParams;
if (cp != IntPtr.Zero && GCHandle.FromIntPtr(cp).Target is IWindowInit wnd)
return wnd.InitWndProcOnNCCreate(hwnd, msg, Marshal.GetFunctionPointerForDelegate(wndProc), lParam);
return wnd.InitWndProcOnNCCreate(hwnd, msg, Marshal.GetFunctionPointerForDelegate(wndProc ?? throw new NullReferenceException()), lParam);
}
catch { }
}

View File

@ -322,7 +322,9 @@ public class FirewallProfile
/// </remarks>
public string[]? ExcludedInterfaces
{
#pragma warning disable CS8619 // Nullability of reference types in value doesn't match target type.
get => iPol.ExcludedInterfaces[type] is null ? null : (string[])Array.ConvertAll((object[])iPol.ExcludedInterfaces[type], o => o.ToString());
#pragma warning restore CS8619 // Nullability of reference types in value doesn't match target type.
set => iPol.ExcludedInterfaces[type] = value is null || value.Length == 0 ? null : Array.ConvertAll(value, s => (object)s);
}
@ -624,7 +626,9 @@ public class FirewallRule : INamedEntity, IEquatable<FirewallRule>
/// </remarks>
public string[]? InterfaceNames
{
#pragma warning disable CS8619 // Nullability of reference types in value doesn't match target type.
get => iRule.Interfaces is null ? null : (string[])Array.ConvertAll((object[])iRule.Interfaces, o => o.ToString());
#pragma warning restore CS8619 // Nullability of reference types in value doesn't match target type.
set => iRule.Interfaces = value is null || value.Length == 0 ? null : Array.ConvertAll(value, s => (object)s);
}
@ -868,12 +872,12 @@ public class FirewallRule : INamedEntity, IEquatable<FirewallRule>
private INetFwRule3 iRule3 => iRule as INetFwRule3 ?? throw new NotSupportedException();
/// <inheritdoc/>
public bool Equals(FirewallRule other) => Equals(other.Name, Name) &&
Equals(other.Profiles, Profiles) &&
Equals(other.Direction, Direction) &&
Equals(other.Enabled, Enabled) &&
Equals(other.Action, Action) &&
Equals(other.ApplicationName, ApplicationName);
public bool Equals(FirewallRule? other) => Equals(other?.Name, Name) &&
Equals(other?.Profiles, Profiles) &&
Equals(other?.Direction, Direction) &&
Equals(other?.Enabled, Enabled) &&
Equals(other?.Action, Action) &&
Equals(other?.ApplicationName, ApplicationName);
}
/// <summary>Represents the rules for the Windows Firewall.</summary>