RE: Addendum: [BLACKBOX] A question about huge files

From: null <">
Date: Wed, 12 Jun 2013 13:04:02 +0000

----boundary-LibPST-iamunique-1999845055_-_-
Content-type: text/plain

Richard,

> A quick glance at WinAPI interface does not show a SetFilePointerEx function. 

yes, I know.

> Would it be sufficient to copy SetFilePointer and rename it to SetFilePointerEx?

no, it has a different (LARGE_INTEGER instead of LONG) parameters (in & out).
 
signatures according to MSDN are:

DWORD WINAPI SetFilePointer(
_In_ HANDLE hFile,
_In_ LONG lDistanceToMove,
_Inout_opt_ PLONG lpDistanceToMoveHigh,
_In_ DWORD dwMoveMethod
);

and

BOOL WINAPI SetFilePointerEx(
_In_ HANDLE hFile,
_In_ LARGE_INTEGER liDistanceToMove,
_Out_opt_ PLARGE_INTEGER lpNewFilePointer,
_In_ DWORD dwMoveMethod
);

So I guess it should be:

PROCEDURE SetFilePointer* (hFile: HANDLE; lDistanceToMove: INTEGER;
                           VAR [nil] lpDistanceToMoveHigh: INTEGER;
                           dwMoveMethod: INTEGER): INTEGER;

and

PROCEDURE SetFilePointerEx* (hFile: HANDLE; lDistanceToMove: LONGINT;
                           VAR [nil] lpDistanceToMoveHigh: LONGINT;
                           dwMoveMethod: INTEGER): INTEGER;

beware, there might be more procedure, which might need adjustment.

--
  Bernhard
----boundary-LibPST-iamunique-1999845055_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGZiaWRpcyBcZGVmZjB7XGZvbnR0YmwN
CntcZjBcZnN3aXNzXGZjaGFyc2V0MCBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7
fQ0Ke1xmMlxmbmlsXGZjaGFyc2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBD
b3VyaWVyIE5ldzt9fQ0Ke1xjb2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkM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EVHRVIgbHBOZXdGaWxl
UG9pbnRlcixccGFyDQogIF9Jbl8gICAgICAgRFdPUkQgZHdNb3ZlTWV0aG9kXHBhcg0KKTtccGFy
DQpccGFyDQpTbyBJIGd1ZXNzIGl0IHNob3VsZCBiZTpccGFyDQpccGFyDQpQUk9DRURVUkUgU2V0
RmlsZVBvaW50ZXIqIChoRmlsZTogSEFORExFOyBsRGlzdGFuY2VUb01vdmU6IElOVEVHRVI7IFxw
YXINCiAgICAgICAgICAgICAgICAgICAgICAgICAgIFZBUiBbbmlsXSBscERpc3RhbmNlVG9Nb3Zl
SGlnaDogSU5URUdFUjsgXHBhcg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgZHdNb3ZlTWV0
aG9kOiBJTlRFR0VSKTogSU5URUdFUjtccGFyDQpccGFyDQphbmRccGFyDQpccGFyDQpQUk9DRURV
UkUgU2V0RmlsZVBvaW50ZXJFeCogKGhGaWxlOiBIQU5ETEU7IGxEaXN0YW5jZVRvTW92ZTogTE9O
R0lOVDsgXHBhcg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSIFtuaWxdIGxwRGlzdGFu
Y2VUb01vdmVIaWdoOiBMT05HSU5UOyBccGFyDQogICAgICAgICAgICAgICAgICAgICAgICAgICBk
d01vdmVNZXRob2Q6IElOVEVHRVIpOiBJTlRFR0VSO1xwYXINClxwYXINCmJld2FyZSwgdGhlcmUg
bWlnaHQgYmUgbW9yZSBwcm9jZWR1cmUsIHdoaWNoIG1pZ2h0IG5lZWQgYWRqdXN0bWVudC5ccGFy
DQpccGFyDQotLVxwYXINCiAgQmVybmhhcmR9fQA/DQoN
----boundary-LibPST-iamunique-1999845055_-_---
Received on Wed Jun 12 2013 - 15:04:02 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:29:53 UTC