Skip to content

Conversation

@MatejKafka
Copy link
Contributor

The current docs do not specify if it's safe to use the returned resource name outside of the callback (e.g. storing it in a variable for later comparison). Since the whole PE module is loaded in memory, a feasible implementation could return a pointer to the string inside the mapped image, so it's not "obvious" that a single buffer is reused for all callback invocations.

From my testing, the functions reuse a single internal buffer where the resource name is copied (the pointer passed for string resource names is the same in all invocations). I'm adding a remark that describes this, and also clarifies that the callee does not need to free the pointed-to memory at the end of the callback.

@prmerger-automator
Copy link

@MatejKafka : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@Karl-Bridge-Microsoft Karl-Bridge-Microsoft merged commit 4d9a32f into MicrosoftDocs:docs Jan 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants