Skip to content

Commit

Permalink
Merge pull request #436 from sykhro/main
Browse files Browse the repository at this point in the history
Make the library compile when targeting GDK
  • Loading branch information
0-wiz-0 committed May 23, 2024
2 parents a7a9452 + cc6d0d7 commit 46d3e5a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/zip_source_file_win32_named.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@

#include "zip_source_file_win32.h"

/* ACL is not available when targeting the games API partition */
#if defined(WINAPI_FAMILY_PARTITION) && defined(WINAPI_PARTITION_GAMES)
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_GAMES)
#define ACL_UNSUPPORTED
#endif
#endif

static zip_int64_t _zip_win32_named_op_commit_write(zip_source_file_context_t *ctx);
static zip_int64_t _zip_win32_named_op_create_temp_output(zip_source_file_context_t *ctx);
static bool _zip_win32_named_op_open(zip_source_file_context_t *ctx);
Expand Down Expand Up @@ -110,7 +117,11 @@ _zip_win32_named_op_create_temp_output(zip_source_file_context_t *ctx) {

if ((HANDLE)ctx->f != INVALID_HANDLE_VALUE && GetFileType((HANDLE)ctx->f) == FILE_TYPE_DISK) {
si = DACL_SECURITY_INFORMATION | UNPROTECTED_DACL_SECURITY_INFORMATION;
#ifdef ACL_UNSUPPORTED
success = ERROR_NOT_SUPPORTED;
#else
success = GetSecurityInfo((HANDLE)ctx->f, SE_FILE_OBJECT, si, NULL, NULL, &dacl, NULL, &psd);
#endif
if (success == ERROR_SUCCESS) {
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.bInheritHandle = FALSE;
Expand Down

0 comments on commit 46d3e5a

Please sign in to comment.