@@ -69,10 +69,18 @@ class Guid
6969 " {%08X-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}" ;
7070 static constexpr int GUID_FORMAT_ARGS = 11 ;
7171
72+ Guid ()
73+ {
74+ memset (&m_data, 0 , SIZE);
75+ }
76+
7277public:
7378 static constexpr ULONG SIZE = sizeof (UUID);
7479
75- Guid () = delete ;
80+ static Guid empty ()
81+ {
82+ return Guid ();
83+ }
7684
7785 Guid (const Guid& other)
7886 : m_data(other.m_data)
@@ -84,7 +92,7 @@ class Guid
8492
8593 explicit Guid (const UCHAR* data)
8694 {
87- memcpy (&m_data, data, sizeof (UUID) );
95+ memcpy (&m_data, data, SIZE );
8896 }
8997
9098 Guid& operator =(const Guid& other)
@@ -95,7 +103,7 @@ class Guid
95103
96104 bool operator ==(const Guid& other) const
97105 {
98- return memcmp (&m_data, &other.m_data , sizeof (UUID) ) == 0 ;
106+ return memcmp (&m_data, &other.m_data , SIZE ) == 0 ;
99107 }
100108
101109 bool operator !=(const Guid& other) const
@@ -110,7 +118,7 @@ class Guid
110118
111119 void assign (const UCHAR* buffer)
112120 {
113- memcpy (&m_data, buffer, sizeof (UUID) );
121+ memcpy (&m_data, buffer, SIZE );
114122 }
115123
116124 void toString (char * buffer) const
@@ -160,7 +168,7 @@ class Guid
160168
161169 void copyTo (UCHAR* ptr) const
162170 {
163- memcpy (ptr, &m_data, sizeof (UUID) );
171+ memcpy (ptr, &m_data, SIZE );
164172 }
165173
166174 // Convert platform-dependent GUID into platform-independent form according to RFC 4122
0 commit comments