Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7de85fc6
Commit
7de85fc6
authored
Feb 16, 2023
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winscard: Implement SCardGet/SetAttrib().
parent
c53a2044
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
2 deletions
+77
-2
unixlib.c
dlls/winscard/unixlib.c
+16
-0
unixlib.h
dlls/winscard/unixlib.h
+18
-0
winscard.c
dlls/winscard/winscard.c
+41
-0
winscard.spec
dlls/winscard/winscard.spec
+2
-2
No files found.
dlls/winscard/unixlib.c
View file @
7de85fc6
...
...
@@ -46,6 +46,8 @@ LONG SCardBeginTransaction( UINT64 );
LONG
SCardEndTransaction
(
UINT64
,
UINT64
);
LONG
SCardTransmit
(
UINT64
,
const
struct
io_request
*
,
const
BYTE
*
,
UINT64
,
struct
io_request
*
,
BYTE
*
,
UINT64
*
);
LONG
SCardControl
(
UINT64
,
UINT64
,
const
void
*
,
UINT64
,
void
*
,
UINT64
,
UINT64
*
);
LONG
SCardGetAttrib
(
UINT64
,
UINT64
,
BYTE
*
,
UINT64
*
);
LONG
SCardSetAttrib
(
UINT64
,
UINT64
,
const
BYTE
*
,
UINT64
);
static
NTSTATUS
scard_establish_context
(
void
*
args
)
{
...
...
@@ -142,6 +144,18 @@ static NTSTATUS scard_control( void *args )
params
->
out_buflen
,
params
->
ret_len
);
}
static
NTSTATUS
scard_get_attrib
(
void
*
args
)
{
struct
scard_get_attrib_params
*
params
=
args
;
return
SCardGetAttrib
(
params
->
handle
,
params
->
id
,
params
->
attr
,
params
->
attr_len
);
}
static
NTSTATUS
scard_set_attrib
(
void
*
args
)
{
struct
scard_set_attrib_params
*
params
=
args
;
return
SCardSetAttrib
(
params
->
handle
,
params
->
id
,
params
->
attr
,
params
->
attr_len
);
}
const
unixlib_entry_t
__wine_unix_call_funcs
[]
=
{
scard_establish_context
,
...
...
@@ -159,4 +173,6 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
scard_end_transaction
,
scard_transmit
,
scard_control
,
scard_get_attrib
,
scard_set_attrib
,
};
dlls/winscard/unixlib.h
View file @
7de85fc6
...
...
@@ -149,6 +149,22 @@ struct scard_control_params
UINT64
*
ret_len
;
};
struct
scard_get_attrib_params
{
UINT64
handle
;
UINT64
id
;
void
*
attr
;
UINT64
*
attr_len
;
};
struct
scard_set_attrib_params
{
UINT64
handle
;
UINT64
id
;
const
void
*
attr
;
UINT64
attr_len
;
};
enum
winscard_funcs
{
unix_scard_establish_context
,
...
...
@@ -166,4 +182,6 @@ enum winscard_funcs
unix_scard_end_transaction
,
unix_scard_transmit
,
unix_scard_control
,
unix_scard_get_attrib
,
unix_scard_set_attrib
,
};
dlls/winscard/winscard.c
View file @
7de85fc6
...
...
@@ -847,6 +847,47 @@ LONG WINAPI SCardControl( SCARDHANDLE connect, DWORD code, const void *in_buf, D
return
ret
;
}
LONG
WINAPI
SCardGetAttrib
(
SCARDHANDLE
connect
,
DWORD
id
,
BYTE
*
attr
,
DWORD
*
attr_len
)
{
struct
handle
*
handle
=
(
struct
handle
*
)
connect
;
struct
scard_get_attrib_params
params
;
UINT64
attr_len64
;
LONG
ret
;
TRACE
(
"%Ix, %#lx, %p, %p
\n
"
,
connect
,
id
,
attr
,
attr_len
);
if
(
!
handle
||
handle
->
magic
!=
CONNECT_MAGIC
)
return
ERROR_INVALID_HANDLE
;
if
(
!
attr_len
)
return
SCARD_E_INVALID_PARAMETER
;
params
.
handle
=
handle
->
unix_handle
;
params
.
id
=
id
;
params
.
attr
=
attr
;
attr_len64
=
*
attr_len
;
params
.
attr_len
=
&
attr_len64
;
if
(
!
(
ret
=
UNIX_CALL
(
scard_get_attrib
,
&
params
)))
*
attr_len
=
attr_len64
;
TRACE
(
"returning %#lx
\n
"
,
ret
);
return
ret
;
}
LONG
WINAPI
SCardSetAttrib
(
SCARDHANDLE
connect
,
DWORD
id
,
const
BYTE
*
attr
,
DWORD
attr_len
)
{
struct
handle
*
handle
=
(
struct
handle
*
)
connect
;
struct
scard_set_attrib_params
params
;
LONG
ret
;
TRACE
(
"%Ix, %#lx, %p, %lu
\n
"
,
connect
,
id
,
attr
,
attr_len
);
if
(
!
handle
||
handle
->
magic
!=
CONNECT_MAGIC
)
return
ERROR_INVALID_HANDLE
;
params
.
handle
=
handle
->
unix_handle
;
params
.
id
=
id
;
params
.
attr
=
attr
;
params
.
attr_len
=
attr_len
;
ret
=
UNIX_CALL
(
scard_set_attrib
,
&
params
);
TRACE
(
"returning %#lx
\n
"
,
ret
);
return
ret
;
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hinst
,
DWORD
reason
,
void
*
reserved
)
{
switch
(
reason
)
...
...
dlls/winscard/winscard.spec
View file @
7de85fc6
...
...
@@ -20,7 +20,7 @@
@ stub SCardForgetReaderGroupW
@ stub SCardForgetReaderW
@ stub SCardFreeMemory
@ st
ub SCardGetAttrib
@ st
dcall SCardGetAttrib(long long ptr ptr)
@ stub SCardGetCardTypeProviderNameA
@ stub SCardGetCardTypeProviderNameW
@ stub SCardGetProviderIdA
...
...
@@ -51,7 +51,7 @@
@ stdcall SCardReleaseStartedEvent()
@ stub SCardRemoveReaderFromGroupA
@ stub SCardRemoveReaderFromGroupW
@ st
ub SCardSetAttrib
@ st
dcall SCardSetAttrib(long long ptr long)
@ stub SCardSetCardTypeProviderNameA
@ stub SCardSetCardTypeProviderNameW
@ stub SCardState
...
...
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