114 method = FILE_CURRENT;
121 li.QuadPart = (LONGLONG)
offset;
122 if (!SetFilePointerEx((
HANDLE)
f, li,
NULL, method)) {
140 LARGE_INTEGER new_offset;
143 if (!SetFilePointerEx((
HANDLE)
f, zero, &new_offset, FILE_CURRENT)) {
156 case ERROR_INVALID_PARAMETER:
158 case ERROR_FILE_NOT_FOUND:
159 case ERROR_PATH_NOT_FOUND:
161 case ERROR_INVALID_HANDLE:
163 case ERROR_ACCESS_DENIED:
165 case ERROR_FILE_EXISTS:
167 case ERROR_TOO_MANY_OPEN_FILES:
169 case ERROR_DISK_FULL:
172 return 10000 + win32err;
183 if (!GetFileTime(
h,
NULL,
NULL, &mtimeft)) {
195 if (GetFileType(
h) == FILE_TYPE_DISK) {
198 if (!GetFileSizeEx(
h, &
size)) {
218 const zip_int64_t SEC_TO_UNIX_EPOCH = 11644473600LL;
223 li.LowPart = ft.dwLowDateTime;
224 li.HighPart = ft.dwHighDateTime;
225 secs = (li.QuadPart / WINDOWS_TICK - SEC_TO_UNIX_EPOCH);
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
#define INVALID_HANDLE_VALUE
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
void error(const char *msg)
zip_source_t * zip_source_file_common_new(const char *fname, void *file, zip_uint64_t start, zip_int64_t len, const zip_stat_t *st, zip_source_file_operations_t *ops, void *ops_userdata, zip_error_t *error)
int _zip_win32_error_to_errno(DWORD win32err)
void _zip_win32_op_close(zip_source_file_context_t *ctx)
static zip_source_file_operations_t ops_win32_read
bool _zip_filetime_to_time_t(FILETIME ft, time_t *t)
zip_int64_t _zip_win32_op_tell(zip_source_file_context_t *ctx, void *f)
ZIP_EXTERN zip_source_t * zip_source_win32handle(zip_t *za, HANDLE h, zip_uint64_t start, zip_int64_t len)
static bool _zip_win32_op_stat(zip_source_file_context_t *ctx, zip_source_file_stat_t *st)
zip_int64_t _zip_win32_op_read(zip_source_file_context_t *ctx, void *buf, zip_uint64_t len)
ZIP_EXTERN zip_source_t * zip_source_win32handle_create(HANDLE h, zip_uint64_t start, zip_int64_t length, zip_error_t *error)
static bool _zip_stat_win32(zip_source_file_context_t *ctx, zip_source_file_stat_t *st, HANDLE h)
bool _zip_win32_op_seek(zip_source_file_context_t *ctx, void *f, zip_int64_t offset, int whence)