[FSLIB]
authorCameron Gutman <aicommander@gmail.com>
Sat, 29 Oct 2011 15:03:01 +0000 (15:03 +0000)
committerCameron Gutman <aicommander@gmail.com>
Sat, 29 Oct 2011 15:03:01 +0000 (15:03 +0000)
- Don't call the callback if the caller didn't give one

svn path=/trunk/; revision=54268

reactos/lib/fslib/ext2lib/Mke2fs.c
reactos/lib/fslib/vfatlib/vfatlib.c
reactos/lib/fslib/vfatxlib/vfatxlib.c

index 6c64bc6..fbca61b 100644 (file)
@@ -820,7 +820,10 @@ Ext2Format(IN PUNICODE_STRING DriveRoot,
     ULONG ret_blk;
 
 
-    Callback(PROGRESS, 0, (PVOID)&Percent);
+    if (Callback != NULL)
+    {
+        Callback(PROGRESS, 0, (PVOID)&Percent);
+    }
 
 
     RtlZeroMemory(&Ext2Sb, sizeof(EXT2_SUPER_BLOCK));
@@ -997,7 +1000,10 @@ clean_up:
 
     Ext2CloseDevice(&FileSys);
 
-    Callback(DONE, 0, (PVOID)&bRet);
+    if (Callback != NULL)
+    {
+        Callback(DONE, 0, (PVOID)&bRet);
+    }
 
     return Status;
 }
index f3b0146..804cd0a 100644 (file)
@@ -294,7 +294,10 @@ UpdateProgress(PFORMAT_CONTEXT Context,
     if (NewPercent > Context->Percent)
     {
         Context->Percent = NewPercent;
-        Context->Callback (PROGRESS, 0, &Context->Percent);
+        if (Context->Callback != NULL)
+        {
+            Context->Callback (PROGRESS, 0, &Context->Percent);
+        }
     }
 }
 
index 845c7a7..62a7e62 100644 (file)
@@ -169,7 +169,10 @@ VfatxUpdateProgress(IN PFORMAT_CONTEXT Context,
     if (NewPercent > Context->Percent)
     {
         Context->Percent = NewPercent;
-        Context->Callback(PROGRESS, 0, &Context->Percent);
+        if (Context->Callback != NULL)
+        {
+            Context->Callback(PROGRESS, 0, &Context->Percent);
+        }
     }
 }