Skip to content

Commit 011637f

Browse files
committed
OrcCommand: NTFSUtil: use Round.h
1 parent 3d8fe01 commit 011637f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/OrcCommand/Command/NTFSUtil/NTFSUtil_Run.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "MFTOffline.h"
2828
#include "OfflineMFTReader.h"
2929

30+
#include "Utils/Round.h"
3031
#include "Utils/TypeTraits.h"
3132
#include "Text/Fmt/Boolean.h"
3233
#include "Text/Fmt/Limit.h"
@@ -1006,11 +1007,6 @@ HRESULT Main::CommandVss()
10061007
return S_OK;
10071008
}
10081009

1009-
constexpr uint64_t RoundUp(uint64_t offset, uint64_t pageSize)
1010-
{
1011-
return (((offset)) + pageSize - 1) & (~(pageSize - 1));
1012-
}
1013-
10141010
HRESULT Orc::Command::NTFSUtil::Main::CommandBitLocker()
10151011
{
10161012
using namespace BitLocker;
@@ -1109,7 +1105,7 @@ HRESULT Orc::Command::NTFSUtil::Main::CommandBitLocker()
11091105
// Reset pointer to start of info data
11101106
reader->Seek(pHeader->InfoOffsets[i]);
11111107

1112-
auto toRead = RoundUp(infoSize + sizeof(ValidationHeader), pHeader->SectorSize);
1108+
auto toRead = RoundUpPow2(infoSize + sizeof(ValidationHeader), pHeader->SectorSize);
11131109
info_buffer.SetCount(toRead);
11141110
reader->Read(info_buffer, toRead, ullBytesRead);
11151111

@@ -1121,7 +1117,7 @@ HRESULT Orc::Command::NTFSUtil::Main::CommandBitLocker()
11211117
continue;
11221118
}
11231119

1124-
const Traits::ByteQuantity size(RoundUp(infoSize + pValidation->Size, pHeader->SectorSize));
1120+
const Traits::ByteQuantity size(RoundUpPow2(infoSize + pValidation->Size, pHeader->SectorSize));
11251121
PrintValue(metadataNode, L"Size", size);
11261122
}
11271123
}

0 commit comments

Comments
 (0)