Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
dz333n committed Apr 7, 2024
1 parent 1d22587 commit 201b80c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions SubsystemTool/SubsystemTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ int ProcessPath(_TCHAR* path, _TCHAR* subsys, BOOL ResetVersion)
}

// Free memory
LocalFree(dosHeader);
LocalFree(ntHeaders);
// Why the fuck these lines were for? They seem to do something horrible and crash the app since 2024
// LocalFree(dosHeader);
// LocalFree(ntHeaders);

CloseHandle(hFile);

Expand Down Expand Up @@ -212,6 +213,7 @@ BOOL ThereIsArgument(int argc, _TCHAR* argv[], _TCHAR* arg)

int _tmain(int argc, _TCHAR* argv[])
{
/*
if (argc <= 1
|| ThereIsArgument(argc, argv, (_TCHAR*)TEXT("/help"))
|| ThereIsArgument(argc, argv, (_TCHAR*)TEXT("--help"))
Expand All @@ -225,8 +227,8 @@ int _tmain(int argc, _TCHAR* argv[])
_tprintf(TEXT("wince, win32gui (default), win32cui.\n\n"));
_tprintf(TEXT("Include /rv after subsystem if you want to reset subsystem version.\n"));
return 1;
}
}*/

BOOL ResetVersion = ThereIsArgument(argc, argv, (_TCHAR*)TEXT("/rv"));
return ProcessPath(argv[1], (argc >= 3 ? argv[2] : (_TCHAR*)TEXT("win32gui")), ResetVersion);
return ProcessPath((_TCHAR*)TEXT("C:\\ce6_solitaire\\solitare.exe"), (argc >= 3 ? argv[2] : (_TCHAR*)TEXT("win32gui")), ResetVersion);
}

0 comments on commit 201b80c

Please sign in to comment.