diff --git a/src/Microsoft.Windows.CsWin32/Generator.cs b/src/Microsoft.Windows.CsWin32/Generator.cs index 59ca7d13..d30c47c9 100644 --- a/src/Microsoft.Windows.CsWin32/Generator.cs +++ b/src/Microsoft.Windows.CsWin32/Generator.cs @@ -53,6 +53,7 @@ public class Generator : IDisposable { "OVERLAPPED", ParseTypeName("global::System.Threading.NativeOverlapped") }, { "POINT", ParseTypeName("global::System.Drawing.Point") }, { "POINTF", ParseTypeName("global::System.Drawing.PointF") }, + { "STREAM_SEEK", ParseTypeName("global::System.IO.SeekOrigin") }, }; /// diff --git a/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs b/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs index 3ba0c468..508d5e35 100644 --- a/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs +++ b/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs @@ -3058,6 +3058,19 @@ public void ParametersIncludeSizeParamIndex() Assert.Equal("0", ((LiteralExpressionSyntax)sizeParamIndex!.Expression).Token.ValueText); } + [Fact] + public void SeekOriginEnumPreferred() + { + this.generator = this.CreateGenerator(); + Assert.True(this.generator.TryGenerateType("IStream")); + this.CollectGeneratedCode(this.generator); + this.AssertNoDiagnostics(); + + MethodDeclarationSyntax seekMethod = Assert.Single(this.FindGeneratedMethod("Seek")); + QualifiedNameSyntax seekParamType = Assert.IsType(seekMethod.ParameterList.Parameters[1].Type); + Assert.Equal(nameof(SeekOrigin), seekParamType.Right.Identifier.ValueText); + } + private static string ConstructGlobalConfigString(bool omitDocs = false) { StringBuilder globalConfigBuilder = new();