Skip to content

Commit

Permalink
Minor fixes and resolving CR feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed May 3, 2024
1 parent c50fc95 commit 04c4eba
Show file tree
Hide file tree
Showing 25 changed files with 3,779 additions and 3,658 deletions.
Binary file modified build/cache/win32extras.json.gz
Binary file not shown.
17 changes: 8 additions & 9 deletions generator.json
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,6 @@
"IOleControl",
"IOleControlSite",
"IOleInPlaceObjectWindowless",
"IDummyHICONIncluder",
"tagVARIANT",
"tagVARIANTUnion",
"tagVARIANTUnionUnion",
Expand Down Expand Up @@ -1266,6 +1265,7 @@
"tagRemHMETAFILEPICT",
"tagRemHPALETTE",
"tagpropertykey",
"tagEXCEPINFO",
"_RemotableHandle",
"_remoteMETAFILEPICT",
"_GDI_NONREMOTE",
Expand Down Expand Up @@ -1395,7 +1395,6 @@
"tagCUSTDATAITEM": "CustomDataItem",
"tagELEMDESC": "ElemDesc",
"tagELEMDESCUnion": "ElemDescUnion",
"tagEXCEPINFO": "ExcepInfo",
"tagFUNCDESC": "FuncDesc",
"tagIDLDESC": "IdlDesc",
"tagPARAMDESC": "ParamDesc",
Expand Down Expand Up @@ -1464,13 +1463,13 @@
"tagQACONTAINER": "void",
"PfnTagEXCEPINFOvI": "PfnExceptionInfovI",
"tagPOINTF": "Silk.NET.Maths.Vector2<float>",
"HPALETTE__": "IntPtr",
"HBITMAP__": "IntPtr",
"HICON__": "IntPtr",
"HFONT__": "IntPtr",
"HRGN__": "IntPtr",
"HACCEL__": "IntPtr",
"HTASK__": "IntPtr"
"HPALETTE__": "void",
"HBITMAP__": "void",
"HICON__": "void",
"HFONT__": "void",
"HRGN__": "void",
"HACCEL__": "void",
"HTASK__": "void"
},
{
"$include.dxTypemap": "build/dx_typemap.json",
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Silk.NET.Core.Win32Extras/Structs/ControlInfo.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public unsafe partial struct ControlInfo
public ControlInfo
(
uint? cb = null,
IntPtr* hAccel = null,
void* hAccel = null,
ushort? cAccel = null,
uint? dwFlags = null
) : this()
Expand Down Expand Up @@ -57,7 +57,7 @@ public ControlInfo
[NativeName("Type", "HACCEL")]
[NativeName("Type.Name", "HACCEL")]
[NativeName("Name", "hAccel")]
public IntPtr* HAccel;
public void* HAccel;

[NativeName("Type", "USHORT")]
[NativeName("Type.Name", "USHORT")]
Expand Down
222 changes: 111 additions & 111 deletions src/Core/Silk.NET.Core.Win32Extras/Structs/DispatchVtblExtensions.gen.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.


using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Text;
using Silk.NET.Core;
using Silk.NET.Core.Native;
using Silk.NET.Core.Attributes;
using Silk.NET.Core.Contexts;
using Silk.NET.Core.Loader;

#pragma warning disable 1591

namespace Silk.NET.Core.Win32Extras;

public unsafe static class DummyHICONIncluderVtblExtensions
{
/// <summary>To be documented.</summary>
public static unsafe int QueryInterface(this ComPtr<IDummyHICONIncluder> thisVtbl, Guid* riid, void** ppvObject)
{
var @this = thisVtbl.Handle;
int ret = default;
ret = ((delegate* unmanaged[Cdecl]<IDummyHICONIncluder*, Guid*, void**, int>)@this->LpVtbl[0])(@this, riid, ppvObject);
return ret;
}

/// <summary>To be documented.</summary>
public static unsafe int QueryInterface(this ComPtr<IDummyHICONIncluder> thisVtbl, Guid* riid, ref void* ppvObject)
{
var @this = thisVtbl.Handle;
int ret = default;
fixed (void** ppvObjectPtr = &ppvObject)
{
ret = ((delegate* unmanaged[Cdecl]<IDummyHICONIncluder*, Guid*, void**, int>)@this->LpVtbl[0])(@this, riid, ppvObjectPtr);
}
return ret;
}

/// <summary>To be documented.</summary>
public static unsafe int QueryInterface(this ComPtr<IDummyHICONIncluder> thisVtbl, ref Guid riid, void** ppvObject)
{
var @this = thisVtbl.Handle;
int ret = default;
fixed (Guid* riidPtr = &riid)
{
ret = ((delegate* unmanaged[Cdecl]<IDummyHICONIncluder*, Guid*, void**, int>)@this->LpVtbl[0])(@this, riidPtr, ppvObject);
}
return ret;
}

/// <summary>To be documented.</summary>
public static unsafe int QueryInterface(this ComPtr<IDummyHICONIncluder> thisVtbl, ref Guid riid, ref void* ppvObject)
{
var @this = thisVtbl.Handle;
int ret = default;
fixed (Guid* riidPtr = &riid)
{
fixed (void** ppvObjectPtr = &ppvObject)
{
ret = ((delegate* unmanaged[Cdecl]<IDummyHICONIncluder*, Guid*, void**, int>)@this->LpVtbl[0])(@this, riidPtr, ppvObjectPtr);
}
}
return ret;
}

/// <summary>To be documented.</summary>
public static uint AddRef(this ComPtr<IDummyHICONIncluder> thisVtbl)
{
var @this = thisVtbl.Handle;
uint ret = default;
ret = ((delegate* unmanaged[Cdecl]<IDummyHICONIncluder*, uint>)@this->LpVtbl[1])(@this);
return ret;
}

/// <summary>To be documented.</summary>
public static uint Release(this ComPtr<IDummyHICONIncluder> thisVtbl)
{
var @this = thisVtbl.Handle;
uint ret = default;
ret = ((delegate* unmanaged[Cdecl]<IDummyHICONIncluder*, uint>)@this->LpVtbl[2])(@this);
return ret;
}

/// <summary>To be documented.</summary>
public static unsafe int Dummy(this ComPtr<IDummyHICONIncluder> thisVtbl, void* h1, nint h2)
{
var @this = thisVtbl.Handle;
int ret = default;
ret = ((delegate* unmanaged[Cdecl]<IDummyHICONIncluder*, void*, nint, int>)@this->LpVtbl[3])(@this, h1, h2);
return ret;
}

/// <summary>To be documented.</summary>
public static int Dummy<T0>(this ComPtr<IDummyHICONIncluder> thisVtbl, ref T0 h1, nint h2) where T0 : unmanaged
{
var @this = thisVtbl.Handle;
int ret = default;
fixed (void* h1Ptr = &h1)
{
ret = ((delegate* unmanaged[Cdecl]<IDummyHICONIncluder*, void*, nint, int>)@this->LpVtbl[3])(@this, h1Ptr, h2);
}
return ret;
}

/// <summary>To be documented.</summary>
public static int QueryInterface<TI0>(this ComPtr<IDummyHICONIncluder> thisVtbl, out ComPtr<TI0> ppvObject) where TI0 : unmanaged, IComVtbl<TI0>
{
var @this = thisVtbl.Handle;
// ComPtrOverloader
ppvObject = default;
return @this->QueryInterface(SilkMarshal.GuidPtrOf<TI0>(), (void**) ppvObject.GetAddressOf());
}

/// <summary>To be documented.</summary>
public static unsafe int QueryInterface(this ComPtr<IDummyHICONIncluder> thisVtbl, Span<Guid> riid, void** ppvObject)
{
var @this = thisVtbl.Handle;
// SpanOverloader
return @this->QueryInterface(ref riid.GetPinnableReference(), ppvObject);
}

/// <summary>To be documented.</summary>
public static unsafe int QueryInterface(this ComPtr<IDummyHICONIncluder> thisVtbl, Span<Guid> riid, ref void* ppvObject)
{
var @this = thisVtbl.Handle;
// SpanOverloader
return @this->QueryInterface(ref riid.GetPinnableReference(), ref ppvObject);
}

/// <summary>To be documented.</summary>
public static int Dummy<T0>(this ComPtr<IDummyHICONIncluder> thisVtbl, Span<T0> h1, nint h2) where T0 : unmanaged
{
var @this = thisVtbl.Handle;
// SpanOverloader
return @this->Dummy(ref h1.GetPinnableReference(), h2);
}

/// <summary>To be documented.</summary>
public static ComPtr<TI0> QueryInterface<TI0>(this ComPtr<IDummyHICONIncluder> thisVtbl) where TI0 : unmanaged, IComVtbl<TI0>
{
var @this = thisVtbl.Handle;
// NonKhrReturnTypeOverloader
SilkMarshal.ThrowHResult(@this->QueryInterface(out ComPtr<TI0> silkRet));
return silkRet;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -85,73 +85,73 @@ public static uint Release(this ComPtr<IErrorLog> thisVtbl)
}

/// <summary>To be documented.</summary>
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] char* pszPropName, ExcepInfo* pExcepInfo)
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] char* pszPropName, ExceptionInfo* pExcepInfo)
{
var @this = thisVtbl.Handle;
int ret = default;
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, char*, ExcepInfo*, int>)@this->LpVtbl[3])(@this, pszPropName, pExcepInfo);
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, char*, ExceptionInfo*, int>)@this->LpVtbl[3])(@this, pszPropName, pExcepInfo);
return ret;
}

/// <summary>To be documented.</summary>
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] char* pszPropName, ref ExcepInfo pExcepInfo)
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] char* pszPropName, ref ExceptionInfo pExcepInfo)
{
var @this = thisVtbl.Handle;
int ret = default;
fixed (ExcepInfo* pExcepInfoPtr = &pExcepInfo)
fixed (ExceptionInfo* pExcepInfoPtr = &pExcepInfo)
{
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, char*, ExcepInfo*, int>)@this->LpVtbl[3])(@this, pszPropName, pExcepInfoPtr);
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, char*, ExceptionInfo*, int>)@this->LpVtbl[3])(@this, pszPropName, pExcepInfoPtr);
}
return ret;
}

/// <summary>To be documented.</summary>
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in char pszPropName, ExcepInfo* pExcepInfo)
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in char pszPropName, ExceptionInfo* pExcepInfo)
{
var @this = thisVtbl.Handle;
int ret = default;
fixed (char* pszPropNamePtr = &pszPropName)
{
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, char*, ExcepInfo*, int>)@this->LpVtbl[3])(@this, pszPropNamePtr, pExcepInfo);
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, char*, ExceptionInfo*, int>)@this->LpVtbl[3])(@this, pszPropNamePtr, pExcepInfo);
}
return ret;
}

/// <summary>To be documented.</summary>
public static int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in char pszPropName, ref ExcepInfo pExcepInfo)
public static int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in char pszPropName, ref ExceptionInfo pExcepInfo)
{
var @this = thisVtbl.Handle;
int ret = default;
fixed (char* pszPropNamePtr = &pszPropName)
{
fixed (ExcepInfo* pExcepInfoPtr = &pExcepInfo)
fixed (ExceptionInfo* pExcepInfoPtr = &pExcepInfo)
{
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, char*, ExcepInfo*, int>)@this->LpVtbl[3])(@this, pszPropNamePtr, pExcepInfoPtr);
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, char*, ExceptionInfo*, int>)@this->LpVtbl[3])(@this, pszPropNamePtr, pExcepInfoPtr);
}
}
return ret;
}

/// <summary>To be documented.</summary>
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pszPropName, ExcepInfo* pExcepInfo)
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pszPropName, ExceptionInfo* pExcepInfo)
{
var @this = thisVtbl.Handle;
int ret = default;
var pszPropNamePtr = (byte*) SilkMarshal.StringToPtr(pszPropName, NativeStringEncoding.UTF8);
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, byte*, ExcepInfo*, int>)@this->LpVtbl[3])(@this, pszPropNamePtr, pExcepInfo);
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, byte*, ExceptionInfo*, int>)@this->LpVtbl[3])(@this, pszPropNamePtr, pExcepInfo);
SilkMarshal.Free((nint)pszPropNamePtr);
return ret;
}

/// <summary>To be documented.</summary>
public static int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pszPropName, ref ExcepInfo pExcepInfo)
public static int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pszPropName, ref ExceptionInfo pExcepInfo)
{
var @this = thisVtbl.Handle;
int ret = default;
var pszPropNamePtr = (byte*) SilkMarshal.StringToPtr(pszPropName, NativeStringEncoding.UTF8);
fixed (ExcepInfo* pExcepInfoPtr = &pExcepInfo)
fixed (ExceptionInfo* pExcepInfoPtr = &pExcepInfo)
{
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, byte*, ExcepInfo*, int>)@this->LpVtbl[3])(@this, pszPropNamePtr, pExcepInfoPtr);
ret = ((delegate* unmanaged[Cdecl]<IErrorLog*, byte*, ExceptionInfo*, int>)@this->LpVtbl[3])(@this, pszPropNamePtr, pExcepInfoPtr);
}
SilkMarshal.Free((nint)pszPropNamePtr);
return ret;
Expand Down Expand Up @@ -183,31 +183,31 @@ public static unsafe int QueryInterface(this ComPtr<IErrorLog> thisVtbl, Span<Gu
}

/// <summary>To be documented.</summary>
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] char* pszPropName, Span<ExcepInfo> pExcepInfo)
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] char* pszPropName, Span<ExceptionInfo> pExcepInfo)
{
var @this = thisVtbl.Handle;
// SpanOverloader
return @this->AddError(pszPropName, ref pExcepInfo.GetPinnableReference());
}

/// <summary>To be documented.</summary>
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<char> pszPropName, ExcepInfo* pExcepInfo)
public static unsafe int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<char> pszPropName, ExceptionInfo* pExcepInfo)
{
var @this = thisVtbl.Handle;
// SpanOverloader
return @this->AddError(in pszPropName.GetPinnableReference(), pExcepInfo);
}

/// <summary>To be documented.</summary>
public static int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<char> pszPropName, Span<ExcepInfo> pExcepInfo)
public static int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<char> pszPropName, Span<ExceptionInfo> pExcepInfo)
{
var @this = thisVtbl.Handle;
// SpanOverloader
return @this->AddError(in pszPropName.GetPinnableReference(), ref pExcepInfo.GetPinnableReference());
}

/// <summary>To be documented.</summary>
public static int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pszPropName, Span<ExcepInfo> pExcepInfo)
public static int AddError(this ComPtr<IErrorLog> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pszPropName, Span<ExceptionInfo> pExcepInfo)
{
var @this = thisVtbl.Handle;
// SpanOverloader
Expand Down
Loading

0 comments on commit 04c4eba

Please sign in to comment.