Port twistero's DivaMovie from testing

This commit is contained in:
nastys
2019-10-10 00:49:15 +02:00
parent 2e6f3b256c
commit 42e5d97d72
5 changed files with 237 additions and 10 deletions
@@ -5,12 +5,28 @@
#include <cstdio>
#include <windows.h>
#include <detours.h>
#include <string>
#if _DEBUG
std::wstring ExePath() {
WCHAR buffer[MAX_PATH];
GetModuleFileNameW(NULL, buffer, MAX_PATH);
return std::wstring(buffer);
}
std::wstring DirPath() {
std::wstring exepath = ExePath();
std::wstring::size_type pos = exepath.find_last_of(L"\\/");
return exepath.substr(0, pos);
}
std::wstring CONFIG_FILE_STRING = DirPath() + L"\\plugins\\DivaMovie.ini";
LPCWSTR CONFIG_FILE = CONFIG_FILE_STRING.c_str();
//#if _DEBUG
#define PRINT(value, ...) printf(value, __VA_ARGS__);
#else
#define PRINT(value, ...)
#endif
//#else
//#define PRINT(value, ...)
//#endif
#define PROC_ADDRESS(libraryName, procName) \
GetProcAddress(LoadLibrary(TEXT(libraryName)), procName)
@@ -59,4 +75,4 @@
else \
{ \
PRINT("[DivaMovie] %s succeeded\n", #function); \
}
}