mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-27 08:41:02 +08:00
small refactoring
This commit is contained in:
parent
34bb8d8119
commit
ce61ea1a77
@ -44,7 +44,7 @@ namespace profiler_gui {
|
||||
}
|
||||
|
||||
EasyGlobals::EasyGlobals()
|
||||
: selected_thread(0)
|
||||
: selected_thread(0U)
|
||||
, selected_block(::profiler_gui::numeric_max<decltype(selected_block)>())
|
||||
, chrono_text_position(ChronoTextPosition_Center)
|
||||
, enable_statistics(true)
|
||||
|
@ -95,7 +95,7 @@ namespace profiler_gui {
|
||||
::profiler::descriptors_list_t descriptors; ///< Profiler block descriptors list
|
||||
EasyBlocks gui_blocks; ///< Profiler graphics blocks builded by GUI
|
||||
::profiler::thread_id_t selected_thread; ///< Current selected thread id
|
||||
unsigned int selected_block; ///< Current selected profiler block index
|
||||
::profiler::block_index_t selected_block; ///< Current selected profiler block index
|
||||
ChronometerTextPosition chrono_text_position; ///<
|
||||
bool enable_statistics; ///< Enable gathering and using statistics (Disable if you want to consume less memory)
|
||||
bool draw_graphics_items_borders; ///< Draw borders for graphics blocks or not
|
||||
|
@ -179,11 +179,11 @@ namespace profiler {
|
||||
LUID privilegyId;
|
||||
if (LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &privilegyId))
|
||||
{
|
||||
TOKEN_PRIVILEGES tokenPrivilegy;
|
||||
tokenPrivilegy.PrivilegeCount = 1;
|
||||
tokenPrivilegy.Privileges[0].Luid = privilegyId;
|
||||
tokenPrivilegy.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
||||
success = AdjustTokenPrivileges(hToken, FALSE, &tokenPrivilegy, sizeof(TOKEN_PRIVILEGES), NULL, NULL) != FALSE;
|
||||
TOKEN_PRIVILEGES tokenPrivilege;
|
||||
tokenPrivilege.PrivilegeCount = 1;
|
||||
tokenPrivilege.Privileges[0].Luid = privilegyId;
|
||||
tokenPrivilege.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
||||
success = AdjustTokenPrivileges(hToken, FALSE, &tokenPrivilege, sizeof(TOKEN_PRIVILEGES), NULL, NULL) != FALSE;
|
||||
}
|
||||
|
||||
CloseHandle(hToken);
|
||||
|
Loading…
x
Reference in New Issue
Block a user