Wing Commander
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
streamfile.cpp
Go to the documentation of this file.
1/**
2 * @file
3 * @ingroup ixlib
4 * @brief Stream-file methods.
5 *
6 * Address range 444700-44490f. The six methods follow ten INT3 bytes after
7 * the worker thread's helpers. The original file name is not in the
8 * diagnostic strings.
9 */
10#include "ix.h"
11
12/* Function start: 0x00444700 */
13unsigned int IxStreamFile::ix_stream_file_read(void *newDestination,
14 unsigned int bytes)
15{
17 EnterCriticalSection(&csStreamerFileList);
18 if (position + bytes > size)
19 bytes = size - position;
20 if (bytes > 0) {
21 destination = (unsigned char *)newDestination;
22 remaining = bytes;
24 if (previous != 0)
26 if (next == 0)
28 else
31 next = 0;
32 if (pStreamReadRequests != 0)
35 }
36 LeaveCriticalSection(&csStreamerFileList);
37 SetEvent(hStreamerWakeupEvent);
38 return bytes;
39}
40
41/* Function start: 0x00444809 */
42void IxStreamFile::ix_stream_file_seek(unsigned int newPosition)
43{
45 if (newPosition >= 0)
46 position = size < newPosition ? size : newPosition;
47 else
48 position = 0;
49}
50
51/* Function start: 0x0044485B */
53{
55 return position;
56}
57
58/* Function start: 0x0044487F */
60{
61 return size;
62}
63
64/* Function start: 0x0044489B */
66{
67 if ((flags & IX_STREAM_FILE_READING) != 0) {
68 WaitForSingleObject(completionEvent, INFINITE);
69 ResetEvent(completionEvent);
70 }
71}
72
73/* Function start: 0x004448D9 */
The library's classes and shared declarations.
@ IX_STREAM_FILE_READING
Definition ix.h:341
IxStreamFile * pStreamIdleFiles
Definition streamer.cpp:22
CRITICAL_SECTION csStreamerFileList
Definition streamer.cpp:35
IxStreamFile * pStreamReadRequests
Definition streamer.cpp:25
HANDLE hStreamerWakeupEvent
Definition streamer.cpp:40
unsigned int ix_stream_file_tell(void)
void ix_stream_file_wait(void)
unsigned int ix_stream_file_read(void *destination, unsigned int bytes)
int ix_stream_file_is_reading(void)
unsigned int remaining
Definition ix.h:434
unsigned char * destination
Definition ix.h:435
unsigned int size
Definition ix.h:430
IxStreamFile * previous
Definition ix.h:437
unsigned int position
Definition ix.h:433
unsigned int ix_stream_file_size(void)
IxStreamFile * next
Definition ix.h:438
void ix_stream_file_seek(unsigned int position)
unsigned int flags
Definition ix.h:427
HANDLE completionEvent
Definition ix.h:436