Skip to content

Commit

Permalink
update to 1.1.4: explicitly end new threads
Browse files Browse the repository at this point in the history
  • Loading branch information
tomysshadow committed Oct 12, 2022
1 parent 1834713 commit 8dcad7a
Show file tree
Hide file tree
Showing 26 changed files with 9 additions and 6 deletions.
Binary file modified Debug/FlashpointProxy.dll
Binary file not shown.
Binary file modified Debug/FlashpointProxy.ilk
Binary file not shown.
Binary file modified Debug/FlashpointProxy.pdb
Binary file not shown.
Binary file modified FlashpointProxy/Debug/FlashpointProxy.obj
Binary file not shown.
Binary file modified FlashpointProxy/Debug/FlashpointProxy.res
Binary file not shown.
Binary file modified FlashpointProxy/Debug/FlashpointProxy.tlog/link.read.1.tlog
Binary file not shown.
Binary file modified FlashpointProxy/Debug/main.obj
Binary file not shown.
Binary file modified FlashpointProxy/Debug/safeseh.obj
Binary file not shown.
Binary file modified FlashpointProxy/Debug/shared.obj
Binary file not shown.
Binary file modified FlashpointProxy/Debug/vc141.idb
Binary file not shown.
Binary file modified FlashpointProxy/Debug/vc141.pdb
Binary file not shown.
Binary file modified FlashpointProxy/FlashpointProxy.aps
Binary file not shown.
Binary file modified FlashpointProxy/FlashpointProxy.rc
Binary file not shown.
Binary file modified FlashpointProxy/Release/FlashpointProxy.obj
Binary file not shown.
Binary file modified FlashpointProxy/Release/FlashpointProxy.res
Binary file not shown.
Binary file modified FlashpointProxy/Release/main.obj
Binary file not shown.
Binary file modified FlashpointProxy/Release/safeseh.obj
Binary file not shown.
Binary file modified FlashpointProxy/Release/shared.obj
Binary file not shown.
Binary file modified FlashpointProxy/Release/vc141.pdb
Binary file not shown.
11 changes: 7 additions & 4 deletions FlashpointProxy/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "shared.h"
#include "FlashpointProxy.h"
#include <windows.h>
#include <WinNT.h>
#include <winnt.h>
#include <process.h>

LPSTR proxyServer = "http=127.0.0.1:22500;https=127.0.0.1:22500;ftp=127.0.0.1:22500";
Expand All @@ -21,8 +21,11 @@ unsigned int __stdcall dynamicThread(void* argList) {
if (!FlashpointProxy::enable(proxyServer)) {
showLastError("Failed to Enable Flashpoint Proxy");
terminateCurrentProcess();
_endthreadex(1);
return 1;
}

_endthreadex(0);
return 0;
}

Expand All @@ -46,16 +49,16 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, PCONTEXT contex
// deadlock fallback
// nothing we can do except begin a thread
// and hope it finishes before WinInet is used
HANDLE threadHandle = (HANDLE)_beginthreadex(NULL, 0, dynamicThread, 0, 0, 0);
HANDLE threadHandle = (HANDLE)_beginthreadex(NULL, 0, dynamicThread, NULL, 0, NULL);

if (!threadHandle || threadHandle == INVALID_HANDLE_VALUE) {
showLastError("Failed to Begin Dynamic Thread");
showLastError("Failed to Begin Thread");
terminateCurrentProcess();
return FALSE;
}

if (!CloseHandle(threadHandle)) {
showLastError("Failed to Close Dynamic Thread Handle");
showLastError("Failed to Close Handle");
terminateCurrentProcess();
return FALSE;
}
Expand Down
2 changes: 1 addition & 1 deletion FlashpointProxy/shared.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "shared.h"
#include <windows.h>
#include <WinNT.h>
#include <winnt.h>
#include <string>
#include <sstream>

Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flashpoint Proxy 1.1.3
Flashpoint Proxy 1.1.4
By Anthony Kleine

This library sets up a process to connect to the Flashpoint Server via
Expand Down
Binary file modified Release/FlashpointProxy.dll
Binary file not shown.
Binary file modified Release/FlashpointProxy.iobj
Binary file not shown.
Binary file modified Release/FlashpointProxy.ipdb
Binary file not shown.
Binary file modified Release/FlashpointProxy.pdb
Binary file not shown.

0 comments on commit 8dcad7a

Please sign in to comment.