Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
88f4dabc
Commit
88f4dabc
authored
Jun 27, 2023
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winscard: Map only the reader name in map_states_inA/W().
parent
08a4a980
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
winscard.c
dlls/winscard/tests/winscard.c
+3
-1
winscard.c
dlls/winscard/winscard.c
+2
-8
No files found.
dlls/winscard/tests/winscard.c
View file @
88f4dabc
...
...
@@ -109,12 +109,14 @@ static void test_SCardEstablishContext(void)
memset
(
states
,
0
,
sizeof
(
states
)
);
states
[
0
].
szReader
=
"
\\\\
?PnP?
\\
Notification"
;
states
[
1
].
szReader
=
readers
;
states
[
1
].
cbAtr
=
sizeof
(
states
[
1
].
rgbAtr
)
+
1
;
ret
=
SCardGetStatusChangeA
(
context
,
1000
,
states
,
2
);
ok
(
ret
==
SCARD_S_SUCCESS
,
"got %lx
\n
"
,
ret
);
ok
(
states
[
1
].
cbAtr
<=
sizeof
(
states
[
1
].
rgbAtr
),
"got %lu
\n
"
,
states
[
1
].
cbAtr
);
states
[
1
].
dwCurrentState
=
states
[
1
].
dwEventState
&
~
SCARD_STATE_CHANGED
;
ret
=
SCardGetStatusChangeA
(
context
,
1000
,
states
,
2
);
todo_wine
ok
(
ret
==
SCARD_S_SUCCESS
,
"got %lx
\n
"
,
ret
);
ok
(
ret
==
SCARD_S_SUCCESS
,
"got %lx
\n
"
,
ret
);
ret
=
SCardConnectA
(
context
,
readers
,
SCARD_SHARE_SHARED
,
SCARD_PROTOCOL_Tx
,
&
connect
,
NULL
);
if
(
ret
==
SCARD_E_READER_UNAVAILABLE
)
...
...
dlls/winscard/winscard.c
View file @
88f4dabc
...
...
@@ -569,14 +569,11 @@ done:
static
LONG
map_states_inA
(
const
SCARD_READERSTATEA
*
src
,
struct
reader_state
*
dst
,
DWORD
count
)
{
DWORD
i
;
memset
(
dst
,
0
,
sizeof
(
*
dst
)
*
count
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
src
[
i
].
szReader
&&
ansi_to_utf8
(
src
[
i
].
szReader
,
(
char
**
)
&
dst
[
i
].
reader
)
<
0
)
return
SCARD_E_NO_MEMORY
;
dst
[
i
].
current_state
=
src
[
i
].
dwCurrentState
;
dst
[
i
].
event_state
=
src
[
i
].
dwEventState
;
dst
[
i
].
atr_size
=
src
[
i
].
cbAtr
;
memcpy
(
dst
[
i
].
atr
,
src
[
i
].
rgbAtr
,
src
[
i
].
cbAtr
);
}
return
SCARD_S_SUCCESS
;
}
...
...
@@ -635,14 +632,11 @@ LONG WINAPI SCardGetStatusChangeA( SCARDCONTEXT context, DWORD timeout, SCARD_RE
static
LONG
map_states_inW
(
SCARD_READERSTATEW
*
src
,
struct
reader_state
*
dst
,
DWORD
count
)
{
DWORD
i
;
memset
(
dst
,
0
,
sizeof
(
*
dst
)
*
count
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
src
[
i
].
szReader
&&
utf16_to_utf8
(
src
[
i
].
szReader
,
(
char
**
)
&
dst
[
i
].
reader
)
<
0
)
return
SCARD_E_NO_MEMORY
;
dst
[
i
].
current_state
=
src
[
i
].
dwCurrentState
;
dst
[
i
].
event_state
=
src
[
i
].
dwEventState
;
dst
[
i
].
atr_size
=
src
[
i
].
cbAtr
;
memcpy
(
dst
[
i
].
atr
,
src
[
i
].
rgbAtr
,
src
[
i
].
cbAtr
);
}
return
SCARD_S_SUCCESS
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment