@@ -383,15 +383,20 @@ impl<'de> Decode<'de> for ExtendedClientOptionalInfo {
383383 }
384384}
385385
386+ /// [2.2.1.11.1.1.1.1] Time Zone Information (TS_TIME_ZONE_INFORMATION)
387+ ///
388+ /// The timezone info struct contains client time zone information.
389+ ///
390+ /// [2.2.1.11.1.1.1.1]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/526ed635-d7a9-4d3c-bbe1-4e3fb17585f4
386391#[ derive( Debug , Clone , PartialEq , Eq ) ]
387392pub struct TimezoneInfo {
388- pub bias : u32 ,
393+ pub bias : i32 ,
389394 pub standard_name : String ,
390395 pub standard_date : OptionalSystemTime ,
391- pub standard_bias : u32 ,
396+ pub standard_bias : i32 ,
392397 pub daylight_name : String ,
393398 pub daylight_date : OptionalSystemTime ,
394- pub daylight_bias : u32 ,
399+ pub daylight_bias : i32 ,
395400}
396401
397402impl TimezoneInfo {
@@ -410,21 +415,21 @@ impl Encode for TimezoneInfo {
410415 fn encode ( & self , dst : & mut WriteCursor < ' _ > ) -> EncodeResult < ( ) > {
411416 ensure_fixed_part_size ! ( in: dst) ;
412417
413- dst. write_u32 ( self . bias ) ;
418+ dst. write_i32 ( self . bias ) ;
414419
415420 let mut standard_name = utils:: to_utf16_bytes ( self . standard_name . as_str ( ) ) ;
416421 standard_name. resize ( TIMEZONE_INFO_NAME_LEN , 0 ) ;
417422 dst. write_slice ( & standard_name) ;
418423
419424 self . standard_date . encode ( dst) ?;
420- dst. write_u32 ( self . standard_bias ) ;
425+ dst. write_i32 ( self . standard_bias ) ;
421426
422427 let mut daylight_name = utils:: to_utf16_bytes ( self . daylight_name . as_str ( ) ) ;
423428 daylight_name. resize ( TIMEZONE_INFO_NAME_LEN , 0 ) ;
424429 dst. write_slice ( & daylight_name) ;
425430
426431 self . daylight_date . encode ( dst) ?;
427- dst. write_u32 ( self . daylight_bias ) ;
432+ dst. write_i32 ( self . daylight_bias ) ;
428433
429434 Ok ( ( ) )
430435 }
@@ -442,14 +447,14 @@ impl<'de> Decode<'de> for TimezoneInfo {
442447 fn decode ( src : & mut ReadCursor < ' de > ) -> DecodeResult < Self > {
443448 ensure_fixed_part_size ! ( in: src) ;
444449
445- let bias = src. read_u32 ( ) ;
450+ let bias = src. read_i32 ( ) ;
446451 let standard_name = utils:: decode_string ( src. read_slice ( TIMEZONE_INFO_NAME_LEN ) , CharacterSet :: Unicode , false ) ?;
447452 let standard_date = OptionalSystemTime :: decode ( src) ?;
448- let standard_bias = src. read_u32 ( ) ;
453+ let standard_bias = src. read_i32 ( ) ;
449454
450455 let daylight_name = utils:: decode_string ( src. read_slice ( TIMEZONE_INFO_NAME_LEN ) , CharacterSet :: Unicode , false ) ?;
451456 let daylight_date = OptionalSystemTime :: decode ( src) ?;
452- let daylight_bias = src. read_u32 ( ) ;
457+ let daylight_bias = src. read_i32 ( ) ;
453458
454459 Ok ( Self {
455460 bias,
@@ -463,6 +468,20 @@ impl<'de> Decode<'de> for TimezoneInfo {
463468 }
464469}
465470
471+ impl Default for TimezoneInfo {
472+ fn default ( ) -> Self {
473+ Self {
474+ bias : 0 ,
475+ standard_name : String :: new ( ) ,
476+ standard_date : OptionalSystemTime ( None ) ,
477+ standard_bias : 0 ,
478+ daylight_name : String :: new ( ) ,
479+ daylight_date : OptionalSystemTime ( None ) ,
480+ daylight_bias : 0 ,
481+ }
482+ }
483+ }
484+
466485#[ derive( Debug , Clone , PartialEq , Eq ) ]
467486pub struct SystemTime {
468487 pub month : Month ,
0 commit comments