Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 70481 invoked by uid 500); 12 Apr 2001 13:46:17 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 70466 invoked by uid 1134); 12 Apr 2001 13:46:17 -0000 Date: 12 Apr 2001 13:46:17 -0000 Message-ID: <20010412134617.70465.qmail@apache.org> From: wrowe@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/misc/win32 getuuid.c wrowe 01/04/12 06:46:16 Modified: misc/win32 getuuid.c Log: Point out a possible issue, and clean up the includes sequence. Revision Changes Path 1.5 +18 -2 apr/misc/win32/getuuid.c Index: getuuid.c =================================================================== RCS file: /home/cvs/apr/misc/win32/getuuid.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- getuuid.c 2001/02/16 04:15:57 1.4 +++ getuuid.c 2001/04/12 13:46:16 1.5 @@ -57,16 +57,32 @@ * located at http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt */ -#include +#define _WINUSER_ #include "apr.h" #include "apr_uuid.h" +#ifdef NOUSER +#undef NOUSER +#endif +#undef _WINUSER_ +#include +#include + APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid) { GUID guid; - /* Note: this call doesn't actually require CoInitialize() first */ + /* Note: this call doesn't actually require CoInitialize() first + * + * XXX: This is wrong (two ways) ... one we need to test the HRESULT + * and if not S_OK (0) then we actually FAILED! + * + * Second, we should scramble the bytes or some such to eliminate the + * possible misuse/abuse since uuid is based on the NIC address, and + * is therefore not only a uniqifier, but an identity (which might not + * be appropriate in all cases. + */ (void) CoCreateGuid(&guid); memcpy(uuid->data, &guid, sizeof(uuid->data)); }