From 2291dc4b3f21ea3e18c25e0d84d6d19828180f6f Mon Sep 17 00:00:00 2001 From: MuQun Yang Date: Thu, 4 Jan 2001 18:50:41 -0500 Subject: [svn-r3241] Purpose: several warning and bug fix for windows Description: different system calls on windows Solution: for win32, use only those system calls Platforms tested: windows 2000 --- src/H5FDstdio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 92952cd..0319561 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -20,6 +20,7 @@ #endif #ifdef WIN32 #include +#include #endif #ifdef MAX @@ -267,6 +268,7 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, #ifdef WIN32 HFILE filehandle; struct _BY_HANDLE_FILE_INFORMATION fileinfo; + int fd; int results; #else /* WIN32 */ struct stat sb; @@ -325,8 +327,9 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, /* The unique key */ #ifdef WIN32 /*#error "Needs correct fileindexhi & fileindexlo, code below is from sec2 driver"*/ - filehandle = _get_osfhandle(f); - results = GetFileInformationByHandle(filehandle, &fileinfo); + fd = _fileno(f); + filehandle = _get_osfhandle(fd); + results = GetFileInformationByHandle((HANDLE)filehandle, &fileinfo); file->fileindexhi = fileinfo.nFileIndexHigh; file->fileindexlo = fileinfo.nFileIndexLow; #else -- cgit v0.12