36 int time_hi_and_version;
37 int clock_seq_hi_and_rsv;
43 uuid.time_low = GetRandomNumber(
46 uuid.time_mid = GetRandomNumber(0, 65535);
47 uuid.time_hi_and_version = GetRandomNumber(0, 65535);
48 uuid.clock_seq_hi_and_rsv = GetRandomNumber(0, 255);
49 uuid.clock_seq_low = GetRandomNumber(0, 255);
50 uuid.node_hi = GetRandomNumber(0, 65535);
51 uuid.node_low = GetRandomNumber(0, 2147483647);
55 uuid.clock_seq_hi_and_rsv = (uuid.clock_seq_hi_and_rsv & 0x3F) | 0x80;
59 uuid.time_hi_and_version = (uuid.time_hi_and_version & 0x0fff) | 0x4000;
61 str.Printf(_T(
"%08x-%04x-%04x-%02x%02x-%04x%08x"), uuid.time_low,
62 uuid.time_mid, uuid.time_hi_and_version, uuid.clock_seq_hi_and_rsv,
63 uuid.clock_seq_low, uuid.node_hi, uuid.node_low);