fusion: CreateFile() returns INVALID_HANDLE_VALUE on error (Smatch).

Michael Stefaniuc mstefani at redhat.de
Tue Apr 15 12:19:16 CDT 2008


---
 dlls/fusion/assembly.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/fusion/assembly.c b/dlls/fusion/assembly.c
index d3512e7..5a1320b 100644
--- a/dlls/fusion/assembly.c
+++ b/dlls/fusion/assembly.c
@@ -355,7 +355,7 @@ HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file)
 
     assembly->hfile = CreateFileW(file, GENERIC_READ, FILE_SHARE_READ,
                                   NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-    if (!assembly->hfile)
+    if (assembly->hfile == INVALID_HANDLE_VALUE)
         return HRESULT_FROM_WIN32(GetLastError());
 
     assembly->hmap = CreateFileMappingW(assembly->hfile, NULL, PAGE_READONLY,
-- 
1.5.5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080415/e4f6cc4f/attachment.pgp 


More information about the wine-patches mailing list