EndUpdateResourceA function (winbase.h)

Commits or discards changes made prior to a call to UpdateResource.


BOOL EndUpdateResourceA(
  [in] HANDLE hUpdate,
  [in] BOOL   fDiscard


[in] hUpdate


A module handle returned by the BeginUpdateResource function, and used by UpdateResource, referencing the file to be updated.

[in] fDiscard

Type: BOOL

Indicates whether to write the resource updates to the file. If this parameter is TRUE, no changes are made. If it is FALSE, the changes are made: the resource updates will take effect.

Return value

Type: BOOL

Returns TRUE if the function succeeds; FALSE otherwise. If the function succeeds and fDiscard is TRUE, then no resource updates are made to the file; otherwise all successful resource updates are made to the file. To get extended error information, call GetLastError.


Before you call this function, make sure all file handles other than the one returned by BeginUpdateResource are closed.

This function can update resources within modules that contain both code and resources. There are restrictions on resource updates in LN files and .mui files, both of which contain Resource Configuration data; details of the restrictions are in the reference for the UpdateResource function.


For an example, see Updating Resources.


The winbase.h header defines EndUpdateResource as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.


Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also