* This function writes data to the stream * * - Returns true if the write operation succeeded and all bytes have been written * - Returns false if either write failed or not all bytes have been written * - If the pByteOffset is NULL, the function must write the data to the current file position * * \a pStream Pointer to an open stream * \a pByteOffset Pointer to file byte offset. If NULL, i
| 2634 | * \a dwBytesToWrite Number of bytes to write to the file |
| 2635 | */ |
| 2636 | bool FileStream_Write(TFileStream * pStream, ULONGLONG * pByteOffset, const void * pvBuffer, DWORD dwBytesToWrite) |
| 2637 | { |
| 2638 | if(pStream->dwFlags & STREAM_FLAG_READ_ONLY) |
| 2639 | { |
| 2640 | SetCascError(ERROR_ACCESS_DENIED); |
| 2641 | return false; |
| 2642 | } |
| 2643 | |
| 2644 | assert(pStream->StreamWrite != NULL); |
| 2645 | return pStream->StreamWrite(pStream, pByteOffset, pvBuffer, dwBytesToWrite); |
| 2646 | } |
| 2647 | |
| 2648 | /** |
| 2649 | * Returns the size of a file |