Minor code format things

This commit is contained in:
Jeremy Rifkin 2025-01-25 11:24:11 -06:00 committed by GitHub
parent ca740b1474
commit ace2324fda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,16 +103,16 @@ namespace detail {
// SymInitialize( GetCurrentProcess(), NULL, TRUE ) has // SymInitialize( GetCurrentProcess(), NULL, TRUE ) has
// already been called. // already been called.
// //
HANDLE duplicated_handle = nullptr; HANDLE duplicated_handle = nullptr;
HANDLE proc = GetCurrentProcess(); HANDLE proc = GetCurrentProcess();
HANDLE thread = GetCurrentThread(); HANDLE thread = GetCurrentThread();
if(get_cache_mode() == cache_mode::prioritize_speed) { if(get_cache_mode() == cache_mode::prioritize_speed) {
duplicated_handle = get_syminit_manager().init(proc); duplicated_handle = get_syminit_manager().init(proc);
} else { } else {
if (!DuplicateHandle(proc, proc, proc, &duplicated_handle , 0, FALSE, DUPLICATE_SAME_ACCESS)) { if(!DuplicateHandle(proc, proc, proc, &duplicated_handle, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
throw internal_error("DuplicateHandle failed{}", GetLastError()); throw internal_error("DuplicateHandle failed{}", GetLastError());
} }
if(!SymInitialize(duplicated_handle , NULL, TRUE)) { if(!SymInitialize(duplicated_handle, NULL, TRUE)) {
throw internal_error("SymInitialize failed{}", GetLastError()); throw internal_error("SymInitialize failed{}", GetLastError());
} }
} }
@ -120,7 +120,7 @@ namespace detail {
if( if(
!StackWalk64( !StackWalk64(
machine_type, machine_type,
duplicated_handle , duplicated_handle,
thread, thread,
&frame, &frame,
machine_type == IMAGE_FILE_MACHINE_I386 ? NULL : &context, machine_type == IMAGE_FILE_MACHINE_I386 ? NULL : &context,
@ -149,10 +149,10 @@ namespace detail {
} }
} }
if(get_cache_mode() != cache_mode::prioritize_speed) { if(get_cache_mode() != cache_mode::prioritize_speed) {
if(!SymCleanup(duplicated_handle )) { if(!SymCleanup(duplicated_handle)) {
throw internal_error("SymCleanup failed"); throw internal_error("SymCleanup failed");
} }
if (!CloseHandle(duplicated_handle )) { if(!CloseHandle(duplicated_handle)) {
throw internal_error("CloseHandle failed"); throw internal_error("CloseHandle failed");
} }
} }