@@ -23,24 +23,30 @@ namespace Yubico.PlatformInterop
23
23
{
24
24
[ StructLayout ( LayoutKind . Sequential , CharSet = CharSet . Ansi , Pack = 1 ) ]
25
25
// Justification: Fields are read/write via interop. Readonly might not have any effect there, but it may give
26
- // maintainers a false impression about the true nature of these fields.
26
+ // maintainers a falls impression about the true nature of these fields.
27
27
[ SuppressMessage ( "ReSharper" , "FieldCanBeMadeReadOnly.Local" ) ]
28
28
[ SuppressMessage ( "Style" , "IDE0044:Add readonly modifier" ) ]
29
29
internal struct SCARD_READER_STATE
30
30
{
31
+ #pragma warning disable IDE0032 // Use auto property, leave as is for now, as it auto property may not work with interop
32
+ [ MarshalAs ( UnmanagedType . LPStr ) ]
33
+ private string _readerName ;
34
+ #pragma warning restore IDE0032 // Use auto property, leave as is for now, as it auto property may not work with interop
31
35
private IntPtr _userData ;
32
36
private uint _currentState ;
33
37
private uint _eventState ;
34
38
private uint _atrLength ;
35
-
36
39
[ MarshalAs ( UnmanagedType . ByValArray , SizeConst = 36 ) ]
37
40
private byte [ ] _answerToReset ;
38
41
39
42
private const uint SequenceMask = 0xFFFF_0000 ;
40
43
private const uint StateMask = 0x0000_FFFF ;
41
44
42
- [ field: MarshalAs ( UnmanagedType . LPStr ) ]
43
- public string ReaderName { get ; set ; }
45
+ public string ReaderName
46
+ {
47
+ get => _readerName ;
48
+ set => _readerName = value ;
49
+ }
44
50
45
51
public SCARD_STATE CurrentState => ( SCARD_STATE ) ( _currentState & StateMask ) ;
46
52
public SCARD_STATE EventState => ( SCARD_STATE ) ( _eventState & StateMask ) ;
0 commit comments