VirtualBox

Changeset 70455 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jan 3, 2018 6:49:14 PM (7 years ago)
Author:
vboxsync
Message:

IPRT/RTUuidCreate-win.cpp: Provide fallback for older NT versions without a NIC (or code for getting at it's MAC address).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/RTUuidCreate-win.cpp

    r69111 r70455  
    3535#include <iprt/assert.h>
    3636#include <iprt/err.h>
     37#include <iprt/rand.h>
    3738
    3839
     
    4748        return VINF_SUCCESS;
    4849
    49     /* error exit */
    50     return RTErrConvertFromWin32(rc);
     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). */
     54    RTRandBytes(pUuid, sizeof(*pUuid));
     55    pUuid->Gen.u8ClockSeqHiAndReserved = (pUuid->Gen.u8ClockSeqHiAndReserved & 0x3f) | 0x80;
     56    pUuid->Gen.u16TimeHiAndVersion     = (pUuid->Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000;
     57    return VINF_SUCCESS;
    5158}
    5259
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