[vhd] fix VHD detection on Windows 7

* Revert to using strstr
* Also fix a potential issue with GetTextExtentPoint
This commit is contained in:
Pete Batard 2014-12-03 18:44:00 +00:00
parent 8e8a2bc827
commit efd22d1fe3
4 changed files with 20 additions and 21 deletions

View file

@ -383,7 +383,9 @@ static __inline BOOL GetTextExtentPointU(HDC hdc, const char* lpString, LPSIZE l
BOOL ret = FALSE;
DWORD err = ERROR_INVALID_DATA;
wconvert(lpString);
ret = GetTextExtentPointW(hdc, wlpString, (int)wcslen(wlpString)+1, lpSize);
if (wlpString == NULL)
return FALSE;
ret = GetTextExtentPoint32W(hdc, wlpString, (int)wcslen(wlpString), lpSize);
err = GetLastError();
wfree(lpString);
SetLastError(err);