Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/uuid/uuid.c | 3 +++
include/netiodef.h | 31 +++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/dlls/uuid/uuid.c b/dlls/uuid/uuid.c
index eacb83301d1..aa7ad3dd678 100644
--- a/dlls/uuid/uuid.c
+++ b/dlls/uuid/uuid.c
@@ -92,6 +92,9 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
#include "comsvcs.h"
#include "directmanipulation.h"
+#define __WINE_INIT_NPI_MODULEID
+#include "netiodef.h"
+
/* FIXME: cguids declares GUIDs but does not define their values */
/* GUIDs not declared in an exported header file */
diff --git a/include/netiodef.h b/include/netiodef.h
index 4d8d469b138..3089685bef1 100644
--- a/include/netiodef.h
+++ b/include/netiodef.h
@@ -40,8 +40,10 @@ typedef const NPI_MODULEID *PNPI_MODULEID;
#ifdef NONAMELESSUNION
#define _U(x) (x).u
+#define __U .u
#else
#define _U(x) (x)
+#define __U
#endif
static inline BOOLEAN NmrIsEqualNpiModuleId( const NPI_MODULEID *mod1, const NPI_MODULEID *mod2 )
@@ -63,6 +65,35 @@ static inline BOOLEAN NmrIsEqualNpiModuleId( const NPI_MODULEID *mod1, const NPI
return FALSE;
}
+#ifdef __WINE_INIT_NPI_MODULEID
+#ifdef __cplusplus
+#define DEFINE_NPI_GUID_MODULEID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ EXTERN_C const NPI_MODULEID name DECLSPEC_HIDDEN; \
+ EXTERN_C const NPI_MODULEID name = \
+ { .Length = sizeof(NPI_MODULEID), .Type = MIT_GUID, __U.Guid = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } }
+#else
+#define DEFINE_NPI_GUID_MODULEID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ const NPI_MODULEID name DECLSPEC_HIDDEN; \
+ const NPI_MODULEID name = \
+ { .Length = sizeof(NPI_MODULEID), .Type = MIT_GUID, __U.Guid = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } }
+#endif
+#else /* __WINE_INIT_MODULEID */
+#define DEFINE_NPI_GUID_MODULEID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ EXTERN_C const NPI_MODULEID name DECLSPEC_HIDDEN
+#endif /* __WINE_INIT_MODULEID */
+
+#define DEFINE_NPI_MS_MODULEID(name, l) DEFINE_NPI_GUID_MODULEID(name, 0xeb004a00 + l, 0x9b1a, 0x11d4, 0x91, 0x23, 0x00, 0x50, 0x04, 0x77, 0x59, 0xbc)
+
+DEFINE_NPI_MS_MODULEID( NPI_MS_IPV4_MODULEID, 0x00 );
+DEFINE_NPI_MS_MODULEID( NPI_MS_IPV6_MODULEID, 0x01 );
+DEFINE_NPI_MS_MODULEID( NPI_MS_UDP_MODULEID, 0x02 );
+DEFINE_NPI_MS_MODULEID( NPI_MS_TCP_MODULEID, 0x03 );
+DEFINE_NPI_MS_MODULEID( NPI_MS_NDIS_MODULEID, 0x11 );
+
+#undef DEFINE_NPI_MS_MODULEID
+#undef DEFINE_NPI_GUID_MODULEID
+
#undef _U
+#undef __U
#endif /* __WINE_NETIODEF_H */
--
2.23.0