Merge pull request #3435 from jpark37/game-capture-messages
win-capture: Improve game capture messagesmaster
commit
01c7200716
|
@ -69,7 +69,7 @@ bool init_pipe(void)
|
||||||
sprintf(new_name, "%s%lu", PIPE_NAME, GetCurrentProcessId());
|
sprintf(new_name, "%s%lu", PIPE_NAME, GetCurrentProcessId());
|
||||||
|
|
||||||
if (!ipc_pipe_client_open(&pipe, new_name)) {
|
if (!ipc_pipe_client_open(&pipe, new_name)) {
|
||||||
DbgOut("Failed to open pipe\n");
|
DbgOut("[OBS] Failed to open pipe\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +158,10 @@ static inline void log_current_process(void)
|
||||||
MAX_PATH);
|
MAX_PATH);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
process_name[len] = 0;
|
process_name[len] = 0;
|
||||||
hlog("Hooked to process: %s", process_name);
|
hlog("graphics-hook.dll loaded against process: %s",
|
||||||
|
process_name);
|
||||||
|
} else {
|
||||||
|
hlog("graphics-hook.dll loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
hlog("(half life scientist) everything.. seems to be in order");
|
hlog("(half life scientist) everything.. seems to be in order");
|
||||||
|
@ -328,7 +331,7 @@ static inline bool attempt_hook(void)
|
||||||
|
|
||||||
if (!d3d9_hooked) {
|
if (!d3d9_hooked) {
|
||||||
if (!d3d9_hookable()) {
|
if (!d3d9_hookable()) {
|
||||||
DbgOut("no D3D9 hook address found!\n");
|
DbgOut("[OBS] no D3D9 hook address found!\n");
|
||||||
d3d9_hooked = true;
|
d3d9_hooked = true;
|
||||||
} else {
|
} else {
|
||||||
d3d9_hooked = hook_d3d9();
|
d3d9_hooked = hook_d3d9();
|
||||||
|
@ -340,7 +343,7 @@ static inline bool attempt_hook(void)
|
||||||
|
|
||||||
if (!dxgi_hooked) {
|
if (!dxgi_hooked) {
|
||||||
if (!dxgi_hookable()) {
|
if (!dxgi_hookable()) {
|
||||||
DbgOut("no DXGI hook address found!\n");
|
DbgOut("[OBS] no DXGI hook address found!\n");
|
||||||
dxgi_hooked = true;
|
dxgi_hooked = true;
|
||||||
} else {
|
} else {
|
||||||
dxgi_hooked = hook_dxgi();
|
dxgi_hooked = hook_dxgi();
|
||||||
|
@ -403,7 +406,7 @@ static inline void capture_loop(void)
|
||||||
static DWORD WINAPI main_capture_thread(HANDLE thread_handle)
|
static DWORD WINAPI main_capture_thread(HANDLE thread_handle)
|
||||||
{
|
{
|
||||||
if (!init_hook(thread_handle)) {
|
if (!init_hook(thread_handle)) {
|
||||||
DbgOut("Failed to init hook\n");
|
DbgOut("[OBS] Failed to init hook\n");
|
||||||
free_hook();
|
free_hook();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -416,10 +419,11 @@ static inline void hlogv(const char *format, va_list args)
|
||||||
{
|
{
|
||||||
char message[1024] = "";
|
char message[1024] = "";
|
||||||
int num = _vsprintf_p(message, 1024, format, args);
|
int num = _vsprintf_p(message, 1024, format, args);
|
||||||
if (num) {
|
if (num > 0) {
|
||||||
if (!ipc_pipe_client_write(&pipe, message, (size_t)num + 1)) {
|
if (!ipc_pipe_client_write(&pipe, message, (size_t)num + 1)) {
|
||||||
ipc_pipe_client_free(&pipe);
|
ipc_pipe_client_free(&pipe);
|
||||||
}
|
}
|
||||||
|
DbgOut("[OBS] ");
|
||||||
DbgOut(message);
|
DbgOut(message);
|
||||||
DbgOut("\n");
|
DbgOut("\n");
|
||||||
}
|
}
|
||||||
|
@ -836,7 +840,7 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID unused1)
|
||||||
dll_inst = hinst;
|
dll_inst = hinst;
|
||||||
|
|
||||||
if (!init_dll()) {
|
if (!init_dll()) {
|
||||||
DbgOut("Duplicate hook library");
|
DbgOut("[OBS] Duplicate hook library");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -847,7 +851,7 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID unused1)
|
||||||
SYNCHRONIZE, false, 0);
|
SYNCHRONIZE, false, 0);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
DbgOut("Failed to get current thread handle");
|
DbgOut("[OBS] Failed to get current thread handle");
|
||||||
|
|
||||||
if (!init_signals()) {
|
if (!init_signals()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue