diff --git a/WinTime/Memory.h b/WinTime/Memory.h index 182315f..eb9e707 100644 --- a/WinTime/Memory.h +++ b/WinTime/Memory.h @@ -64,10 +64,9 @@ namespace WinTime struct ClientProcessMemoryCounter { explicit ClientProcessMemoryCounter(HANDLE hProcess) - : data_{} { - bool res = GetProcessMemoryInfo(hProcess, &data_, sizeof(data_)); - if (!res) + data_.cb = sizeof(data_); + if (!GetProcessMemoryInfo(hProcess, &data_, sizeof(data_))) { throw std::runtime_error("Could not get memory info!"); } @@ -121,4 +120,4 @@ namespace WinTime PROCESS_MEMORY_COUNTERS data_; }; -} // namespace \ No newline at end of file +} // namespace