Fix a bug in LoadNativeStringResource to honor the contract properly when the buffer...
authorYi Zhang (CLR) <yizhang82@users.noreply.github.com>
Fri, 2 Jun 2017 16:10:34 +0000 (09:10 -0700)
committerJan Vorlicek <janvorli@microsoft.com>
Fri, 2 Jun 2017 16:10:34 +0000 (18:10 +0200)
commitc15973ce179467f68d0c93912c6b05ab820b6e37
treebb71b56375a03c723d998dab79332b48c74e4eb6
parent1bc4ff4404c103986da3600d8eaefb91a615f6a1
Fix a bug in LoadNativeStringResource to honor the contract properly when the buffer is not big enough (dotnet/coreclr#12051)

* Return last error properly

* adjust pcwchUsed if ERROR_INSUFFICIENT_BUFFER

* return hr

* ERROR_INSUFFICIENT_BUFFER is a win32 error....

Commit migrated from https://github.com/dotnet/coreclr/commit/3a6895ebcc29e0ad84bef61a216433e99fda5f6c
src/coreclr/src/nativeresources/resourcestring.cpp
src/coreclr/src/utilcode/ccomprc.cpp
src/coreclr/src/utilcode/sstring_com.cpp