@@ -382,7 +382,8 @@ public enum ErrorCode {
382
382
ERR_UNLOADED = 103 ,
383
383
ERR_NO_INVOCATION = 104 ,
384
384
ABSENT_INFORMATION = 105 ,
385
- NO_SEQ_POINT_AT_IL_OFFSET = 106
385
+ NO_SEQ_POINT_AT_IL_OFFSET = 106 ,
386
+ INVOKE_ABORTED = 107
386
387
}
387
388
388
389
public class ErrorHandlerEventArgs : EventArgs {
@@ -418,7 +419,7 @@ public abstract class Connection
418
419
* with newer runtimes, and vice versa.
419
420
*/
420
421
internal const int MAJOR_VERSION = 2 ;
421
- internal const int MINOR_VERSION = 40 ;
422
+ internal const int MINOR_VERSION = 42 ;
422
423
423
424
enum WPSuspendPolicy {
424
425
NONE = 0 ,
@@ -802,6 +803,13 @@ public string ReadString () {
802
803
return res ;
803
804
}
804
805
806
+ public string ReadUTF16String ( ) {
807
+ int len = decode_int ( packet , ref offset ) ;
808
+ string res = new String ( Encoding . Unicode . GetChars ( packet , offset , len ) ) ;
809
+ offset += len ;
810
+ return res ;
811
+ }
812
+
805
813
public ValueImpl ReadValue ( ) {
806
814
ElementType etype = ( ElementType ) ReadByte ( ) ;
807
815
@@ -2408,7 +2416,16 @@ internal void Array_SetValues (long id, int index, ValueImpl[] values) {
2408
2416
* STRINGS
2409
2417
*/
2410
2418
internal string String_GetValue ( long id ) {
2411
- return SendReceive ( CommandSet . STRING_REF , ( int ) CmdStringRef . GET_VALUE , new PacketWriter ( ) . WriteId ( id ) ) . ReadString ( ) ;
2419
+ var r = SendReceive ( CommandSet . STRING_REF , ( int ) CmdStringRef . GET_VALUE , new PacketWriter ( ) . WriteId ( id ) ) ;
2420
+
2421
+ bool is_utf16 = false ;
2422
+ if ( Version . AtLeast ( 2 , 41 ) )
2423
+ is_utf16 = r . ReadByte ( ) == 1 ;
2424
+
2425
+ if ( is_utf16 )
2426
+ return r . ReadUTF16String ( ) ;
2427
+ else
2428
+ return r . ReadString ( ) ;
2412
2429
}
2413
2430
2414
2431
internal int String_GetLength ( long id ) {
0 commit comments