Hello,
I compile our program under D2007 and XE2 with PEFlag $20. This means that it could use 3 GB RAM under 32 Bit.
I further use your component with 64 Bit XE 2.
Today I debugged a problem in our code which causes memory corruption. I found that I do a Integer(Pointer(somepointer))-Integer(Pointer(somepointer1))
Integer is signed and the Pointer is unsigned. If the memory to which the pointer points is above 2 GB the cast to integer goes below 0 and the arithmetik is wrong.
Same problem is in 64 Bit where integer is always 4 bytes. Casting a pointer to integer drop 4 bytes.
In D2007 a NativeUIt = Cardinal and in XE 2/3 a NativeUInt should be used.
I looked into ImageEN source and find several places where a pointer is converted to a integer like
procedure TImageEnVideoCap.SetCapture(v: boolean); SendMessage(fWndC, WM_CAP_SET_USER_DATA, 0, integer(pointer(self)));
procedure TImageEnVideoCap.SetCallBackFrame(v: boolean); SendMessage(fWndC, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, integer(@CallBackFrameFunc)); SendMessage(fWndC, WM_CAP_SET_CALLBACK_ERROR, 0, integer(@capErrorCallback)); SendMessage(fWndC, WM_CAP_SET_CALLBACK_YIELD, 0, integer(@CallBackYeldFunc)); SendMessage(fWndC, WM_CAP_SET_CALLBACK_STATUS, 0, integer(@CallBackStatusFunc));
Is the component at the current state 100% tested with programs which could allocate more then 2 GB RAM (32 Bit with PEFlag, 64 Bit)?
I don't look in every unit of ImageEn.
Could you please give me a feedback if I could use ImageEn securly with mit than 2 GB RAM?
Greetings
Stefan Westner |