Postby Jess'ca » 18 Dec 2005 20:25
Dear Quovodis,
thanks for your comment. I now found out how to bypass this problem:
Im im using Delphi 7. The problem does NOT seem to be related to VLC in particular.
Microsoft indeed seems to have forgotten a few DbgBreakPoint in ntdll. For other stuggling developers, here is the workaround:
procedure PatchINT3;
var
NOP : Byte;
NTDLL: THandle;
BytesWritten: DWORD;
Address: Pointer;
begin
if Win32Platform <> VER_PLATFORM_WIN32_NT then Exit;
NTDLL := GetModuleHandle('NTDLL.DLL');
if NTDLL = 0 then Exit;
Address := GetProcAddress(NTDLL, 'DbgBreakPoint');
if Address = nil then Exit;
try
if Char(Address^) <> #$CC then Exit;
NOP := $90;
if WriteProcessMemory(GetCurrentProcess, Address, @NOP, 1, BytesWritten) and
(BytesWritten = 1) then
FlushInstructionCache(GetCurrentProcess, Address, 1);
except
//Do not panic if you see an EAccessViolation here, it is perfectly harmless!
on EAccessViolation do ;
else raise;
end;
end;
initialization
if DebugHook<>0 then
PatchINT3;
end.
Cheers,
jessica