/* UNIXisms */ #include #include #include #include #include #include #include #include #include #include #include /* NTisms */ #include #include #include #include #include #include #include #include #include "mmsystem.h" #ifdef WIN32 /* ---------------------------------------------------------------- * Windows needs a standin open/read to accomplish direct I/O. * We should allow buffering and possible r/w access. */ HANDLE wopen( char *filename, int flags ) { HANDLE fd; fd = CreateFile(filename, flags, FILE_SHARE_READ, 0, OPEN_ALWAYS, FILE_FLAG_OVERLAPPED, 0 ); //FILE_FLAG_NO_BUFFERING | .. return fd; } int wread( loong_t bigoffset, void *buffer, int nbytes, int buf ) { int status, nread; Overlapped[buf].Offset = (unsigned long)(bigoffset & 0xFFFFFFFFi64); Overlapped[buf].OffsetHigh = (unsigned long)((bigoffset>>32) & 0xFFFFFFFFi64); status = ReadFile( Fd, buffer, nbytes, &nread, &Overlapped[buf] ); /* don't trap errors for now */ return 0; } #endif