Skip to content

Commit 80ddf1b

Browse files
AliveDevildkocher
authored andcommitted
Review
1 parent c03da13 commit 80ddf1b

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

core/src/main/csharp/Windows/Win32/Foundation_PWSTR_Extensions.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

core/src/main/csharp/Windows/Win32/PCWSTR.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ namespace Windows.Win32.Foundation;
66

77
public unsafe partial struct PCWSTR
88
{
9-
public static PCWSTR DangerousFromString(in ReadOnlySpan<char> value)
9+
public static PCWSTR DangerousFromSpan(in ReadOnlySpan<char> value)
1010
{
1111
return (char*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(value));
1212
}
1313

14-
public static PCWSTR DangerousFromString(string value) => DangerousFromString(value.AsSpan());
14+
public static PCWSTR DangerousFromString(string value) => DangerousFromSpan(value.AsSpan());
15+
16+
public PWSTR DangerousAsPWSTR() => Value;
1517

1618
public string ToString(int length) => Value is null ? new string(Value, 0, length) : null;
1719
}

core/src/main/csharp/Windows/Win32/PWSTR.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ namespace Windows.Win32.Foundation;
66

77
public unsafe partial struct PWSTR
88
{
9-
public static PWSTR DangerousFromString(in Span<char> value)
9+
public static PWSTR DangerousFromSpan(in Span<char> value)
1010
{
1111
return (char*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(value));
1212
}
1313

14+
public PCWSTR DangerousAsPWSTR() => Value;
15+
1416
public string ToString(int length) => Value is null ? null : new(Value, 0, length);
1517
}

0 commit comments

Comments
 (0)