When compiling apr at the command line for httpd-2.0 on Win2k, rand.c
would puke a bunch of errors.  I tracked it down to objbase.h .... not sure
why, but that file would jack everything up.  This patch gets rid of it and
still creates a random UUID.  The weird part is that it would compile
in VC with no problems, but croak at the command line.

Also, not that its necessarily correct 'cause its coming from Microsoft,
but the MSDN says that UuidCreate doesn't use the MAC address to
create UUID's anymore so I removed the comment.

Shane


Index: srclib/apr/libapr.dsp
===================================================================
RCS file: /home/cvspublic/apr/libapr.dsp,v
retrieving revision 1.72
diff -u -3 -r1.72 libapr.dsp
--- srclib/apr/libapr.dsp       17 Jul 2002 05:15:17 -0000      1.72
+++ srclib/apr/libapr.dsp       17 Jul 2002 18:57:08 -0000
@@ -53,7 +53,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib 
shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map 
/machine:I386 /OPT:NOREF
-# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib 
shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map 
/machine:I386 /OPT:NOREF
+# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib 
shell32.lib rpcrt4.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map 
/machine:I386 /OPT:NOREF
 
 !ELSEIF  "$(CFG)" == "libapr - Win32 Debug"
 
@@ -79,7 +79,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib 
shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no 
/map /debug /machine:I386 /OPT:NOREF
-# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib 
shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no 
/map /debug /machine:I386 /OPT:NOREF
+# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib 
shell32.lib rpcrt4.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll 
/incremental:no /map /debug /machine:I386 /OPT:NOREF
 
 !ENDIF 
 
Index: srclib/apr/misc/win32/rand.c
===================================================================
RCS file: /home/cvspublic/apr/misc/win32/rand.c,v
retrieving revision 1.15
diff -u -3 -r1.15 rand.c
--- srclib/apr/misc/win32/rand.c        17 Jul 2002 04:11:33 -0000      1.15
+++ srclib/apr/misc/win32/rand.c        17 Jul 2002 18:57:08 -0000
@@ -52,14 +52,12 @@
  * <http://www.apache.org/>.
  */
 
-#include <windows.h>
-#include <objbase.h>
-#include <wincrypt.h>
 #include "apr.h"
 #include "apr_private.h"
 #include "apr_general.h"
 #include "apr_portable.h"
 #include "misc.h"
+#include <wincrypt.h>
 
 
 APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
@@ -87,15 +85,8 @@
 
 APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data)
 {
-    /* Note: this call doesn't actually require CoInitialize() first 
-     *
-     * XXX: 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.
-     */
-    if (FAILED(CoCreateGuid((LPGUID)uuid_data))) {
-       return APR_EGENERAL;
+    if (FAILED(UuidCreate((UUID *)uuid_data))) {
+        return APR_EGENERAL;
     }
     return APR_SUCCESS;
 }




Reply via email to