Handle LPTStr implementations

This commit is contained in:
Matt Nadareski
2024-04-29 00:49:45 -04:00
parent a7476b6ac9
commit 8caeea053f
3 changed files with 3 additions and 3 deletions

View File

@@ -712,6 +712,7 @@ namespace SabreTools.IO.Extensions
return encoding.GetString(byvalBytes);
case UnmanagedType.LPStr:
case UnmanagedType.LPTStr: // Technically distinct; possibly not null-terminated
case null:
var lpstrBytes = new List<byte>();
while (true)
@@ -745,7 +746,6 @@ namespace SabreTools.IO.Extensions
return Encoding.Unicode.GetString([.. lpwstrBytes]);
// No support required yet
case UnmanagedType.LPTStr:
#if NET472_OR_GREATER || NETCOREAPP
case UnmanagedType.LPUTF8Str:
#endif

View File

@@ -839,6 +839,7 @@ namespace SabreTools.IO.Extensions
return encoding.GetString(byvalBytes);
case UnmanagedType.LPStr:
case UnmanagedType.LPTStr: // Technically distinct; possibly not null-terminated
case null:
var lpstrBytes = new List<byte>();
while (true)
@@ -872,7 +873,6 @@ namespace SabreTools.IO.Extensions
return Encoding.Unicode.GetString([.. lpwstrBytes]);
// No support required yet
case UnmanagedType.LPTStr:
#if NET472_OR_GREATER || NETCOREAPP
case UnmanagedType.LPUTF8Str:
#endif

View File

@@ -823,6 +823,7 @@ namespace SabreTools.IO.Extensions
return encoding.GetString(byvalBytes);
case UnmanagedType.LPStr:
case UnmanagedType.LPTStr: // Technically distinct; possibly not null-terminated
case null:
var lpstrBytes = new List<byte>();
while (true)
@@ -856,7 +857,6 @@ namespace SabreTools.IO.Extensions
return Encoding.Unicode.GetString([.. lpwstrBytes]);
// No support required yet
case UnmanagedType.LPTStr:
#if NET472_OR_GREATER || NETCOREAPP
case UnmanagedType.LPUTF8Str:
#endif