Permalink
Browse files

Fixed the argc checks in winmain and CxbxKrnl.cpp that were checking …

…against the wrong value. This was preventing the emulator from being launched in Kernel mode.
  • Loading branch information...
Frederick Arthur Hallock III
Frederick Arthur Hallock III committed Sep 11, 2018
1 parent db8cf25 commit 440b62d63e0a06f885df4d3bd85e23b7878934d6
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/Cxbx/WinMain.cpp
  2. +3 −3 src/CxbxKrnl/CxbxKrnl.cpp
View
@@ -84,7 +84,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
bKernel = true;
// Perform check if command line contain gui's hWnd value.
if (__argc > 2) {
if (__argc > 3) {
hWnd = (HWND)std::stoi(__argv[3], nullptr, 10);
hWnd = IsWindow(hWnd) ? hWnd : nullptr;
@@ -869,19 +869,19 @@ void CxbxKrnlMain(int argc, char* argv[])
// Get DCHandle :
HWND hWnd = 0;
if (argc > 2) {
if (argc > 3) {
hWnd = (HWND)std::atoi(argv[3]);
}
// Get KernelDebugMode :
DebugMode DbgMode = DebugMode::DM_NONE;
if (argc > 3) {
if (argc > 4) {
DbgMode = (DebugMode)std::atoi(argv[4]);
}
// Get KernelDebugFileName :
std::string DebugFileName = "";
if (argc > 4) {
if (argc > 5) {
DebugFileName = argv[5];
}

0 comments on commit 440b62d

Please sign in to comment.