Changeset 893 in vbox for trunk/src/VBox/Runtime/generic
- Timestamp:
- Feb 14, 2007 9:36:39 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18610
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/generic/uuid-generic.cpp
r204 r893 29 29 #include <iprt/time.h> 30 30 #include <iprt/asm.h> 31 #include <iprt/rand.h> 31 32 32 33 … … 45 46 AssertReturn(pUuid, VERR_INVALID_PARAMETER); 46 47 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)); 55 49 pUuid->Gen.u16ClockSeq = (pUuid->Gen.u16ClockSeq & 0x3fff) | 0x8000; 56 50 pUuid->Gen.u16TimeHiAndVersion = (pUuid->Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000;
Note:
See TracChangeset
for help on using the changeset viewer.