diff --git a/neo/sys/win32/win_main.cpp b/neo/sys/win32/win_main.cpp index 2e1565f6..2d283d1d 100644 --- a/neo/sys/win32/win_main.cpp +++ b/neo/sys/win32/win_main.cpp @@ -1169,34 +1169,6 @@ void Win_Frame( void ) { } } -extern "C" { void _chkstk( int size ); }; -void clrstk( void ); - -/* -==================== -TestChkStk -==================== -*/ -void TestChkStk( void ) { - int buffer[0x1000]; - - buffer[0] = 1; -} - -/* -==================== -HackChkStk -==================== -*/ -void HackChkStk( void ) { - DWORD old; - VirtualProtect( _chkstk, 6, PAGE_EXECUTE_READWRITE, &old ); - *(byte *)_chkstk = 0xe9; - *(int *)((int)_chkstk+1) = (int)clrstk - (int)_chkstk - 5; - - TestChkStk(); -} - /* ==================== GetExceptionCodeInfo @@ -1507,42 +1479,6 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin return 0; } -/* -==================== -clrstk - -I tried to get the run time to call this at every function entry, but -==================== -*/ -static int parmBytes; -__declspec( naked ) void clrstk( void ) { - // eax = bytes to add to stack - __asm { - mov [parmBytes],eax - neg eax ; compute new stack pointer in eax - add eax,esp - add eax,4 - xchg eax,esp - mov eax,dword ptr [eax] ; copy the return address - push eax - - ; clear to zero - push edi - push ecx - mov edi,esp - add edi,12 - mov ecx,[parmBytes] - shr ecx,2 - xor eax,eax - cld - rep stosd - pop ecx - pop edi - - ret - } -} - /* ================== idSysLocal::OpenURL