/* iowin32.c -- IO base function header for compress/uncompress .zip
Version 1.1, February 14h, 2010
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
*/
#include <stdlib.h>
#ifdef _WIN32
#include "zlib.h"
#include "ioapi.h"
#include "iowin32.h"
#ifndef INVALID_HANDLE_VALUE
#endif
#ifndef INVALID_SET_FILE_POINTER
#endif
#if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API)))
#endif
#endif
uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
long ZCALLBACK win32_seek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
typedef struct
{
int error;
{
{
}
else if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
{
}
else if (mode & ZLIB_FILEFUNC_MODE_CREATE)
{
}
}
{
{
else
}
return ret;
}
{
win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
#ifdef IOWIN32_USING_WINRT_API
#ifdef UNICODE
#else
{
}
#endif
#else
hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
#endif
return win32_build_iowin(hFile);
}
{
win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
#ifdef IOWIN32_USING_WINRT_API
{
}
#else
hFile = CreateFileA((LPCSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
#endif
return win32_build_iowin(hFile);
}
{
win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
#ifdef IOWIN32_USING_WINRT_API
#else
hFile = CreateFileW((LPCWSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
#endif
return win32_build_iowin(hFile);
}
{
win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
#ifdef IOWIN32_USING_WINRT_API
#ifdef UNICODE
#else
{
}
#endif
#else
hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
#endif
return win32_build_iowin(hFile);
}
{
{
{
if (dwErr == ERROR_HANDLE_EOF)
dwErr = 0;
}
}
return ret;
}
{
{
{
if (dwErr == ERROR_HANDLE_EOF)
dwErr = 0;
}
}
return ret;
}
static BOOL MySetFilePointerEx(HANDLE hFile, LARGE_INTEGER pos, LARGE_INTEGER *newPos, DWORD dwMoveMethod)
{
#ifdef IOWIN32_USING_WINRT_API
#else
if (dwNewPos == 0xFFFFFFFF)
if (GetLastError() != NO_ERROR)
{
}
return fOk;
#endif
}
{
{
{
ret = -1;
}
else
}
return ret;
}
{
if (hFile)
{
{
}
else
}
return ret;
}
{
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
break;
case ZLIB_FILEFUNC_SEEK_END :
break;
case ZLIB_FILEFUNC_SEEK_SET :
break;
default: return -1;
}
{
{
ret = -1;
}
else
ret=0;
}
return ret;
}
{
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
break;
case ZLIB_FILEFUNC_SEEK_END :
break;
case ZLIB_FILEFUNC_SEEK_SET :
break;
default: return -1;
}
if (hFile)
{
{
ret = -1;
}
else
ret=0;
}
return ret;
}
{
{
{
ret=0;
}
}
return ret;
}
{
{
}
return ret;
}
{
}
{
}
{
}
{
}
#endif