From ecac3c1c064ce16fe6a69564d24d7d15e67e2051 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 7 Mar 2007 00:05:15 +0100 Subject: [PATCH] atl: Compare file handle to INVALID_HANDLE_VALUE to handle errors. --- dlls/atl/registrar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c index 6fa2fbdf223..353e1137254 100644 --- a/dlls/atl/registrar.c +++ b/dlls/atl/registrar.c @@ -479,7 +479,7 @@ static HRESULT file_register(Registrar *This, LPCOLESTR fileName, BOOL do_regist HRESULT hres; file = CreateFileW(fileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL); - if(file) { + if(file != INVALID_HANDLE_VALUE) { filelen = GetFileSize(file, NULL); regstra = HeapAlloc(GetProcessHeap(), 0, filelen); lres = ReadFile(file, regstra, filelen, NULL, NULL);