VirtualBox

Changeset 893 in vbox


Ignore:
Timestamp:
Feb 14, 2007 9:36:39 AM (18 years ago)
Author:
vboxsync
Message:

Use RTRand.

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile

    r855 r893  
    195195        utf-8.cpp \
    196196        zip.cpp \
     197        misc/rand.cpp \
    197198
    198199ifdef IPRT_WITH_KLDR
     
    225226        generic/semsrw-generic.cpp \
    226227        generic/semnoint-generic.cpp \
     228        generic/rand-stubs-generic.cpp \
    227229        nt/RTErrConvertFromNtStatus.cpp \
    228230        win32/errmsgwin.cpp \
     
    256258        generic/RTLogWriteDebugger-generic.cpp \
    257259        generic/pathhost-generic.cpp \
     260        generic/uuid-generic.cpp \
    258261        r3/linux/sched-linux.cpp \
    259         r3/linux/uuid-linux.cpp \
    260262        r3/posix/alloc-posix.cpp \
    261263        r3/posix/dir-posix.cpp \
     
    265267        r3/posix/path-posix.cpp \
    266268        r3/posix/process-posix.cpp \
     269        r3/posix/rand-posix.cpp \
    267270        r3/posix/system-posix.cpp \
    268271        r3/posix/thread-posix.cpp \
     
    278281endif
    279282
    280 
    281283RuntimeR3_SOURCES.os2   = \
    282284        generic/RTDirQueryInfo-generic.cpp \
     
    285287        generic/RTLogWriteDebugger-generic.cpp \
    286288        generic/pathhost-generic.cpp \
     289        generic/rand-stubs-generic.cpp \
    287290        generic/semsrw-generic.cpp \
    288291        generic/semnoint-generic.cpp \
     
    312315        generic/RTLogWriteDebugger-generic.cpp \
    313316        generic/pathhost-generic.cpp \
     317        generic/sched-generic.cpp \
     318        generic/timer-generic.cpp \
     319        generic/utf16locale-generic.cpp \
     320        generic/uuid-generic.cpp\
    314321        r3/darwin/alloc-darwin.cpp \
    315322        r3/posix/dir-posix.cpp \
     
    319326        r3/posix/path-posix.cpp \
    320327        r3/posix/process-posix.cpp \
    321         generic/sched-generic.cpp \
     328        r3/posix/rand-posix.cpp \
    322329        r3/posix/sems-posix.cpp \
    323330        r3/posix/system-posix.cpp \
    324331        r3/posix/thread-posix.cpp \
     332        r3/posix/utf8-posix.cpp \
    325333        r3/darwin/time-darwin.cpp \
    326         generic/timer-generic.cpp \
    327         generic/utf16locale-generic.cpp \
    328         r3/posix/utf8-posix.cpp \
    329         r3/linux/uuid-linux.cpp \
    330334        timesup.cpp \
    331335
     
    346350        r3/posix/path-posix.cpp \
    347351        r3/posix/process-posix.cpp \
     352        r3/posix/rand-posix.cpp \
    348353        r3/posix/sems-posix.cpp \
    349354        r3/posix/system-posix.cpp \
     
    376381        generic/semsrw-generic.cpp \
    377382        generic/semnoint-generic.cpp \
     383        generic/uuid-generic.cpp \
    378384        l4/l4-errno.cpp \
    379385        l4/process-l4env.cpp \
     
    384390        generic/utf16locale-generic.cpp \
    385391        l4/utf8-l4env.cpp \
    386         r3/linux/uuid-linux.cpp \
    387392        r3/posix/alloc-posix.cpp \
    388393        r3/posix/dir-posix.cpp \
     
    390395        r3/posix/ldrNative-posix.cpp \
    391396        r3/posix/path-posix.cpp \
     397        r3/posix/rand-posix.cpp \
    392398        r3/posix/time-posix.cpp \
    393399        timesup.cpp
  • trunk/src/VBox/Runtime/generic/uuid-generic.cpp

    r204 r893  
    2929#include <iprt/time.h>
    3030#include <iprt/asm.h>
     31#include <iprt/rand.h>
    3132
    3233
     
    4546    AssertReturn(pUuid, VERR_INVALID_PARAMETER);
    4647
    47     /*
    48      * We don't have any good random sources in IPRT yet, so
    49      * for the time being we'll use Nano time and the cpu TSC
    50      * (which of course isn't very good at all!).
    51      */
    52     RTTIMESPEC Now;
    53     pUuid->au64[0] = RTTimeSpecGetNano(RTTimeNow(&Now));
    54     pUuid->au64[1] = ASMReadTSC();
     48    RTRandBytes(pUuid, sizeof(*pUuid));
    5549    pUuid->Gen.u16ClockSeq = (pUuid->Gen.u16ClockSeq & 0x3fff) | 0x8000;
    5650    pUuid->Gen.u16TimeHiAndVersion = (pUuid->Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette