From: Eric Biggers Date: Wed, 28 Jan 2015 04:07:52 +0000 (-0600) Subject: win32_capture.c: use NULL instead of INVALID_HANDLE_VALUE X-Git-Tag: v1.8.0~43 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=55a72fc546978ea0502ef0d0eba73ffd6c3ee785;hp=9713bcb2d2ef098a0286df35909b5637e0db372a win32_capture.c: use NULL instead of INVALID_HANDLE_VALUE Code was correct, but since this is an NT-level handle NULL makes more sense. --- diff --git a/src/win32_capture.c b/src/win32_capture.c index 9509e3d6..e89d098c 100644 --- a/src/win32_capture.c +++ b/src/win32_capture.c @@ -1114,7 +1114,7 @@ winnt_build_dentry_tree_recursive(struct wim_dentry **root_ret, { struct wim_dentry *root = NULL; struct wim_inode *inode = NULL; - HANDLE h = INVALID_HANDLE_VALUE; + HANDLE h = NULL; int ret; NTSTATUS status; FILE_ALL_INFORMATION file_info; @@ -1369,7 +1369,7 @@ retry_open: * file, we have to close the file and re-open it later if * needed. */ (*func_NtClose)(h); - h = INVALID_HANDLE_VALUE; + h = NULL; ret = winnt_load_encrypted_stream_info(inode, full_path, params->unhashed_streams); if (ret) @@ -1394,7 +1394,7 @@ retry_open: /* Directory: recurse to children. */ - if (unlikely(h == INVALID_HANDLE_VALUE)) { + if (unlikely(!h)) { /* Re-open handle that was closed to read raw encrypted * data. */ status = winnt_openat(cur_dir, @@ -1432,7 +1432,7 @@ out_progress: else ret = do_capture_progress(params, WIMLIB_SCAN_DENTRY_EXCLUDED, NULL); out: - if (likely(h != INVALID_HANDLE_VALUE)) + if (likely(h)) (*func_NtClose)(h); if (unlikely(ret)) { free_dentry_tree(root, params->lookup_table);