75 attributes = file_ops->get_file_attributes(
ctx->tmpname);
76 if (attributes == INVALID_FILE_ATTRIBUTES) {
81 if (attributes & FILE_ATTRIBUTE_TEMPORARY) {
82 if (!file_ops->set_file_attributes(
ctx->tmpname, attributes & ~FILE_ATTRIBUTE_TEMPORARY)) {
88 if (!file_ops->move_file(
ctx->tmpname,
ctx->fname, MOVEFILE_REPLACE_EXISTING)) {
103 PSECURITY_DESCRIPTOR psd =
NULL;
104 PSECURITY_ATTRIBUTES psa =
NULL;
105 SECURITY_ATTRIBUTES sa;
106 SECURITY_INFORMATION
si;
109 char *tempname =
NULL;
110 size_t tempname_size = 0;
113 si = DACL_SECURITY_INFORMATION | UNPROTECTED_DACL_SECURITY_INFORMATION;
115 if (success == ERROR_SUCCESS) {
116 sa.nLength =
sizeof(SECURITY_ATTRIBUTES);
117 sa.bInheritHandle =
FALSE;
118 sa.lpSecurityDescriptor = psd;
124 value = GetTickCount();
151 ctx->tmpname = tempname;
174 if (!file_ops->delete_file(
ctx->fname)) {
190 file_ops->delete_file(
ctx->tmpname);
198 WIN32_FILE_ATTRIBUTE_DATA file_attributes;
200 if (!file_ops->get_file_attributes_ex(
ctx->fname, GetFileExInfoStandard, &file_attributes)) {
202 if (
error == ERROR_FILE_NOT_FOUND) {
213 if (file_attributes.dwFileAttributes != INVALID_FILE_ATTRIBUTES) {
214 if ((file_attributes.dwFileAttributes & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE | FILE_ATTRIBUTE_REPARSE_POINT)) == 0) {
223 st->
size = ((
zip_uint64_t)file_attributes.nFileSizeHigh << 32) | file_attributes.nFileSizeLow;
256 DWORD share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE;
257 DWORD creation_disposition = OPEN_EXISTING;
258 DWORD file_attributes = FILE_ATTRIBUTE_NORMAL;
262 access = GENERIC_READ | GENERIC_WRITE;
263 share_mode = FILE_SHARE_READ;
264 creation_disposition = CREATE_NEW;
265 file_attributes = FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_TEMPORARY;
268 h = file_ops->create_file(
name,
access, share_mode, security_attributes, creation_disposition, file_attributes,
NULL);
RZ_API void Ht_() free(HtName_(Ht) *ht)
#define INVALID_HANDLE_VALUE
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause access
void(* make_tempname)(char *buf, size_t len, const char *name, zip_uint32_t i)
char *(* string_duplicate)(const char *string)
char *(* allocate_tempname)(const char *name, size_t extra_chars, size_t *lengthp)
void error(const char *msg)
if(dbg->bits==RZ_SYS_BITS_64)
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_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)
static zip_int64_t _zip_win32_named_op_commit_write(zip_source_file_context_t *ctx)
static bool _zip_win32_named_op_open(zip_source_file_context_t *ctx)
static bool _zip_win32_named_op_stat(zip_source_file_context_t *ctx, zip_source_file_stat_t *st)
static zip_int64_t _zip_win32_named_op_create_temp_output(zip_source_file_context_t *ctx)
static zip_int64_t _zip_win32_named_op_write(zip_source_file_context_t *ctx, const void *data, zip_uint64_t len)
static zip_int64_t _zip_win32_named_op_remove(zip_source_file_context_t *ctx)
zip_source_file_operations_t _zip_source_file_win32_named_ops
static void _zip_win32_named_op_rollback_write(zip_source_file_context_t *ctx)
static char * _zip_win32_named_op_string_duplicate(zip_source_file_context_t *ctx, const char *string)
static HANDLE win32_named_open(zip_source_file_context_t *ctx, const char *name, bool temporary, PSECURITY_ATTRIBUTES security_attributes)