@@ -110,8 +110,7 @@ DWORD Auth::GetProcessId(const std::wstring& processName)
110110 CloseHandle (snapshot);
111111 return entry.th32ProcessID ;
112112 }
113- }
114- while (Process32NextW (snapshot, &entry));
113+ } while (Process32NextW (snapshot, &entry));
115114 }
116115 }
117116 CloseHandle (snapshot);
@@ -134,8 +133,7 @@ std::vector<DWORD> Auth::GetAllProcessIds(const std::wstring& processName)
134133 {
135134 pids.emplace_back (entry.th32ProcessID );
136135 }
137- }
138- while (Process32NextW (snapshot, &entry));
136+ } while (Process32NextW (snapshot, &entry));
139137 }
140138 }
141139 CloseHandle (snapshot);
@@ -145,13 +143,13 @@ std::vector<DWORD> Auth::GetAllProcessIds(const std::wstring& processName)
145143std::wstring Auth::GetProcessCommandLine (const DWORD& processId)
146144{
147145 using tNtQueryInformationProcess = NTSTATUS (__stdcall*)
148- (
149- HANDLE ProcessHandle,
150- ULONG ProcessInformationClass,
151- PVOID ProcessInformation,
152- ULONG ProcessInformationLength,
153- PULONG ReturnLength
154- );
146+ (
147+ HANDLE ProcessHandle,
148+ ULONG ProcessInformationClass,
149+ PVOID ProcessInformation,
150+ ULONG ProcessInformationLength,
151+ PULONG ReturnLength
152+ );
155153
156154 std::wstring result;
157155 const HANDLE processHandle = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0 , processId);
@@ -202,7 +200,7 @@ std::wstring Auth::GetProcessCommandLine(const DWORD& processId)
202200 ZeroMemory (&pbi, sizeof (pbi));
203201
204202 if (const auto NtQueryInformationProcess =
205- reinterpret_cast <tNtQueryInformationProcess>(GetProcAddress (GetModuleHandleA (" ntdll.dll" ), " NtWow64QueryInformationProcess64" ));
203+ reinterpret_cast <tNtQueryInformationProcess>(GetProcAddress (GetModuleHandleA (" ntdll.dll" ), " NtWow64QueryInformationProcess64" ));
206204 NtQueryInformationProcess (processHandle, 0 , &pbi, sizeof (pbi), nullptr ) != 0 )
207205 {
208206 MessageBoxA (nullptr , " NtQueryInformationProcess failed" , nullptr , 0 );
@@ -257,14 +255,14 @@ std::wstring Auth::GetProcessCommandLine(const DWORD& processId)
257255 USHORT Length;
258256 USHORT MaximumLength;
259257 PWSTR Buffer;
260- } UNICODE_STRING, *PUNICODE_STRING [[maybe_unused]];
258+ } UNICODE_STRING, * PUNICODE_STRING [[maybe_unused]];
261259 /* [[maybe_unused]]*/ using PCUNICODE_STRING = const UNICODE_STRING*;
262260
263261 PROCESS_BASIC_INFORMATION pbi;
264262 ZeroMemory (&pbi, sizeof (pbi));
265263
266264 if (const auto NtQueryInformationProcess =
267- reinterpret_cast <tNtQueryInformationProcess>(GetProcAddress (GetModuleHandleA (" ntdll.dll" ), " NtQueryInformationProcess" ));
265+ reinterpret_cast <tNtQueryInformationProcess>(GetProcAddress (GetModuleHandleA (" ntdll.dll" ), " NtQueryInformationProcess" ));
268266 NtQueryInformationProcess (processHandle, 0 , &pbi, sizeof (pbi), nullptr ) != 0 )
269267 {
270268 MessageBoxA (nullptr , " NtQueryInformationProcess failed" , nullptr , 0 );
@@ -310,7 +308,7 @@ std::wstring Auth::GetProcessPath(const DWORD& processId)
310308 if (WCHAR result[MAX_PATH]; GetModuleFileNameExW (processHandle, nullptr , result, MAX_PATH))
311309 {
312310 CloseHandle (processHandle);
313- return {result};
311+ return { result };
314312 }
315313 CloseHandle (processHandle);
316314 }
@@ -332,12 +330,12 @@ std::string Auth::GetFileVersion(const std::wstring& file)
332330 const DWORD dwFileVersionMS = lpFfi->dwFileVersionMS ;
333331 const DWORD dwFileVersionLS = lpFfi->dwFileVersionLS ;
334332 std::string result = std::format (" {}.{}.{}.{}" ,
335- HIWORD (dwFileVersionMS), LOWORD (dwFileVersionMS),
336- HIWORD (dwFileVersionLS), LOWORD (dwFileVersionLS));
333+ HIWORD (dwFileVersionMS), LOWORD (dwFileVersionMS),
334+ HIWORD (dwFileVersionLS), LOWORD (dwFileVersionLS));
337335 return result;
338336 }
339337 }
340338 }
341339
342340 return " " ;
343- }
341+ }
0 commit comments