- Don't call the callback if the caller didn't give one

svn path=/trunk/; revision=54268
This commit is contained in:
Cameron Gutman 2011-10-29 15:03:01 +00:00
parent f89a5c926a
commit daaf78f524
3 changed files with 16 additions and 4 deletions

View file

@ -820,7 +820,10 @@ Ext2Format(IN PUNICODE_STRING DriveRoot,
ULONG ret_blk;
if (Callback != NULL)
{
Callback(PROGRESS, 0, (PVOID)&Percent);
}
RtlZeroMemory(&Ext2Sb, sizeof(EXT2_SUPER_BLOCK));
@ -997,7 +1000,10 @@ clean_up:
Ext2CloseDevice(&FileSys);
if (Callback != NULL)
{
Callback(DONE, 0, (PVOID)&bRet);
}
return Status;
}

View file

@ -294,9 +294,12 @@ UpdateProgress(PFORMAT_CONTEXT Context,
if (NewPercent > Context->Percent)
{
Context->Percent = NewPercent;
if (Context->Callback != NULL)
{
Context->Callback (PROGRESS, 0, &Context->Percent);
}
}
}
VOID

View file

@ -169,8 +169,11 @@ VfatxUpdateProgress(IN PFORMAT_CONTEXT Context,
if (NewPercent > Context->Percent)
{
Context->Percent = NewPercent;
if (Context->Callback != NULL)
{
Context->Callback(PROGRESS, 0, &Context->Percent);
}
}
}
/* EOF */