mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-01-31 02:30:33 +00:00
- It turns out that the Visual C++ 2005 runtime calls IsDebuggerPresent, which
is not available under Windows 95. Since this is (or at least should be) the only thing preventing us from running under Windows 95, I added a stub that replaces __imp__IsDebuggerPresent@0 with a pointer to a function that checks for the real thing. SVN r279 (trunk)
This commit is contained in:
parent
effa46975e
commit
3a552d4aa0
6 changed files with 89 additions and 9 deletions
|
@ -61,7 +61,8 @@ endif
|
||||||
SRCS = $(CSRCS) $(CPPSRCS) $(ASRCS)
|
SRCS = $(CSRCS) $(CPPSRCS) $(ASRCS)
|
||||||
CPPOBJFILES = $(notdir $(CPPSRCS:%.cpp=%.o))
|
CPPOBJFILES = $(notdir $(CPPSRCS:%.cpp=%.o))
|
||||||
COBJFILES = $(notdir $(CSRCS:%.c=%.o))
|
COBJFILES = $(notdir $(CSRCS:%.c=%.o))
|
||||||
AOBJFILES = $(notdir $(ASRCS:%.nas=%.o))
|
# win32/wrappers.nas should be built *only* for Visual C++ 2005 to enable execution on Windows 95
|
||||||
|
AOBJFILES = $(filter-out %/wrappers.o,$(notdir $(ASRCS:%.nas=%.o)))
|
||||||
RCOBJFILES = $(notdir $(RCSRCS:%.rc=%.o))
|
RCOBJFILES = $(notdir $(RCSRCS:%.rc=%.o))
|
||||||
|
|
||||||
COBJS = $(addprefix $(OBJDIR)/,$(CPPOBJFILES) $(COBJFILES) $(RCOBJFILES))
|
COBJS = $(addprefix $(OBJDIR)/,$(CPPOBJFILES) $(COBJFILES) $(RCOBJFILES))
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
August 1, 2006
|
||||||
|
- It turns out that the Visual C++ 2005 runtime calls IsDebuggerPresent, which
|
||||||
|
is not available under Windows 95. Since this is (or at least should be) the
|
||||||
|
only thing preventing us from running under Windows 95, I added a stub that
|
||||||
|
replaces __imp__IsDebuggerPresent@0 with a pointer to a function that checks
|
||||||
|
for the real thing.
|
||||||
|
|
||||||
August 1, 2006 (Changes by Graf Zahl)
|
August 1, 2006 (Changes by Graf Zahl)
|
||||||
- Fixed: The pickup message for Hexen's fighter's axe was assigned to the
|
- Fixed: The pickup message for Hexen's fighter's axe was assigned to the
|
||||||
AxePuff, not the weapon itself.
|
AxePuff, not the weapon itself.
|
||||||
|
|
|
@ -2491,8 +2491,6 @@ static void ActorActiveSound (AActor *defaults, Baggage &bag)
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
static void ActorDropItem (AActor *defaults, Baggage &bag)
|
static void ActorDropItem (AActor *defaults, Baggage &bag)
|
||||||
{
|
{
|
||||||
bool res;
|
|
||||||
|
|
||||||
// create a linked list of dropitems
|
// create a linked list of dropitems
|
||||||
if (!bag.DropItemSet)
|
if (!bag.DropItemSet)
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,8 +91,6 @@ DWORD MainThreadID;
|
||||||
|
|
||||||
HMODULE hwtsapi32; // handle to wtsapi32.dll
|
HMODULE hwtsapi32; // handle to wtsapi32.dll
|
||||||
|
|
||||||
BOOL (*pIsDebuggerPresent)(VOID);
|
|
||||||
|
|
||||||
extern UINT TimerPeriod;
|
extern UINT TimerPeriod;
|
||||||
extern HCURSOR TheArrowCursor, TheInvisibleCursor;
|
extern HCURSOR TheArrowCursor, TheInvisibleCursor;
|
||||||
|
|
||||||
|
@ -218,10 +216,6 @@ void DoMain (HINSTANCE hInstance)
|
||||||
// Since we need to remain binary compatible with older versions of Windows, we
|
// Since we need to remain binary compatible with older versions of Windows, we
|
||||||
// need to extract the ProcessIdToSessionId function from kernel32.dll manually.
|
// need to extract the ProcessIdToSessionId function from kernel32.dll manually.
|
||||||
HMODULE kernel = GetModuleHandle ("kernel32.dll");
|
HMODULE kernel = GetModuleHandle ("kernel32.dll");
|
||||||
if (kernel != 0)
|
|
||||||
{
|
|
||||||
pIsDebuggerPresent = (BOOL(*)())GetProcAddress (kernel, "IsDebuggerPresent");
|
|
||||||
}
|
|
||||||
|
|
||||||
// NASM does not support creating writeable code sections (even though this
|
// NASM does not support creating writeable code sections (even though this
|
||||||
// is a perfectly valid configuration for Microsoft's COFF format), so I
|
// is a perfectly valid configuration for Microsoft's COFF format), so I
|
||||||
|
|
39
src/win32/wrappers.nas
Normal file
39
src/win32/wrappers.nas
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
; The Visual C++ CRT unconditionally links to IsDebuggerPresent.
|
||||||
|
; This function is not available under Windows 95, so here is a
|
||||||
|
; lowlevel replacement for it.
|
||||||
|
|
||||||
|
extern __imp__GetModuleHandleA@4
|
||||||
|
extern __imp__GetProcAddress@8
|
||||||
|
|
||||||
|
SECTION .data
|
||||||
|
|
||||||
|
global __imp__IsDebuggerPresent@0
|
||||||
|
__imp__IsDebuggerPresent@0:
|
||||||
|
dd IsDebuggerPresent_Check
|
||||||
|
|
||||||
|
SECTION .rdata
|
||||||
|
|
||||||
|
StrKERNEL32:
|
||||||
|
db "KERNEL32",0
|
||||||
|
|
||||||
|
StrIsDebuggerPresent:
|
||||||
|
db "IsDebuggerPresent",0
|
||||||
|
|
||||||
|
SECTION .text
|
||||||
|
|
||||||
|
IsDebuggerPresent_No:
|
||||||
|
xor eax,eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
IsDebuggerPresent_Check:
|
||||||
|
push StrKERNEL32
|
||||||
|
call [__imp__GetModuleHandleA@4]
|
||||||
|
push StrIsDebuggerPresent
|
||||||
|
push eax
|
||||||
|
call [__imp__GetProcAddress@8]
|
||||||
|
test eax,eax
|
||||||
|
jne near .itis
|
||||||
|
mov eax,IsDebuggerPresent_No
|
||||||
|
.itis
|
||||||
|
mov [__imp__IsDebuggerPresent@0],eax
|
||||||
|
jmp eax
|
41
zdoom.vcproj
41
zdoom.vcproj
|
@ -106,6 +106,7 @@
|
||||||
TerminalServerAware="2"
|
TerminalServerAware="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
EnableCOMDATFolding="2"
|
EnableCOMDATFolding="2"
|
||||||
|
SetChecksum="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCALinkTool"
|
Name="VCALinkTool"
|
||||||
|
@ -5371,6 +5372,46 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\win32\wrappers.nas"
|
||||||
|
>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
Description="Assembling $(InputPath)..."
|
||||||
|
CommandLine="nasmw -o "$(IntDir)\$(InputName).obj" -d OBJ_FORMAT_win32 -f win32 "$(InputPath)""
|
||||||
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|x64"
|
||||||
|
ExcludedFromBuild="true"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
Description="Assembling $(InputPath)..."
|
||||||
|
CommandLine="nasmw -o "$(IntDir)\$(InputName).obj" -d OBJ_FORMAT_win32 -f win32 "$(InputPath)""
|
||||||
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|x64"
|
||||||
|
ExcludedFromBuild="true"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Shared Game"
|
Name="Shared Game"
|
||||||
|
|
Loading…
Reference in a new issue