Skip to content

Commit

Permalink
Merge pull request #18 from tmm1/patch-1
Browse files Browse the repository at this point in the history
Generate RT_GROUP_ICON id before ICON ids
  • Loading branch information
josephspurrier committed Dec 5, 2017
2 parents d9adecf + 73fc896 commit bbb37d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions icon.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ func addIcon(coff *coff.Coff, fname string, newID <-chan uint16) error {
Type: 1, // magic num.
Count: uint16(len(icons)),
}}
gid := <-newID
for _, icon := range icons {
id := <-newID
r := io.NewSectionReader(f, int64(icon.ImageOffset), int64(icon.BytesInRes))
coff.AddResource(rtIcon, id, r)
group.Entries = append(group.Entries, gRPICONDIRENTRY{IconDirEntryCommon: icon.IconDirEntryCommon, ID: id})
}
id := <-newID
coff.AddResource(rtGroupIcon, id, group)
coff.AddResource(rtGroupIcon, gid, group)
}

return nil
Expand Down

0 comments on commit bbb37d9

Please sign in to comment.