Updating Resources on Win9x | CodeGuru

Updating Resources on Win9x

Environment: Win9x Windows NT contains some useful functions for updating resources in executables. Those are, however, not implemented on Windows 9x, so I had to write my own library for doing it. My library works in exactly the same manner as the BeginUpdateResource(), UpdateResource() and EndUpdateResource() API functions, just prepend an underscore to their names. […]

Written By
CodeGuru Staff
CodeGuru Staff
Jun 22, 2001
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: Win9x

Windows NT contains some useful functions for updating resources in
executables. Those are, however, not implemented on Windows 9x, so I had to
write my own library for doing it. My library works in exactly the same
manner as the BeginUpdateResource(), UpdateResource() and
EndUpdateResource() API functions, just prepend an underscore to their
names. It also provides a new function, _GetRsrcData(), which is used to get
the resource data for a resource in a file loaded with
_BeginUpdateResource().

The code works, at least on my system, but it has one major drawback: it
can’t move a section in memory. This means that if the .rsrc section would
have to be expanded past its padding, _EndUpdateResource() will return
ERROR_CANT_MOVE_SECTION unless .rsrc is the last section (both in the file
and in VM space). This is a problem because VC6 puts the .reloc section
(relocation info, used in DLLs and debug EXEs) after .rsrc, so you can’t use
the functions very well on those file types.

Downloads

Download source – 7 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.