-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
93 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
#include "Bootstrap.h" | ||
#include "SystemHelper.h" | ||
|
||
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) { | ||
// https://docs.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapsetinformation | ||
HeapSetInformation(GetProcessHeap(), HeapEnableTerminationOnCorruption, NULL, 0); | ||
#include <stdexcept> | ||
#include <iostream> | ||
|
||
_Use_decl_annotations_ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) { | ||
UNREFERENCED_PARAMETER(hInstance); | ||
UNREFERENCED_PARAMETER(hPrevInstance); | ||
UNREFERENCED_PARAMETER(pCmdLine); | ||
UNREFERENCED_PARAMETER(nCmdShow); | ||
|
||
// We dont want to try and load DLLs from the current directory (Quite often the downloads dir) | ||
SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32); | ||
::SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32); | ||
// https://docs.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapsetinformation | ||
::HeapSetInformation(::GetProcessHeap(), HeapEnableTerminationOnCorruption, NULL, 0); | ||
|
||
const auto systemHelper = std::make_shared<SystemHelper>(); | ||
|
||
auto bs = Bootstrap(systemHelper); | ||
bs.launch(); | ||
|
||
try { | ||
bs.launch(); | ||
} catch (const std::runtime_error& error) { | ||
std::cout << error.what() << std::endl; | ||
return 1; | ||
} | ||
|
||
return 0; | ||
} |