From dd648b3d67bf81b12293b67943030824758b54d7 Mon Sep 17 00:00:00 2001 From: vocero Date: Fri, 10 Jan 2020 11:25:56 -0400 Subject: [PATCH] Fixed invalid RT_GROUP_ICON when adding icons directly from the Writer class Resource type RT_GROUP_ICON weren't written properly when calling the AddWin32Icon methods on the Writer class, the ID of each GRPICONDIRENTRY were written as an INT instead of a USHORT. --- System.Compiler/Writer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/System.Compiler/Writer.cs b/System.Compiler/Writer.cs index 8c1162b..11d12cc 100644 --- a/System.Compiler/Writer.cs +++ b/System.Compiler/Writer.cs @@ -5470,8 +5470,8 @@ internal unsafe static void AddWin32Icon(Module/*!*/ module, Stream win32IconStr indexHeap.Write(cursor.ReadUInt16()); //bit count int len = cursor.ReadInt32(); int offset = cursor.ReadInt32(); - indexHeap.Write((int)len); - indexHeap.Write((int)module.Win32Resources.Count+2); + indexHeap.Write((uint)len); + indexHeap.Write((ushort)(module.Win32Resources.Count+2)); MemoryCursor c = new MemoryCursor(cursor); c.Position = offset; resource.Data = c.ReadBytes(len);