Changeset 893 in vbox
- Timestamp:
- Feb 14, 2007 9:36:39 AM (18 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile
r855 r893 195 195 utf-8.cpp \ 196 196 zip.cpp \ 197 misc/rand.cpp \ 197 198 198 199 ifdef IPRT_WITH_KLDR … … 225 226 generic/semsrw-generic.cpp \ 226 227 generic/semnoint-generic.cpp \ 228 generic/rand-stubs-generic.cpp \ 227 229 nt/RTErrConvertFromNtStatus.cpp \ 228 230 win32/errmsgwin.cpp \ … … 256 258 generic/RTLogWriteDebugger-generic.cpp \ 257 259 generic/pathhost-generic.cpp \ 260 generic/uuid-generic.cpp \ 258 261 r3/linux/sched-linux.cpp \ 259 r3/linux/uuid-linux.cpp \260 262 r3/posix/alloc-posix.cpp \ 261 263 r3/posix/dir-posix.cpp \ … … 265 267 r3/posix/path-posix.cpp \ 266 268 r3/posix/process-posix.cpp \ 269 r3/posix/rand-posix.cpp \ 267 270 r3/posix/system-posix.cpp \ 268 271 r3/posix/thread-posix.cpp \ … … 278 281 endif 279 282 280 281 283 RuntimeR3_SOURCES.os2 = \ 282 284 generic/RTDirQueryInfo-generic.cpp \ … … 285 287 generic/RTLogWriteDebugger-generic.cpp \ 286 288 generic/pathhost-generic.cpp \ 289 generic/rand-stubs-generic.cpp \ 287 290 generic/semsrw-generic.cpp \ 288 291 generic/semnoint-generic.cpp \ … … 312 315 generic/RTLogWriteDebugger-generic.cpp \ 313 316 generic/pathhost-generic.cpp \ 317 generic/sched-generic.cpp \ 318 generic/timer-generic.cpp \ 319 generic/utf16locale-generic.cpp \ 320 generic/uuid-generic.cpp\ 314 321 r3/darwin/alloc-darwin.cpp \ 315 322 r3/posix/dir-posix.cpp \ … … 319 326 r3/posix/path-posix.cpp \ 320 327 r3/posix/process-posix.cpp \ 321 generic/sched-generic.cpp \328 r3/posix/rand-posix.cpp \ 322 329 r3/posix/sems-posix.cpp \ 323 330 r3/posix/system-posix.cpp \ 324 331 r3/posix/thread-posix.cpp \ 332 r3/posix/utf8-posix.cpp \ 325 333 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 \330 334 timesup.cpp \ 331 335 … … 346 350 r3/posix/path-posix.cpp \ 347 351 r3/posix/process-posix.cpp \ 352 r3/posix/rand-posix.cpp \ 348 353 r3/posix/sems-posix.cpp \ 349 354 r3/posix/system-posix.cpp \ … … 376 381 generic/semsrw-generic.cpp \ 377 382 generic/semnoint-generic.cpp \ 383 generic/uuid-generic.cpp \ 378 384 l4/l4-errno.cpp \ 379 385 l4/process-l4env.cpp \ … … 384 390 generic/utf16locale-generic.cpp \ 385 391 l4/utf8-l4env.cpp \ 386 r3/linux/uuid-linux.cpp \387 392 r3/posix/alloc-posix.cpp \ 388 393 r3/posix/dir-posix.cpp \ … … 390 395 r3/posix/ldrNative-posix.cpp \ 391 396 r3/posix/path-posix.cpp \ 397 r3/posix/rand-posix.cpp \ 392 398 r3/posix/time-posix.cpp \ 393 399 timesup.cpp -
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.