[Driver] Fix Windows SDK Detection
authorZachary Turner <zturner@google.com>
Thu, 28 Jul 2016 17:13:32 +0000 (17:13 +0000)
committerZachary Turner <zturner@google.com>
Thu, 28 Jul 2016 17:13:32 +0000 (17:13 +0000)
commite78a34757eaf0ed20e30aaaef09d60b4a00ec8c2
treeb30938be5123ae359bd8fcdf9f4a8a22f36f5691
parentd7748d649194b33bd66c2dc6e58bcf4e2b442179
[Driver] Fix Windows SDK Detection

This fixes a couple of bugs in Windows SDK Detection.

1. `readFullStringValue` returns a bool, but was being compared
   with ERROR_SUCCESS.
2. `RegQueryValueExW` might return the null terminator in the
   queried value which will result in incorrect values being
   returned from `getSystemRegistryString`.

Patch By: comicfans44@gmail.com
Reviewed By: zturner
Differential Revision: http://reviews.llvm.org/D21946

llvm-svn: 277005
clang/lib/Driver/MSVCToolChain.cpp