Skip to content

Commit 3a31969

Browse files
committed
missing changes after refactoring
1 parent 2be4d4d commit 3a31969

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

src/BlackBone/PE/PEImage.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ NTSTATUS PEImage::PrepareACTX( const wchar_t* filepath /*= nullptr*/ )
498498
return STATUS_SXS_CANT_GEN_ACTCTX;
499499

500500
auto hTmpFile = Handle( CreateFileW( tempPath, FILE_GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, 0, NULL ) );
501-
if (hTmpFile != INVALID_HANDLE_VALUE)
501+
if (hTmpFile)
502502
{
503503
DWORD bytes = 0;
504504
WriteFile( hTmpFile, pManifest, manifestSize, &bytes, NULL );
@@ -521,8 +521,7 @@ NTSTATUS PEImage::PrepareACTX( const wchar_t* filepath /*= nullptr*/ )
521521

522522
// Create ACTX
523523
_hctx = CreateActCtxW( &act );
524-
525-
if (_hctx != INVALID_HANDLE_VALUE)
524+
if (_hctx)
526525
return STATUS_SUCCESS;
527526

528527
// Return success if current process is protected

src/BlackBone/Process/Process.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ call_result_t<std::vector<HandleInfo>> Process::EnumHandles()
224224
for (ULONG i = 0; i < handleInfo->HandleCount; i++)
225225
{
226226
HandleInfo info;
227-
Handle hLocal;
227+
ProcessHandle hLocal;
228228
OBJECT_TYPE_INFORMATION_T* pTypeInfo = nullptr;
229229
PVOID pNameInfo = nullptr;
230230
UNICODE_STRING objectName = { 0 };

src/BlackBone/Process/ProcessCore.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ class ProcessCore
109109
void Close();
110110

111111
private:
112-
Handle _hProcess; // Process handle
113-
DWORD _pid = 0; // Process ID
114-
ptrNative _native; // Api wrapper
115-
bool _dep = true; // DEP state for process
112+
ProcessHandle _hProcess; // Process handle
113+
DWORD _pid = 0; // Process ID
114+
ptrNative _native; // Api wrapper
115+
bool _dep = true; // DEP state for process
116116
};
117117

118118
}

src/BlackBone/Process/Threads/Thread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ class Thread
268268
class ProcessCore* _core; // Core routines
269269

270270
DWORD _id = 0; // Thread ID
271-
Handle _handle; // Thread handle
271+
ProcessHandle _handle; // Thread handle
272272
};
273273

274274
using ThreadPtr = std::shared_ptr<Thread>;

src/BlackBoneTest/TestAsmJit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace Testing
7878
AssertEx::IsTrue( b );
7979

8080
// Check locally
81-
FileHandle hFile = FileHandle( CreateFileW( filePath, GENERIC_READ, 0x7, nullptr, OPEN_EXISTING, FILE_DELETE_ON_CLOSE, nullptr ) );
81+
auto hFile = Handle( CreateFileW( filePath, GENERIC_READ, 0x7, nullptr, OPEN_EXISTING, FILE_DELETE_ON_CLOSE, nullptr ) );
8282
AssertEx::IsTrue( hFile );
8383

8484
uint8_t readBuf[sizeof( writeBuf )] = { };

src/BlackBoneTest/TestManualMap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ namespace Testing
131131

132132
std::pair<std::unique_ptr<uint8_t[]>, uint32_t> GetFileData( const std::wstring& path )
133133
{
134-
auto hFile = FileHandle( CreateFileW( path.c_str(), FILE_GENERIC_READ, 0x7, nullptr, OPEN_EXISTING, 0, nullptr ) );
134+
auto hFile = Handle( CreateFileW( path.c_str(), FILE_GENERIC_READ, 0x7, nullptr, OPEN_EXISTING, 0, nullptr ) );
135135
if (hFile)
136136
{
137137
uint32_t size = GetFileSize( hFile, nullptr );

0 commit comments

Comments
 (0)