Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert <krzmbrzl@gmail.com>2020-09-11 19:29:33 +0300
committerRobert <krzmbrzl@gmail.com>2020-09-11 19:29:33 +0300
commitaf7dac72f4063dd8d4dac71973ea51c25896089a (patch)
tree35558695aea94d48fd9e77d164d63fd8b7c76e90 /plugins/mumble_plugin_win32.h
parent40b28b03c150b453e00c6bc4f8d6957caea59c51 (diff)
FORMAT: Run clang-format 10 on all C/CXX source-files
Diffstat (limited to 'plugins/mumble_plugin_win32.h')
-rw-r--r--plugins/mumble_plugin_win32.h37
1 files changed, 19 insertions, 18 deletions
diff --git a/plugins/mumble_plugin_win32.h b/plugins/mumble_plugin_win32.h
index dc317a810..58c74ac3a 100644
--- a/plugins/mumble_plugin_win32.h
+++ b/plugins/mumble_plugin_win32.h
@@ -6,9 +6,9 @@
#ifndef MUMBLE_MUMBLE_PLUGIN_WIN32_H_
#define MUMBLE_MUMBLE_PLUGIN_WIN32_H_
-# ifndef MUMBLE_PLUGIN_MAIN_H_
-# error "Include mumble_plugin_main.h instead of mumble_plugin_win32.h"
-# endif
+#ifndef MUMBLE_PLUGIN_MAIN_H_
+# error "Include mumble_plugin_main.h instead of mumble_plugin_win32.h"
+#endif
#define _USE_MATH_DEFINES
#include <stdio.h>
@@ -16,14 +16,14 @@
// Define "NOMINMAX" only if it isn't already.
// MinGW defines it by default, which results in a redefinition warning.
#ifndef NOMINMAX
-# define NOMINMAX
+# define NOMINMAX
#endif
#include <windows.h>
-#include <tlhelp32.h>
+#include <iostream>
#include <math.h>
#include <sstream>
-#include <iostream>
#include <stdint.h>
+#include <tlhelp32.h>
static HANDLE hProcess;
@@ -31,13 +31,13 @@ static inline procid_t getProcess(const wchar_t *exename) {
PROCESSENTRY32 pe;
procid_t pid = 0;
- pe.dwSize = sizeof(pe);
+ pe.dwSize = sizeof(pe);
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnap != INVALID_HANDLE_VALUE) {
BOOL ok = Process32First(hSnap, &pe);
while (ok) {
- if (wcscmp(pe.szExeFile, exename)==0) {
+ if (wcscmp(pe.szExeFile, exename) == 0) {
pid = pe.th32ProcessID;
break;
}
@@ -51,15 +51,15 @@ static inline procid_t getProcess(const wchar_t *exename) {
static inline procptr_t getModuleAddr(const procid_t &pid, const wchar_t *modname) {
MODULEENTRY32 me;
procptr_t ret = 0;
- me.dwSize = sizeof(me);
- HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE|TH32CS_SNAPMODULE32, pid);
+ me.dwSize = sizeof(me);
+ HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, pid);
if (hSnap != INVALID_HANDLE_VALUE) {
BOOL ok = Module32First(hSnap, &me);
while (ok) {
- if (wcscmp(me.szModule, modname)==0) {
- uintptr_t addr = reinterpret_cast<uintptr_t>(me.modBaseAddr);
- ret = static_cast<procptr_t>(addr);
+ if (wcscmp(me.szModule, modname) == 0) {
+ uintptr_t addr = reinterpret_cast< uintptr_t >(me.modBaseAddr);
+ ret = static_cast< procptr_t >(addr);
break;
}
ok = Module32Next(hSnap, &me);
@@ -71,7 +71,7 @@ static inline procptr_t getModuleAddr(const procid_t &pid, const wchar_t *modnam
static inline bool peekProc(const procptr_t &addr, void *dest, const size_t &len) {
SIZE_T r;
- const BOOL ok = ReadProcessMemory(hProcess, reinterpret_cast<void *>(addr), dest, len, &r);
+ const BOOL ok = ReadProcessMemory(hProcess, reinterpret_cast< void * >(addr), dest, len, &r);
return (ok && (r == len));
}
@@ -81,19 +81,20 @@ static void generic_unlock() {
hProcess = nullptr;
}
- pPid = 0;
+ pPid = 0;
pModule = 0;
}
-static bool initialize(const std::multimap<std::wstring, unsigned long long int> &pids, const wchar_t *procname, const wchar_t *modname = nullptr) {
+static bool initialize(const std::multimap< std::wstring, unsigned long long int > &pids, const wchar_t *procname,
+ const wchar_t *modname = nullptr) {
hProcess = nullptr;
- pModule = 0;
+ pModule = 0;
if (!pids.empty()) {
auto iter = pids.find(std::wstring(procname));
if (iter != pids.end()) {
- pPid = static_cast<procid_t>(iter->second);
+ pPid = static_cast< procid_t >(iter->second);
} else {
pPid = 0;
}