"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zlib/zlib/contrib/minizip/iowin32.c" between
muscle7.61.zip and muscle7.62.zip

About: MUSCLE (Multi User Server Client Linking Environment) is a messaging server and networking API. The included server program ("muscled") lets its clients message each other, and/or store information in its serverside hierarchical database.

iowin32.c  (muscle7.61):iowin32.c  (muscle7.62)
skipping to change at line 28 skipping to change at line 28
#include "iowin32.h" #include "iowin32.h"
#ifndef INVALID_HANDLE_VALUE #ifndef INVALID_HANDLE_VALUE
#define INVALID_HANDLE_VALUE (0xFFFFFFFF) #define INVALID_HANDLE_VALUE (0xFFFFFFFF)
#endif #endif
#ifndef INVALID_SET_FILE_POINTER #ifndef INVALID_SET_FILE_POINTER
#define INVALID_SET_FILE_POINTER ((DWORD)-1) #define INVALID_SET_FILE_POINTER ((DWORD)-1)
#endif #endif
// see Include/shared/winapifamily.h in the Windows Kit
#if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API))) #if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API)))
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) #if WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP)
#define IOWIN32_USING_WINRT_API 1 #define IOWIN32_USING_WINRT_API 1
#endif #endif
#endif #endif
voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode)); voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode));
uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
ZPOS64_T ZCALLBACK win32_tell64_file_func OF((voidpf opaque, voidpf stream)); ZPOS64_T ZCALLBACK win32_tell64_file_func OF((voidpf opaque, voidpf stream));
long ZCALLBACK win32_seek64_file_func OF((voidpf opaque, voidpf stream, ZPOS 64_T offset, int origin)); long ZCALLBACK win32_seek64_file_func OF((voidpf opaque, voidpf stream, ZPOS 64_T offset, int origin));
int ZCALLBACK win32_close_file_func OF((voidpf opaque, voidpf stream)); int ZCALLBACK win32_close_file_func OF((voidpf opaque, voidpf stream));
skipping to change at line 239 skipping to change at line 240
return ret; return ret;
} }
static BOOL MySetFilePointerEx(HANDLE hFile, LARGE_INTEGER pos, LARGE_INTEGER *n ewPos, DWORD dwMoveMethod) static BOOL MySetFilePointerEx(HANDLE hFile, LARGE_INTEGER pos, LARGE_INTEGER *n ewPos, DWORD dwMoveMethod)
{ {
#ifdef IOWIN32_USING_WINRT_API #ifdef IOWIN32_USING_WINRT_API
return SetFilePointerEx(hFile, pos, newPos, dwMoveMethod); return SetFilePointerEx(hFile, pos, newPos, dwMoveMethod);
#else #else
LONG lHigh = pos.HighPart; LONG lHigh = pos.HighPart;
DWORD dwNewPos = SetFilePointer(hFile, pos.LowPart, &lHigh, FILE_CURRENT); DWORD dwNewPos = SetFilePointer(hFile, pos.LowPart, &lHigh, dwMoveMethod);
BOOL fOk = TRUE; BOOL fOk = TRUE;
if (dwNewPos == 0xFFFFFFFF) if (dwNewPos == 0xFFFFFFFF)
if (GetLastError() != NO_ERROR) if (GetLastError() != NO_ERROR)
fOk = FALSE; fOk = FALSE;
if ((newPos != NULL) && (fOk)) if ((newPos != NULL) && (fOk))
{ {
newPos->LowPart = dwNewPos; newPos->LowPart = dwNewPos;
newPos->HighPart = lHigh; newPos->HighPart = lHigh;
} }
return fOk; return fOk;
skipping to change at line 365 skipping to change at line 366
case ZLIB_FILEFUNC_SEEK_SET : case ZLIB_FILEFUNC_SEEK_SET :
dwMoveMethod = FILE_BEGIN; dwMoveMethod = FILE_BEGIN;
break; break;
default: return -1; default: return -1;
} }
if (hFile) if (hFile)
{ {
LARGE_INTEGER pos; LARGE_INTEGER pos;
pos.QuadPart = offset; pos.QuadPart = offset;
if (!MySetFilePointerEx(hFile, pos, NULL, FILE_CURRENT)) if (!MySetFilePointerEx(hFile, pos, NULL, dwMoveMethod))
{ {
DWORD dwErr = GetLastError(); DWORD dwErr = GetLastError();
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
ret = -1; ret = -1;
} }
else else
ret=0; ret=0;
} }
return ret; return ret;
} }
 End of changes. 4 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)