Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
en:docs:fapi:doschgfileptr [2018/08/26 13:41] – prokushev | en:docs:fapi:doschgfileptr [2018/09/02 14:51] – prokushev | ||
---|---|---|---|
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
- | | + | |
+ | | ||
==Parameters== | ==Parameters== | ||
- | ;FileHandle (HFILE) - input : Handle returned by a previous DosOpen call. | + | |
- | ; Distance (LONG) - input : The offset to move, in bytes. | + | * FileHandle (HFILE) - input : Handle returned by a previous DosOpen call. |
- | ; MoveType (USHORT) - input : Method of moving. Specifies a location in the file from where Distance to move the read/write pointer starts. Values and their meanings are: | + | |
- | ''' | + | |
- | | + | |
- | | + | |
- | | + | | 0 | Beginning of the file. | |
- | ; NewPointer (PULONG) - output : Address of the new pointer location. | + | | 1 | Current location of the read/write pointer. |
+ | | 2 | End of the file. Use this method to determine a file's size. | | ||
+ | |||
+ | | ||
==Return Code== | ==Return Code== | ||
- | rc (USHORT) - return | + | |
+ | rc (USHORT) - return | ||
+ | | ||
Return code descriptions are: | Return code descriptions are: | ||
- | * 0 NO_ERROR | + | |
- | * 1 ERROR_INVALID_FUNCTION | + | |
- | * 6 ERROR_INVALID_HANDLE | + | * 1 ERROR_INVALID_FUNCTION |
+ | * 6 ERROR_INVALID_HANDLE | ||
==Remarks== | ==Remarks== | ||
Line 31: | Line 38: | ||
==Example Code== | ==Example Code== | ||
===C Binding=== | ===C Binding=== | ||
- | <PRE> | ||
- | #define INCL_DOSFILEMGR | ||
- | USHORT | + | #define INCL_DOSFILEMGR |
+ | |||
+ | | ||
+ | |||
+ | HFILE FileHandle; | ||
+ | LONG | ||
+ | USHORT | ||
+ | PULONG | ||
+ | |||
+ | USHORT | ||
- | HFILE FileHandle; | ||
- | LONG | ||
- | USHORT | ||
- | PULONG | ||
- | |||
- | USHORT | ||
- | </ | ||
This example opens file test.dat, writes some data, and resets the file pointer to the beginning of the file. | This example opens file test.dat, writes some data, and resets the file pointer to the beginning of the file. | ||
- | <PRE> | ||
- | #define INCL_DOSFILEMGR | ||
- | |||
- | #define OPEN_FILE 0x01 | ||
- | #define CREATE_FILE 0x10 | ||
- | #define FILE_ARCHIVE 0x20 | ||
- | #define FILE_EXISTS OPEN_FILE | ||
- | #define FILE_NOEXISTS CREATE_FILE | ||
- | #define DASD_FLAG 0 | ||
- | #define INHERIT 0x80 | ||
- | #define WRITE_THRU 0 | ||
- | #define FAIL_FLAG 0 | ||
- | #define SHARE_FLAG 0x10 | ||
- | #define ACCESS_FLAG 0x02 | ||
- | |||
- | #define FILE_NAME " | ||
- | #define FILE_SIZE 800L | ||
- | #define FILE_ATTRIBUTE FILE_ARCHIVE | ||
- | #define RESERVED 0L | ||
- | |||
- | HFILE | ||
- | USHORT | ||
- | USHORT | ||
- | PUSHORT Local | ||
- | PSZ | ||
- | USHORT | ||
+ | #define INCL_DOSFILEMGR | ||
+ | | ||
+ | #define OPEN_FILE 0x01 | ||
+ | #define CREATE_FILE 0x10 | ||
+ | #define FILE_ARCHIVE 0x20 | ||
+ | #define FILE_EXISTS OPEN_FILE | ||
+ | #define FILE_NOEXISTS CREATE_FILE | ||
+ | #define DASD_FLAG 0 | ||
+ | #define INHERIT 0x80 | ||
+ | #define WRITE_THRU 0 | ||
+ | #define FAIL_FLAG 0 | ||
+ | #define SHARE_FLAG 0x10 | ||
+ | #define ACCESS_FLAG 0x02 | ||
+ | | ||
+ | #define FILE_NAME " | ||
+ | #define FILE_SIZE 800L | ||
+ | #define FILE_ATTRIBUTE FILE_ARCHIVE | ||
+ | #define RESERVED 0L | ||
+ | | ||
+ | HFILE | ||
+ | USHORT | ||
+ | USHORT | ||
+ | PUSHORT Local | ||
+ | PSZ | ||
+ | USHORT | ||
+ | | ||
| | ||
| | ||
Line 91: | Line 98: | ||
FILE_BEG, | FILE_BEG, | ||
& | & | ||
- | </ | + | |
===MASM Binding=== | ===MASM Binding=== | ||
- | <PRE> | ||
- | EXTRN DosChgFilePtr: | ||
- | INCL_DOSFILEMGR | ||
- | PUSH | + | EXTRN DosChgFilePtr: |
- | PUSH | + | INCL_DOSFILEMGR |
- | PUSH | + | |
- | PUSH@ DWORD | + | |
- | CALL | + | PUSH |
+ | PUSH | ||
+ | PUSH@ DWORD | ||
+ | CALL | ||
Returns WORD | Returns WORD | ||
- | </ | + | |
== Note === | == Note === |