1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
7 public partial struct Guid
9 public static Guid
NewGuid()
11 // CoCreateGuid should never return Guid.Empty, since it attempts to maintain some
12 // uniqueness guarantees.
15 int hr
= Interop
.Ole32
.CoCreateGuid(out g
);
16 // We don't expect that this will ever throw an error, none are even documented, and so we don't want to pull
17 // in the HR to ComException mappings into the core library just for this so we will try a generic exception if
18 // we ever hit this condition.
21 Exception ex
= new Exception();