0004-VC9-compatibility-define-BCRYPT_SUCCESS.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --- work.orig/libarchive/archive_cryptor_private.h 2018-04-22 06:33:58.205352500 -0500
  2. +++ work/libarchive/archive_cryptor_private.h 2018-04-22 07:01:39.353981900 -0500
  3. @@ -64,12 +64,7 @@
  4. } archive_crypto_ctx;
  5. #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H)
  6. -#include <bcrypt.h>
  7. -
  8. -/* Common in other bcrypt implementations, but missing from VS2008. */
  9. -#ifndef BCRYPT_SUCCESS
  10. -#define BCRYPT_SUCCESS(r) ((NTSTATUS)(r) == STATUS_SUCCESS)
  11. -#endif
  12. +#include "bcrypt_with_vs2008.h"
  13. #define AES_MAX_KEY_SIZE 32
  14. #define AES_BLOCK_SIZE 16
  15. --- work.orig/libarchive/archive_hmac_private.h 2018-04-22 06:33:58.565158400 -0500
  16. +++ work/libarchive/archive_hmac_private.h 2018-04-22 07:01:16.915110000 -0500
  17. @@ -64,7 +64,7 @@
  18. } archive_crypto_ctx;
  19. #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H)
  20. -#include <bcrypt.h>
  21. +#include "bcrypt_with_vs2008.h"
  22. /* Common in other bcrypt implementations, but missing from VS2008. */
  23. #ifndef BCRYPT_SUCCESS
  24. --- work.orig/libarchive/bcrypt_with_vs2008.h 2018-04-22 07:33:12.000000000 -0500
  25. +++ work/libarchive/bcrypt_with_vs2008.h 2018-04-22 07:01:13.212019900 -0500
  26. @@ -0,0 +1,14 @@
  27. +#if !defined(BCRYPT_WITH_VS2008)
  28. +#define BCRYPT_WITH_VS2008
  29. +#include <bcrypt.h>
  30. +
  31. +/* Common in other bcrypt implementations, but missing from VS2008. */
  32. +#ifndef BCRYPT_SUCCESS
  33. +#ifndef NT_SUCCESS
  34. +#define NT_SUCCESS(x) ((x)>=0)
  35. +#define STATUS_SUCCESS ((NTSTATUS)0)
  36. +#endif
  37. +#define BCRYPT_SUCCESS(r) ((NTSTATUS)(r) == STATUS_SUCCESS)
  38. +#endif
  39. +
  40. +#endif /* BCRYPT_WITH_VS2008 */