[PSDK]
authorThomas Faber <thomas.faber@reactos.org>
Thu, 21 Jun 2012 17:41:25 +0000 (17:41 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Thu, 21 Jun 2012 17:41:25 +0000 (17:41 +0000)
- Add missing alignment defines to winnt.h (copied from ntdef.h)
- Update bcrypt.h to Wine 1.5.4

svn path=/trunk/; revision=56775

reactos/include/psdk/bcrypt.h
reactos/include/psdk/winnt.h

index fd9a6a8..43d1f94 100644 (file)
 #define OPTIONAL
 #endif
 
+#ifndef WINE_NTSTATUS_DECLARED
+#define WINE_NTSTATUS_DECLARED
+typedef LONG NTSTATUS;
+#endif
+
 typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
 {
     LPWSTR pszName;
index b9e9892..86e107e 100644 (file)
@@ -109,12 +109,41 @@ extern "C" {
 #ifndef RC_INVOKED
 #include <string.h>
 
-/* FIXME: add more architectures. Is there a way to specify this in GCC? */
-#if defined(_M_AMD64)
-#undef UNALIGNED
+#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64)
+#define ALIGNMENT_MACHINE
 #define UNALIGNED __unaligned
+#if defined(_WIN64)
+#define UNALIGNED64 __unaligned
+#else
+#define UNALIGNED64
+#endif
 #else
+#undef ALIGNMENT_MACHINE
 #define UNALIGNED
+#define UNALIGNED64
+#endif
+
+#if defined(_WIN64) || defined(_M_ALPHA)
+#define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG)
+#define MEMORY_ALLOCATION_ALIGNMENT 16
+#else
+#define MAX_NATURAL_ALIGNMENT sizeof(ULONG)
+#define MEMORY_ALLOCATION_ALIGNMENT 8
+#endif
+
+/* Returns the type's alignment */
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
+#define TYPE_ALIGNMENT(t) __alignof(t)
+#else
+#define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test)
+#endif
+
+#if defined(_AMD64_) || defined(_X86_)
+#define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(ULONG)
+#elif defined(_IA64_) || defined(_ARM_)
+#define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT(ULONG))
+#else
+#error "unknown architecture"
 #endif
 
 #ifndef DECLSPEC_NOVTABLE