qga-win: fix error-handling in getNameByStringSID()
commit8cedc80555e5a395a4fda7130b0115015e775c48
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 27 Oct 2017 00:53:45 +0000 (26 19:53 -0500)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 27 Oct 2017 01:01:32 +0000 (26 20:01 -0500)
tree2651c66a40af16f8ed2e8395e7c1a6e4764a87f3
parent53f9fcb263e40ff82b9fcbce8b8cba0f3649ac9b
qga-win: fix error-handling in getNameByStringSID()

In one case we misconstrue a BOOL return as an HRESULT, and in the
other case we don't check the BOOL return from LookupAccountSidW()
before extracting the HRESULT from GetLastError(). Both can lead to
getNameByStringSID() misreporting an error.

Reported-by: Chen Hanxiao <chenhanxiao@gmail.com>
Suggested-by: Tomáš Golembiovský <tgolembi@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/vss-win32/install.cpp