Changeset 70456 in vbox for trunk/src/VBox/Runtime/r3/win
- Timestamp:
- Jan 3, 2018 8:37:19 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/RTUuidCreate-win.cpp
r70455 r70456 37 37 #include <iprt/rand.h> 38 38 39 #include "internal-r3-win.h" 40 39 41 40 42 RTDECL(int) RTUuidCreate(PRTUUID pUuid) 41 43 { 42 /* check params */ 44 /* 45 * Input validation. 46 */ 43 47 AssertPtrReturn(pUuid, VERR_INVALID_POINTER); 44 48 45 RPC_STATUS rc = UuidCreate((UUID *)pUuid); 46 if ( rc == RPC_S_OK 47 || rc == RPC_S_UUID_LOCAL_ONLY) 48 return VINF_SUCCESS; 49 /* 50 * When using the UuidCreate API shortly after boot on NT 3.1 it typcially 51 * hangs for a long long time while polling for some service to start. 52 * What then usually happens next is a failure because it couldn't figure 53 * out the MAC address of the NIC. So, on NT 3.1 we always use the fallback. 54 */ 55 if (g_enmWinVer != kRTWinOSType_NT310) 56 { 57 RPC_STATUS rc = UuidCreate((UUID *)pUuid); 58 if ( rc == RPC_S_OK 59 || rc == RPC_S_UUID_LOCAL_ONLY) 60 return VINF_SUCCESS; 61 AssertMsg(rc == RPC_S_UUID_NO_ADDRESS, ("UuidCreate -> %u (%#x)\n", rc, rc)); 62 } 49 63 50 /* Seen on NT 3.1: */ 51 AssertMsg(rc == RPC_S_UUID_NO_ADDRESS, ("UuidCreate -> %u (%#x)\n", rc, rc)); 52 53 /* Use generic implementation as fallback (copy of RTUuidCreate-generic.cpp). */ 64 /* 65 * Use generic implementation as fallback (copy of RTUuidCreate-generic.cpp). 66 */ 54 67 RTRandBytes(pUuid, sizeof(*pUuid)); 55 68 pUuid->Gen.u8ClockSeqHiAndReserved = (pUuid->Gen.u8ClockSeqHiAndReserved & 0x3f) | 0x80;
Note:
See TracChangeset
for help on using the changeset viewer.