Forum > Windows
SetFilePointerEx function missing
440bx:
Hello,
In FPC v3.2.2, the definition of SetFilePointerEx is missing in Windows.pas.
Possible definitions:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---const kernel32 = 'kernel32'; function SetFilePointerEx ( InFile : THANDLE; InDistanceToMove : TLARGE_INTEGER; OutoptNewFilePointer : PLARGE_INTEGER; InMoveMethod : DWORD ) : BOOL; stdcall; external kernel32; function SetFilePointerEx ( InFile : THANDLE; InDistanceToMove : int64; { instead of LARGE_INTEGER } OutoptNewFilePointer : pint64; { PLARGE_INTEGER } InMoveMethod : DWORD ) : BOOL; stdcall; external kernel32; overload; The first definition mirrors the MSDN definition exactly (except parameter names and "T" prefixed type names.) The second one would be a "nice to have" overload.
Thaddy:
@440bx
pointers can not be negative so please, please declare them as unsigned. >:D >:D :D
We are not living in D2 days... :o
440bx:
--- Quote from: Thaddy on November 07, 2024, 10:53:39 am ---@440bx
pointers can not be negative so please, please declare them as unsigned. >:D >:D :D
We are not living in D2 days... :o
--- End quote ---
Wake up!!!
There are no negative pointers anywhere in the definitions I gave. There are pointers to 64 bit integers, which can definitely be negative. (LARGE_INTEGER is defined as a signed value)
As far as the D2 days, the definition that uses LARGE_INTEGER has nothing to do with the D2 days, it has everything to do with the fact that's the way it is defined by MS. Check it out https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-large_integer-r1
BTW, that's the reason I suggested the overload with "pint64" (no... that's _not_ a signed pointer... <chuckle>)
Tell MS to stop using D2 ... it's a suggestion I have no doubt they will follow... you can claim credit to have guided them in the right direction. :)
That was entertaining... thank you for the chuckle.
Fibonacci:
@Thaddy: Is it not enough coffee or too much coffee?
marcov:
Fixed
Navigation
[0] Message Index
[#] Next page