win32_capture.c: use NULL instead of INVALID_HANDLE_VALUE
authorEric Biggers <ebiggers3@gmail.com>
Wed, 28 Jan 2015 04:07:52 +0000 (22:07 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 29 Jan 2015 02:30:38 +0000 (20:30 -0600)
Code was correct, but since this is an NT-level handle NULL makes more
sense.

src/win32_capture.c

index 9509e3d691c3852aea13c954dd353da7e8968844..e89d098ccae37a79f1102450192c18c97298b19f 100644 (file)
@@ -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);