CreateFile(Ex)
ReadFile(Ex)
WriteFile(Ex)
mais surout pour ton problème :
SetFilePointerEx
The SetFilePointerEx function moves the file pointer of an open file.
BOOL SetFilePointerEx(
HANDLE hFile, // handle to file
LARGE_INTEGER liDistanceToMove, // bytes to move pointer
PLARGE_INTEGER lpNewFilePointer, // new file pointer
DWORD dwMoveMethod // starting point
);
Parameters
hFile
[in] Handle to the file whose file pointer is to be moved. The file handle must have been created with GENERIC_READ or GENERIC_WRITE access to the file.
liDistanceToMove
[in] Specifies the number of bytes to move the file pointer. A positive value moves the pointer forward in the file and a negative value moves the file pointer backward.
lpNewFilePointer
[out] Pointer to a variable that receives the new file pointer. If this parameter is NULL, the new file pointer is not returned.
dwMoveMethod
[in] Specifies the starting point for the file pointer move. This parameter can be one of the following values. Value Meaning
FILE_BEGIN The starting point is zero or the beginning of the file. If this flag is specified, then the liDistanceToMove parameter is interpreted as an unsigned value.
FILE_CURRENT The start point is the current value of the file pointer.
FILE_END The starting point is the current end-of-file position.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
avec :
LARGE_INTEGER
The LARGE_INTEGER structure is used to represent a 64-bit signed integer value.
Note Your C compiler may support 64-bit integers natively. For example, Microsoft® Visual C++® supports the __int64 sized integer type. For more information, see the documentation included with your C compiler.
typedef union _LARGE_INTEGER {
struct {
DWORD LowPart;
LONG HighPart;
};
LONGLONG QuadPart;
} LARGE_INTEGER, *PLARGE_INTEGER;
Members
LowPart
Specifies the low-order 32 bits.
HighPart
Specifies the high-order 32 bits.
QuadPart
Specifies a 64-bit signed integer.
Partager