18 Commits
Author SHA1 Message Date
Steve Lhomme ac96967e36 [cmake] add uuid library when using xmllite
Consecutive to 16fd043f51
IID_ISequentialStream is required by the code.
This GUID is defined in uuid.lib or libuuid.a in mingw-w64. It is required
to link with that library to get the definition of the GUID. Some toolchains
add it by default but not all.
2025-05-26 10:44:49 +02:00
Steve Lhomme 08ab094ea7 Don't use Windows bcrypt when building for Windows XP or older (#2374)
The header may be detected but we can't use the calls.

The same check is already done in many places but not all of them.
2024-10-08 21:06:57 -07:00
Steve Lhomme 5ec2b84462 Fix usage of GetVolumePathNameW in UWP before 20H1 (#2247)
It started being allowed in UWP in 20H1.
2024-06-20 22:57:15 +02:00
Steve Lhomme 3861d5ab0d Use Windows bcrypt when enabled and building for Vista+ (#1887)
The wincrypt API is deprecated and is not allowed in UWP builds. We can
use the more modern bcrypt API which has equivalent calls.
2023-07-14 00:32:56 +02:00
Steve Lhomme 9e1081b9a8 Disable CreateFileA calls in UWP builds
Only CreateFile2 and CreateFileFromAppW are allowed.
2023-07-14 00:31:19 +02:00
Steve Lhomme 2aa73f8c94 Use CreateFile2 instead of CreateFileW on Win8+ builds
CreateFileW is not allowed in Universal Windows Platform (UWP) builds but
CreateFile2 is available. We could just enable this code for UWP but
it's probably to use it going forward so the code is properly tested on
both sides.
2023-07-14 00:31:19 +02:00
Steve Lhomme d9a7d05561 tests: use CreateFileA for char* filenames
In case the code is compiled with the UNICODE define.
2023-07-14 00:30:42 +02:00
Steve Lhomme 35b79b01cb Don't call GetOEMCP() in Universal Windows Platform builds
It's not available [1] [2]. However we can use the intermediate CP_OEMCP
value. It can be used to compare charsets in create_sconv_object().
It won't work with comparing charsets in archive_string_default_conversion_for_read()
and archive_string_default_conversion_for_write(). current_codepage being
an actual CodePage value.

[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-localization-l1-2-0dll
[2] https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getoemcp#requirements
2023-07-14 00:30:12 +02:00
Steve Lhomme f49793bb9e Use the common CMake BUILD_SHARED_LIBS to build shared library or not
https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html

Usually it's built-in but make sure we have it on by default.

We don't need to rename the windows static library when it's the only one built.
This will also allow proper usage of the pkg-config file in this case. Otherwise
there is no way to select the static library that way.
2023-07-14 00:29:45 +02:00
Steve Lhomme 480ba376a6 Fix bcrypt detection on UNIX cross-compilation
The Windows SDK uses an uppercase on the B, but mingw-w64 doesn't.
The autoconf detection already uses a lowercase bcrypt.
2023-07-14 00:28:32 +02:00
Steve Lhomme aaf60eb0f1 Fix build error when cross-compiling for Windows
CHECK_C_SOURCE_RUNS generates a build error when cross-compiling.

ZLIB_WINAPI is the only one tested. When the run test fails, it's tested again
with just a compilation.
2023-07-14 00:28:13 +02:00
Steve Lhomme e2493eb822 fix the CreateHardLinkW signature to match the real function
The `ret` variable was already using BOOL instead of BOOLEAN.
2023-07-14 00:27:45 +02:00
Steve Lhomme 29df98d6b7 Disable CreateSymbolicLinkW use in UWP builds
The call is forbidden:
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createsymboliclinkw#requirements
2023-07-14 00:27:45 +02:00
Steve Lhomme 86641b9ab5 Use CreateHardLinkW and CreateSymbolicLinkW directly on Vista+ builds
No need to load the kernel library manually. It's always available. It's not
possible to load it in Universal Windows Platform (UWP) builds anyway.

No need to load the kernel library manually. It's always available. It's not
possible to load it in Universal Windows Platform (UWP) builds anyway.
2023-07-14 00:27:45 +02:00
Steve Lhomme 75e209efa2 Disable program call with stdin/stdout usage on UWP builds
Some calls are not allowed:
* WaitForInputIdle [1]
* SetHandleInformation [2]
* STARTF_XXX flags for CreateProcess are not allowed

[1] https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-waitforinputidle#requirements
[2] https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-sethandleinformation#requirements
2023-07-14 00:26:36 +02:00
Steve Lhomme 1fd0c0152b don't force windows versions if they are set in the environment 2020-06-19 13:01:16 +02:00
Steve Lhomme 62e9f87e2a consistently use svfs for statvfs variables
So it cannot be misinterpreted as a statfs which uses the sfs variable name.
2020-04-06 08:29:45 +02:00
Steve Lhomme 32da100ff5 archive_entry: use the proper define for mode_t
This is the define set in archive_entry.h to use the right mode_t type per
platform. "mode_t" may not be available at all.

This is also how these functions are declared in archive_entry.h
2020-04-02 16:01:45 +02:00