24 #ifndef FREERDP_CHANNEL_SMARTCARD_CLIENT_PACK_H
25 #define FREERDP_CHANNEL_SMARTCARD_CLIENT_PACK_H
27 #include <winpr/crt.h>
28 #include <winpr/stream.h>
29 #include <winpr/smartcard.h>
31 #include <freerdp/api.h>
32 #include <freerdp/channels/scard.h>
34 #define SMARTCARD_COMMON_TYPE_HEADER_LENGTH 8
35 #define SMARTCARD_PRIVATE_TYPE_HEADER_LENGTH 8
42 FREERDP_API LONG smartcard_pack_write_size_align(
wStream* s,
size_t size, UINT32 alignment);
43 FREERDP_API LONG smartcard_unpack_read_size_align(
wStream* s,
size_t size, UINT32 alignment);
45 FREERDP_API SCARDCONTEXT smartcard_scard_context_native_from_redir(
REDIR_SCARDCONTEXT* context);
47 SCARDCONTEXT hContext);
49 FREERDP_API SCARDHANDLE smartcard_scard_handle_native_from_redir(
REDIR_SCARDHANDLE* handle);
50 FREERDP_API
void smartcard_scard_handle_native_to_redir(
REDIR_SCARDHANDLE* handle,
53 FREERDP_API LONG smartcard_unpack_common_type_header(
wStream* s);
54 FREERDP_API
void smartcard_pack_common_type_header(
wStream* s);
56 FREERDP_API LONG smartcard_unpack_private_type_header(
wStream* s);
57 FREERDP_API
void smartcard_pack_private_type_header(
wStream* s, UINT32 objectBufferLength);
59 FREERDP_API LONG smartcard_unpack_establish_context_call(
wStream* s,
62 FREERDP_API LONG smartcard_pack_establish_context_return(
wStream* s,
68 FREERDP_API
void smartcard_trace_long_return(
const Long_Return* ret,
const char* name);
70 FREERDP_API LONG smartcard_unpack_list_reader_groups_call(
wStream* s,
74 FREERDP_API LONG smartcard_pack_list_reader_groups_return(
wStream* s,
90 FREERDP_API LONG smartcard_unpack_context_and_string_a_call(
wStream* s,
93 FREERDP_API LONG smartcard_unpack_context_and_string_w_call(
wStream* s,
114 FREERDP_API LONG smartcard_unpack_hcard_and_disposition_call(
wStream* s,
118 FREERDP_API LONG smartcard_unpack_get_status_change_a_call(
wStream* s,
121 FREERDP_API LONG smartcard_unpack_get_status_change_w_call(
wStream* s,
124 FREERDP_API LONG smartcard_pack_get_status_change_return(
wStream* s,
131 FREERDP_API LONG smartcard_unpack_status_call(
wStream* s,
Status_Call* call, BOOL unicode);
139 DWORD dwAttrId, DWORD cbAttrCallLen);
151 FREERDP_API LONG smartcard_unpack_locate_cards_by_atr_a_call(
wStream* s,
154 FREERDP_API LONG smartcard_unpack_locate_cards_by_atr_w_call(
wStream* s,
167 FREERDP_API LONG smartcard_unpack_get_transmit_count_call(
wStream* s,
169 FREERDP_API LONG smartcard_pack_get_transmit_count_return(
wStream* s,
173 FREERDP_API LONG smartcard_pack_get_reader_icon_return(
wStream* s,
176 FREERDP_API LONG smartcard_unpack_get_device_type_id_call(
wStream* s,
179 FREERDP_API LONG smartcard_pack_device_type_id_return(
wStream* s,