-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src,deps: wrap library name with TEXT() #226
Conversation
/cc @piscisaureus |
-1 |
@piscisaureus Will you accept the commit if I change it to use And FYI, in V8 and OpenSSL they chose to use |
I'll accept it if you change it to use LoadLibraryW to make it look like this: hnd_advapi32 = LoadLibraryW(L"advapi32.dll"); The reason is that LoadLibraryA just converts the name from the "active ansi character set" to utf16 and then calls LoadLibraryW internally. The TEXT() macro is a relic from times where people were targeting Windows NT (with unicode support) and 95/98 (no unicode support) at the same time. |
On Windows when compiling with unicode support, "LoadLibrary" will become "LoadLibraryW" and feeding it with an ANSCII string will cause crash in runtime.
Sounds quite reasonable to me, I have updated the patch to use |
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: #226 Reviewed-By: Bert Belder <[email protected]>
Thanks! Landed in 604b876. |
@zcbenz BTW you may want to upstream the patch to c-ares too. Chances are that your change gets reverted when someone upgrades c-ares. |
I have created c-ares/c-ares#25 for the upstream c-ares. |
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: nodejs#226 Reviewed-By: Bert Belder <[email protected]>
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: nodejs#226 Reviewed-By: Bert Belder <[email protected]>
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: nodejs#226 Reviewed-By: Bert Belder <[email protected]>
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: nodejs#226 Reviewed-By: Bert Belder <[email protected]>
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: nodejs#226 Reviewed-By: Bert Belder <[email protected]>
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: #226 Reviewed-By: Bert Belder <[email protected]>
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: #226 Reviewed-By: Bert Belder <[email protected]>
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: #226 Reviewed-By: Bert Belder <[email protected]>
This landed upstream in cares... although I'm not sure we are backporting changes to LTS. Should this be backported? |
Likely safe. SGTM /cc @nodejs/lts |
@thealphanerd probably not needed, check the diff against v4. This one's a floating patch that kept coming on top of c-ares changes. |
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: nodejs#226 Reviewed-By: Bert Belder <[email protected]>
BUGFIXES * [`27cccfbda`](npm/cli@27cccfb) [nodejs#223](npm/cli#223) vulns → vulnerabilities in npm audit output ([@sapegin](https://github.com/sapegin)) * [`d5e865eb7`](npm/cli@d5e865e) [nodejs#222](npm/cli#222) [nodejs#226](npm/cli#226) install, doctor: don't crash if registry unset ([@dmitrydvorkin](https://github.com/dmitrydvorkin), [@isaacs](https://github.com/isaacs)) * [`5b3890226`](npm/cli@5b38902) [nodejs#227](npm/cli#227) [npm.community#9167](https://npm.community/t/npm-err-cb-never-called-permission-denied/9167/5) Handle unhandledRejections, tell user what to do when encountering an `EACCES` error in the cache. ([@isaacs](https://github.com/isaacs)) DEPENDENCIES * [`77516df6e`](npm/cli@77516df) `[email protected]` ([@isaacs](https://github.com/isaacs)) * [`ceb993590`](npm/cli@ceb9935) `[email protected]` ([@isaacs](https://github.com/isaacs)) * [`4050b9189`](npm/cli@4050b91) `[email protected]` * [nodejs#46](npm/hosted-git-info#46) [nodejs#43](npm/hosted-git-info#43) [nodejs#47](npm/hosted-git-info#47) [nodejs#44](npm/hosted-git-info#44) Add support for GitLab subgroups ([@mterrel](https://github.com/mterrel), [@isaacs](https://github.com/isaacs), [@ybiquitous](https://github.com/ybiquitous)) * [`3b1d629`](npm/hosted-git-info@3b1d629) [nodejs#48](npm/hosted-git-info#48) fix http protocol using sshurl by default ([@fengmk2](https://github.com/fengmk2)) * [`5d4a8d7`](npm/hosted-git-info@5d4a8d7) ignore noCommittish on tarball url generation ([@isaacs](https://github.com/isaacs)) * [`1692435`](npm/hosted-git-info@1692435) use gist tarball url that works for anonymous gists ([@isaacs](https://github.com/isaacs)) * [`d5cf830`](npm/hosted-git-info@d5cf830) Do not allow invalid gist urls ([@isaacs](https://github.com/isaacs)) * [`e518222`](npm/hosted-git-info@e518222) Use LRU cache to prevent unbounded memory consumption ([@iarna](https://github.com/iarna))
On Windows when compiling with unicode support, "LoadLibrary" will become "LoadLibraryW" and feeding it with an ANSCII string will cause crash in runtime.
Using TEXT() macro can make the code work no matter whether the unicode support is on.