mirror of
https://github.com/SabreTools/SabreTools.IO.git
synced 2026-09-22 14:45:58 +00:00
Handle LPTStr implementations
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user