Open zertovitch opened 8 months ago
Some attempts to solve the issue:
Data : Global_Alloc_Ptr; pragma Suppress (Access_Check, Data);
is ineffective.type Global_Alloc_Ptr is access all Global_Alloc_Type; pragma Suppress (Access_Check, Global_Alloc_Ptr);
does suppress the check, but cause a worse issue: PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION
subtype Global_Alloc_Ptr is System.Address;
procedure Poke
(Data : Global_Alloc_Ptr; Offset : Natural; Byte : Memory_Byte)
is
Dest : Memory_Byte_Arr (0 .. Offset)
with Address => Data;
pragma Import (Ada, Dest);
begin
Dest (Offset) := Byte;
end Poke;
function Peek
(Data : Global_Alloc_Ptr; Offset : Natural) return Memory_Byte
is
Source : Memory_Byte_Arr (0 .. Offset)
with Address => Data;
pragma Import (Ada, Source);
begin
return Source (Offset);
end Peek;
Built with GNAT version after GNAT CE 2021:
.\gwindows\test\test_clipboard.exe
raised CONSTRAINT_ERROR : gwindows-clipboard.adb:386 access check failed [C:\Ada\gnavi\gwindows\test\test_clipboard.exe] 0x7ff7679437ac Adainit at gwindows-clipboard.adb:386 0x7ff767921ba9 Test_Clipboard at test_clipboard.adb:34