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:
authorThorvald Natvig <slicer@users.sourceforge.net>2010-02-25 16:39:16 +0300
committerThorvald Natvig <slicer@users.sourceforge.net>2010-02-25 16:39:16 +0300
commit63adacd5fcee46c3b5294aade232bcd46e50cab4 (patch)
treecc63e2282f87644b6e89f3a178fead2564756647 /plugins/mumble_plugin_win32.h
parent71e5e85277e793316702116a5b898fdb03008494 (diff)
Common dwPid var
Diffstat (limited to 'plugins/mumble_plugin_win32.h')
-rw-r--r--plugins/mumble_plugin_win32.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins/mumble_plugin_win32.h b/plugins/mumble_plugin_win32.h
index 2ede24305..744ea4c5b 100644
--- a/plugins/mumble_plugin_win32.h
+++ b/plugins/mumble_plugin_win32.h
@@ -40,6 +40,7 @@
#include "mumble_plugin.h"
+DWORD dwPid;
static HANDLE hProcess;
static BYTE *pModule;
@@ -84,6 +85,10 @@ static inline BYTE *getModuleAddr(DWORD pid, const wchar_t *modname) {
return addr;
}
+static inline BYTE *getModuleAddr(const wchar_t *modname) {
+ return getModuleAddr(dwPid, modname);
+}
+
static inline bool peekProc(VOID *base, VOID *dest, SIZE_T len) {
SIZE_T r;
BOOL ok=ReadProcessMemory(hProcess, base, dest, len, &r);
@@ -122,19 +127,19 @@ static void inline u8(std::wstring &dst, const char *src, int srclen) {
dst.assign(wbuff, len);
}
-static bool inline initialize(const wchar_t *procname, const wchar_t *modname = NULL) {
+static bool inline initialize(const std::multimap<std::wstring, unsigned long long int> &, const wchar_t *procname, const wchar_t *modname = NULL) {
hProcess = NULL;
pModule = NULL;
- DWORD pid=getProcess(procname);
- if (!pid)
+ dwPid=getProcess(procname);
+ if (!dwPid)
return false;
- pModule=getModuleAddr(pid, modname ? modname : procname);
+ pModule=getModuleAddr(modname ? modname : procname);
if (!pModule)
return false;
- hProcess=OpenProcess(PROCESS_VM_READ, false, pid);
+ hProcess=OpenProcess(PROCESS_VM_READ, false, dwPid);
if (!hProcess)
return false;