Make wimlib-imagex less noisy when running on Windoze XP
authorEric Biggers <ebiggers3@gmail.com>
Tue, 14 May 2013 04:22:28 +0000 (23:22 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 14 May 2013 04:22:28 +0000 (23:22 -0500)
src/win32_capture.c
src/win32_common.c

index 702d93c..3721123 100644 (file)
@@ -1155,6 +1155,10 @@ win32_build_dentry_tree(struct wim_dentry **root_ret,
        struct win32_capture_state state;
        unsigned vol_flags;
 
+       if (!win32func_FindFirstStreamW) {
+               WARNING("Running on Windows XP or earlier; "
+                       "alternate data streams will not be captured.");
+       }
 
        path_nchars = wcslen(root_disk_path);
        if (path_nchars > 32767)
index 2610c59..78ea99a 100644 (file)
@@ -638,20 +638,13 @@ win32_global_init()
                }
        }
 
-       DEBUG("Looking for FindFirstStreamW");
-       win32func_FindFirstStreamW = (void*)GetProcAddress(hKernel32, "FindFirstStreamW");
-       if (!win32func_FindFirstStreamW) {
-               WARNING("Could not find function FindFirstStreamW() in Kernel32.dll!");
-               WARNING("Capturing alternate data streams will not be supported.");
-               return;
-       }
-
-       DEBUG("Looking for FindNextStreamW");
-       win32func_FindNextStreamW = (void*)GetProcAddress(hKernel32, "FindNextStreamW");
-       if (!win32func_FindNextStreamW) {
-               WARNING("Could not find function FindNextStreamW() in Kernel32.dll!");
-               WARNING("Capturing alternate data streams will not be supported.");
-               win32func_FindFirstStreamW = NULL;
+       win32func_FindFirstStreamW = (void*)GetProcAddress(hKernel32,
+                                                          "FindFirstStreamW");
+       if (win32func_FindFirstStreamW) {
+               win32func_FindNextStreamW = (void*)GetProcAddress(hKernel32,
+                                                                 "FindNextStreamW");
+               if (!win32func_FindNextStreamW)
+                       win32func_FindFirstStreamW = NULL;
        }
 }