Skip to content

Commit

Permalink
Restart launcher at game exit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaldaien committed Sep 9, 2016
1 parent 7a3bc2e commit 994574e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Binary file modified UnX/UnX.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion UnX/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static
iSK_INI*
booster_ini = nullptr;

std::wstring UNX_VER_STR = L"0.6.3";
std::wstring UNX_VER_STR = L"0.6.4";
unx_config_s config;

typedef bool (WINAPI *SK_DXGI_EnableFlipMode_pfn) (bool);
Expand Down
23 changes: 23 additions & 0 deletions UnX/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ extern SK_GetGameWindow_pfn SK_GetGameWindow;

IDXGISwapChain* pGameSwapChain = nullptr;

extern BOOL
APIENTRY
DllMain (HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID /* lpReserved */);

enum unx_fullscreen_op_t {
Fullscreen,
Window,
Expand Down Expand Up @@ -318,7 +324,24 @@ DetourWindowProc ( _In_ HWND hWnd,
// in fullscreen mode
unx::window.active = last_active;

DetourWindowProc_Original (hWnd, uMsg, wParam, lParam);

#if 0
DllMain ( GetModuleHandle (config.system.injector.c_str ()),
DLL_PROCESS_DETACH,
nullptr );

typedef void (WINAPI *SK_SelfDestruct_pfn)(void);
static SK_SelfDestruct_pfn
SK_SelfDestruct =
(SK_SelfDestruct_pfn)
GetProcAddress ( GetModuleHandle (config.system.injector.c_str ()),
"SK_SelfDestruct" );

SK_SelfDestruct ();

ExitProcess (0);
#endif
}

//
Expand Down

0 comments on commit 994574e

Please sign in to comment.