include: Add a missing wincrypt.h include directive to mprapi.hB.

Francois Gouget fgouget at free.fr
Mon Dec 12 16:53:07 CST 2011


Also add the USE_WC_PREFIX macro so one can cleanly deal with the CMSG_DATA conflict with sys/socket.h.
---

I'm open to other approaches to avoid the CMSG_DATA conflict this 
generates. The USE_WC_PREFIX one seemed the most likely to be useful in 
other contexts where we want access to both CMSG_DATA values.


 dlls/ws2_32/socket.c |    1 +
 include/mprapi.h     |    1 +
 include/wincrypt.h   |   16 ++++++++++++++++
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 3d25942..8743317 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -143,6 +143,7 @@
 #include "mstcpip.h"
 #include "af_irda.h"
 #include "winnt.h"
+#define USE_WC_PREFIX   /* For CMSG_DATA */
 #include "iphlpapi.h"
 #include "wine/server.h"
 #include "wine/debug.h"
diff --git a/include/mprapi.h b/include/mprapi.h
index 1860f98..4e67ff0 100644
--- a/include/mprapi.h
+++ b/include/mprapi.h
@@ -22,6 +22,7 @@
 #include <lmcons.h>
 #include <ras.h>
 #include <in6addr.h>
+#include <wincrypt.h>
 
 #define MAX_DEVICE_NAME                 128
 #define MAX_DEVICETYPE_NAME              16
diff --git a/include/wincrypt.h b/include/wincrypt.h
index ae5aa05..1311f31 100644
--- a/include/wincrypt.h
+++ b/include/wincrypt.h
@@ -3432,6 +3432,7 @@ typedef struct _CERT_ID
 #define CERT_ID_KEY_IDENTIFIER       2
 #define CERT_ID_SHA1_HASH            3
 
+#ifndef USE_WC_PREFIX
 #undef CMSG_DATA /* may be defined by sys/socket.h */
 #define CMSG_DATA                 1
 #define CMSG_SIGNED               2
@@ -3446,6 +3447,21 @@ typedef struct _CERT_ID
 #define CMSG_ENVELOPED_FLAG            (1 << CMSG_ENVELOPED)
 #define CMSG_SIGNED_AND_ENVELOPED_FLAG (1 << CMSG_SIGNED_AND_ENVELOPED)
 #define CMSG_ENCRYPTED_FLAG            (1 << CMSG_ENCRYPTED)
+#else
+#define WC_CMSG_DATA                 1
+#define WC_CMSG_SIGNED               2
+#define WC_CMSG_ENVELOPED            3
+#define WC_CMSG_SIGNED_AND_ENVELOPED 4
+#define WC_CMSG_HASHED               5
+#define WC_CMSG_ENCRYPTED            6
+
+#define WC_CMSG_ALL_FLAGS                 ~0U
+#define WC_CMSG_DATA_FLAG                 (1 << WC_CMSG_DATA)
+#define WC_CMSG_SIGNED_FLAG               (1 << WC_CMSG_SIGNED)
+#define WC_CMSG_ENVELOPED_FLAG            (1 << WC_CMSG_ENVELOPED)
+#define WC_CMSG_SIGNED_AND_ENVELOPED_FLAG (1 << WC_CMSG_SIGNED_AND_ENVELOPED)
+#define WC_CMSG_ENCRYPTED_FLAG            (1 << WC_CMSG_ENCRYPTED)
+#endif
 
 typedef struct _CMSG_SIGNER_ENCODE_INFO
 {
-- 
1.7.7.3




More information about the wine-patches mailing list