summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuQun Yang <ymuqun@hdfgroup.org>2001-01-04 23:50:41 (GMT)
committerMuQun Yang <ymuqun@hdfgroup.org>2001-01-04 23:50:41 (GMT)
commit2291dc4b3f21ea3e18c25e0d84d6d19828180f6f (patch)
treed1ee6de825e161a09484f5d8d004e3bb9cb8a5d9
parent4fea67be25bad24b20a622babac61dcb178f82aa (diff)
downloadhdf5-2291dc4b3f21ea3e18c25e0d84d6d19828180f6f.zip
hdf5-2291dc4b3f21ea3e18c25e0d84d6d19828180f6f.tar.gz
hdf5-2291dc4b3f21ea3e18c25e0d84d6d19828180f6f.tar.bz2
[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
-rw-r--r--src/H5FDstdio.c7
1 files 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 <windows.h>
+#include <io.h>
#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