[TWAIN] Make twain structures respect 2 byte packing requirements

Jeremy White jwhite at codeweavers.com
Mon Feb 13 09:32:55 CST 2006


The TWAIN specification requires that all TWAIN data structures use 2 byte
packing alignment.  This misalignment was discovered when researching a bug
on the handling of the TW_IDENTITY structure.
-------------- next part --------------
 dlls/twain/twain.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

3ec26d651c345952c58c5fa320f1ef8eea2500c8
diff --git a/dlls/twain/twain.h b/dlls/twain/twain.h
index de29252..b8d2878 100644
--- a/dlls/twain/twain.h
+++ b/dlls/twain/twain.h
@@ -57,6 +57,9 @@
 #include "windef.h"
 #include "winbase.h"
 
+/* The Twain structures must be packed on 2 byte alignment */
+#include "pshpack2.h"
+
 #undef FAR
 #define FAR
 #define huge
@@ -1860,5 +1863,8 @@ typedef TW_UINT16 (*DSENTRYPROC)(pTW_IDE
 #ifdef  __cplusplus
 }
 #endif  /* cplusplus */
+
+/* The Twain structures must be packed on 2 byte alignment */
+#include "poppack.h"
 
 #endif  /* TWAIN */
-- 
1.1.5


More information about the wine-patches mailing list