Skip to content

GetModuleFileName[Ex]W is confusing#169

Merged
jonwis merged 1 commit intomasterfrom
user/jonwis/oops-maybe
Jan 1, 2021
Merged

GetModuleFileName[Ex]W is confusing#169
jonwis merged 1 commit intomasterfrom
user/jonwis/oops-maybe

Conversation

@jonwis
Copy link
Member

@jonwis jonwis commented Dec 29, 2020

In the prior fix (#165) the math for the buffer length incorrectly stripped the trailing character when using wil::GetModuleFileNameExW(non-null-value, any-value) ... I misread the prior comments about handling the too-small case.

This change adds the missing + 1 as well as tests that verify the WIL behavior vs "just call the platform API."

(Again) closes #163 - thanks @m417z !

@jonwis jonwis requested a review from ChrisGuzak December 29, 2020 22:01
@jonwis jonwis merged commit 9841dcd into master Jan 1, 2021
@jonwis jonwis deleted the user/jonwis/oops-maybe branch January 1, 2021 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wil::GetModuleFileNameW - string size is not adjusted

2 participants