Rizin
unix-like reverse engineering framework and cli tools
zip_source_file_win32.h
Go to the documentation of this file.
1 #ifndef _HAD_ZIP_SOURCE_FILE_WIN32_H
2 #define _HAD_ZIP_SOURCE_FILE_WIN32_H
3 
4 /*
5  zip_source_file_win32.h -- common header for Windows file implementation
6  Copyright (C) 2020 Dieter Baron and Thomas Klausner
7 
8  This file is part of libzip, a library to manipulate ZIP archives.
9  The authors can be contacted at <info@libzip.org>
10 
11  Redistribution and use in source and binary forms, with or without
12  modification, are permitted provided that the following conditions
13  are met:
14  1. Redistributions of source code must retain the above copyright
15  notice, this list of conditions and the following disclaimer.
16  2. Redistributions in binary form must reproduce the above copyright
17  notice, this list of conditions and the following disclaimer in
18  the documentation and/or other materials provided with the
19  distribution.
20  3. The names of the authors may not be used to endorse or promote
21  products derived from this software without specific prior
22  written permission.
23 
24  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
25  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
28  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
30  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
32  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
33  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 */
36 
37 /* 0x0501 => Windows XP; needs to be at least this value because of GetFileSizeEx */
38 #if !defined(MS_UWP) && !defined(_WIN32_WINNT)
39 #define _WIN32_WINNT 0x0501
40 #endif
41 
42 #include <windows.h>
43 
44 #include <aclapi.h>
45 
46 #include <stdlib.h>
47 
48 #include "zipint.h"
49 
50 #include "zip_source_file.h"
51 
53  char *(*allocate_tempname)(const char *name, size_t extra_chars, size_t *lengthp);
55  BOOL(__stdcall *delete_file)(const void *name);
56  DWORD(__stdcall *get_file_attributes)(const void *name);
57  BOOL(__stdcall *get_file_attributes_ex)(const void *name, GET_FILEEX_INFO_LEVELS info_level, void *information);
58  void (*make_tempname)(char *buf, size_t len, const char *name, zip_uint32_t i);
59  BOOL(__stdcall *move_file)(const void *from, const void *to, DWORD flags);
60  BOOL(__stdcall *set_file_attributes)(const void *name, DWORD attributes);
61  char *(*string_duplicate)(const char *string);
62 };
63 
65 
67 
72 
73 bool _zip_filetime_to_time_t(FILETIME ft, time_t *t);
74 int _zip_win32_error_to_errno(DWORD win32err);
75 
76 #endif /* _HAD_ZIP_SOURCE_FILE_WIN32_H */
size_t len
Definition: 6502dis.c:15
lzma_index ** i
Definition: index.h:629
voidpf uLong offset
Definition: ioapi.h:144
voidpf void * buf
Definition: ioapi.h:138
const char * name
Definition: op.c:541
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
Definition: sfsocketcall.h:123
int time_t
Definition: sftypes.h:66
#define f(i)
Definition: sha256.c:46
BOOL(__stdcall *move_file)(const void *from
void(* make_tempname)(char *buf, size_t len, const char *name, zip_uint32_t i)
DWORD DWORD PSECURITY_ATTRIBUTES DWORD DWORD file_attributes
DWORD DWORD PSECURITY_ATTRIBUTES security_attributes
DWORD DWORD PSECURITY_ATTRIBUTES DWORD DWORD HANDLE template_file
DWORD DWORD PSECURITY_ATTRIBUTES DWORD creation_disposition
GET_FILEEX_INFO_LEVELS void * information
BOOL(__stdcall *delete_file)(const void *name)
HANDLE(__stdcall *create_file)(const void *name
DWORD(__stdcall *get_file_attributes)(const void *name)
GET_FILEEX_INFO_LEVELS info_level
BOOL(__stdcall *get_file_attributes_ex)(const void *name
DWORD
int _zip_win32_error_to_errno(DWORD win32err)
void _zip_win32_op_close(zip_source_file_context_t *ctx)
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_source_file_operations_t _zip_source_file_win32_named_ops
zip_int64_t _zip_win32_op_read(zip_source_file_context_t *ctx, void *buf, zip_uint64_t len)
bool _zip_win32_op_seek(zip_source_file_context_t *ctx, void *f, zip_int64_t offset, int whence)
uint64_t zip_uint64_t
Definition: zipconf.h:39
uint32_t zip_uint32_t
Definition: zipconf.h:37
int64_t zip_int64_t
Definition: zipconf.h:38