TLS TerminateProcess bug fixed!!!

This commit is contained in:
Aaron Robinson 2003-05-02 06:51:35 +00:00
parent cfa14ec0ba
commit 09ea982f4f
6 changed files with 44 additions and 25 deletions

View File

@ -1,9 +1,9 @@
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbe", "Cxbe.vcproj", "{2BEF8939-0056-4B8E-96EB-06BA582345F0}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbe", "Cxbe.vcproj", "{D549237B-D557-44C3-8CD9-808DEBFE66C4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbx", "Cxbx.vcproj", "{A0663801-ED2D-4DB0-A282-00407B2270AD}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbx", "Cxbx.vcproj", "{835B2FB6-F435-4206-B8A6-F86C750A9C3B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CxbxKrnl", "CxbxKrnl.vcproj", "{75779893-83CE-407E-900B-8CAE51E19618}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CxbxKrnl", "CxbxKrnl.vcproj", "{E22132CE-EEB0-4067-B011-838388DA1AD0}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
@ -11,21 +11,21 @@ Global
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
{A0663801-ED2D-4DB0-A282-00407B2270AD}.0 = {75779893-83CE-407E-900B-8CAE51E19618}
{835B2FB6-F435-4206-B8A6-F86C750A9C3B}.0 = {E22132CE-EEB0-4067-B011-838388DA1AD0}
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{2BEF8939-0056-4B8E-96EB-06BA582345F0}.Debug.ActiveCfg = Debug|Win32
{2BEF8939-0056-4B8E-96EB-06BA582345F0}.Debug.Build.0 = Debug|Win32
{2BEF8939-0056-4B8E-96EB-06BA582345F0}.Release.ActiveCfg = Release|Win32
{2BEF8939-0056-4B8E-96EB-06BA582345F0}.Release.Build.0 = Release|Win32
{A0663801-ED2D-4DB0-A282-00407B2270AD}.Debug.ActiveCfg = Debug|Win32
{A0663801-ED2D-4DB0-A282-00407B2270AD}.Debug.Build.0 = Debug|Win32
{A0663801-ED2D-4DB0-A282-00407B2270AD}.Release.ActiveCfg = Release|Win32
{A0663801-ED2D-4DB0-A282-00407B2270AD}.Release.Build.0 = Release|Win32
{75779893-83CE-407E-900B-8CAE51E19618}.Debug.ActiveCfg = Debug|Win32
{75779893-83CE-407E-900B-8CAE51E19618}.Debug.Build.0 = Debug|Win32
{75779893-83CE-407E-900B-8CAE51E19618}.Release.ActiveCfg = Release|Win32
{75779893-83CE-407E-900B-8CAE51E19618}.Release.Build.0 = Release|Win32
{D549237B-D557-44C3-8CD9-808DEBFE66C4}.Debug.ActiveCfg = Debug|Win32
{D549237B-D557-44C3-8CD9-808DEBFE66C4}.Debug.Build.0 = Debug|Win32
{D549237B-D557-44C3-8CD9-808DEBFE66C4}.Release.ActiveCfg = Release|Win32
{D549237B-D557-44C3-8CD9-808DEBFE66C4}.Release.Build.0 = Release|Win32
{835B2FB6-F435-4206-B8A6-F86C750A9C3B}.Debug.ActiveCfg = Debug|Win32
{835B2FB6-F435-4206-B8A6-F86C750A9C3B}.Debug.Build.0 = Debug|Win32
{835B2FB6-F435-4206-B8A6-F86C750A9C3B}.Release.ActiveCfg = Release|Win32
{835B2FB6-F435-4206-B8A6-F86C750A9C3B}.Release.Build.0 = Release|Win32
{E22132CE-EEB0-4067-B011-838388DA1AD0}.Debug.ActiveCfg = Debug|Win32
{E22132CE-EEB0-4067-B011-838388DA1AD0}.Debug.Build.0 = Debug|Win32
{E22132CE-EEB0-4067-B011-838388DA1AD0}.Release.ActiveCfg = Release|Win32
{E22132CE-EEB0-4067-B011-838388DA1AD0}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection

View File

@ -28,12 +28,14 @@
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Bin/Cxbx.pch"
AssemblerOutput="2"
AssemblerListingLocation=".\Bin/"
ObjectFile=".\Bin/"
ProgramDataBaseFileName=".\Bin/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
@ -45,7 +47,10 @@
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="libc"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Bin/Cxbx.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Bin/Cxbx.map"
SubSystem="2"/>
<Tool
Name="VCMIDLTool"

View File

@ -90,11 +90,13 @@
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Bin/CxbxKrnl.pch"
AssemblerOutput="2"
AssemblerListingLocation=".\Bin/"
ObjectFile=".\Bin/"
ProgramDataBaseFileName=".\Bin/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
@ -107,7 +109,10 @@
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="Lib"
IgnoreDefaultLibraryNames="lbc"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Bin/Cxbx.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Bin/Cxbx.map"
ImportLibrary=".\Bin/Cxbx.lib"/>
<Tool
Name="VCMIDLTool"

View File

@ -66,7 +66,7 @@ typedef signed long sint32;
// ******************************************************************
// * Define this to trace intercepted function calls
// ******************************************************************
#define _DEBUG_TRACE
//#define _DEBUG_TRACE
// ******************************************************************
// * Round up dwValue to nearest multiple of dwMult

View File

@ -302,13 +302,20 @@ extern "C" CXBXKRNL_API void NTAPI EmuCleanup(const char *szErrorMessage)
// ******************************************************************
// * We're outta here...
// ******************************************************************
__try
{
ExitProcess(0);
}
__except(EXCEPTION_EXECUTE_HANDLER)
while(true)
{
// Hilariously, window's will just stop sending exceptions
// If we insist that we don't care about TLS failure.
__try
{
ExitProcess(0);
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
}
Sleep(10);
}
return;

View File

@ -7,7 +7,7 @@
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
// * Cxbx->Win32->CxbxKrnl->EmuD3D.cpp
// * Cxbx->Win32->CxbxKrnl->EmuD3D8.cpp
// *
// * This file is part of the Cxbx project.
// *
@ -70,9 +70,10 @@ Xbe::Header *g_XbeHeader = NULL; // XbeHeader
uint32 g_XbeHeaderSize = 0; // XbeHeaderSize
HWND g_hEmuWindow = NULL; // Rendering Window
xd3d8::D3DCAPS8 g_D3DCaps; // Direct3D8 Caps
volatile bool g_ThreadInitialized = false;
HBRUSH g_hBgBrush = NULL; // Background Brush
volatile bool g_ThreadInitialized = false;
// ******************************************************************
// * statics
// ******************************************************************
@ -344,7 +345,7 @@ HRESULT WINAPI xd3d8::EmuIDirect3D8_CreateDevice
pPresentationParameters->Windowed = TRUE;
// TODO: More intelligently set this only when the game wants it
//pPresentationParameters->SwapEffect = D3DSWAPEFFECT_COPY_VSYNC;
// pPresentationParameters->SwapEffect = D3DSWAPEFFECT_COPY_VSYNC;
hFocusWindow = g_hEmuWindow;
@ -366,6 +367,7 @@ HRESULT WINAPI xd3d8::EmuIDirect3D8_CreateDevice
// * TODO: Query for Software Vertex Processing abilities!!
// ******************************************************************
BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
// BehaviorFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING;
// ******************************************************************
// * redirect to windows d3d