Merge pull request #1759 from vitek-karas/NativeSearchDirsFix
authorVitek Karas <vitek.karas@microsoft.com>
Fri, 17 Jan 2020 19:22:44 +0000 (11:22 -0800)
committerGitHub <noreply@github.com>
Fri, 17 Jan 2020 19:22:44 +0000 (11:22 -0800)
hostfxr_get_native_search_directories must fail when given CLI command

There's no check that when running with a "command" like hostfxr_get_native_search_directories that the code will not try to locate SDK and run CLI commands.
If it happens not only it does wrong things, but the return values are bogus (it doesn't fill the output buffer).

This change adds the necessary check to avoid this completely. It also makes sure that the output buffer size is always correctly set, even on errors.

Moved all the tests for hostfxr_get_native_search_directories to use nativehost and add a test to cover this case.


Trivial merge