FreeRDP
smartcard_pack.h
1 
24 #ifndef FREERDP_CHANNEL_SMARTCARD_CLIENT_PACK_H
25 #define FREERDP_CHANNEL_SMARTCARD_CLIENT_PACK_H
26 
27 #include <winpr/crt.h>
28 #include <winpr/stream.h>
29 #include <winpr/smartcard.h>
30 
31 #include <freerdp/api.h>
32 #include <freerdp/channels/scard.h>
33 
34 #define SMARTCARD_COMMON_TYPE_HEADER_LENGTH 8
35 #define SMARTCARD_PRIVATE_TYPE_HEADER_LENGTH 8
36 
37 #ifdef __cplusplus
38 extern "C"
39 {
40 #endif
41 
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);
44 
45  FREERDP_API SCARDCONTEXT smartcard_scard_context_native_from_redir(REDIR_SCARDCONTEXT* context);
46  FREERDP_API void smartcard_scard_context_native_to_redir(REDIR_SCARDCONTEXT* context,
47  SCARDCONTEXT hContext);
48 
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,
51  SCARDHANDLE hCard);
52 
53  FREERDP_API LONG smartcard_unpack_common_type_header(wStream* s);
54  FREERDP_API void smartcard_pack_common_type_header(wStream* s);
55 
56  FREERDP_API LONG smartcard_unpack_private_type_header(wStream* s);
57  FREERDP_API void smartcard_pack_private_type_header(wStream* s, UINT32 objectBufferLength);
58 
59  FREERDP_API LONG smartcard_unpack_establish_context_call(wStream* s,
60  EstablishContext_Call* call);
61 
62  FREERDP_API LONG smartcard_pack_establish_context_return(wStream* s,
63  const EstablishContext_Return* ret);
64 
65  FREERDP_API LONG smartcard_unpack_context_call(wStream* s, Context_Call* call,
66  const char* name);
67 
68  FREERDP_API void smartcard_trace_long_return(const Long_Return* ret, const char* name);
69 
70  FREERDP_API LONG smartcard_unpack_list_reader_groups_call(wStream* s,
72  BOOL unicode);
73 
74  FREERDP_API LONG smartcard_pack_list_reader_groups_return(wStream* s,
75  const ListReaderGroups_Return* ret,
76  BOOL unicode);
77 
78  FREERDP_API LONG smartcard_unpack_list_readers_call(wStream* s, ListReaders_Call* call,
79  BOOL unicode);
80 
81  FREERDP_API LONG smartcard_pack_list_readers_return(wStream* s, const ListReaders_Return* ret,
82  BOOL unicode);
83 
84  FREERDP_API LONG
85  smartcard_unpack_context_and_two_strings_a_call(wStream* s, ContextAndTwoStringA_Call* call);
86 
87  FREERDP_API LONG
88  smartcard_unpack_context_and_two_strings_w_call(wStream* s, ContextAndTwoStringW_Call* call);
89 
90  FREERDP_API LONG smartcard_unpack_context_and_string_a_call(wStream* s,
92 
93  FREERDP_API LONG smartcard_unpack_context_and_string_w_call(wStream* s,
95 
96  FREERDP_API LONG smartcard_unpack_locate_cards_a_call(wStream* s, LocateCardsA_Call* call);
97 
98  FREERDP_API LONG smartcard_pack_locate_cards_return(wStream* s, const LocateCards_Return* ret);
99 
100  FREERDP_API LONG smartcard_unpack_locate_cards_w_call(wStream* s, LocateCardsW_Call* call);
101 
102  FREERDP_API LONG smartcard_pack_locate_cards_w_return(wStream* s, const LocateCardsW_Call* ret);
103 
104  FREERDP_API LONG smartcard_unpack_connect_a_call(wStream* s, ConnectA_Call* call);
105 
106  FREERDP_API LONG smartcard_unpack_connect_w_call(wStream* s, ConnectW_Call* call);
107 
108  FREERDP_API LONG smartcard_pack_connect_return(wStream* s, const Connect_Return* ret);
109 
110  FREERDP_API LONG smartcard_unpack_reconnect_call(wStream* s, Reconnect_Call* call);
111 
112  FREERDP_API LONG smartcard_pack_reconnect_return(wStream* s, const Reconnect_Return* ret);
113 
114  FREERDP_API LONG smartcard_unpack_hcard_and_disposition_call(wStream* s,
116  const char* name);
117 
118  FREERDP_API LONG smartcard_unpack_get_status_change_a_call(wStream* s,
119  GetStatusChangeA_Call* call);
120 
121  FREERDP_API LONG smartcard_unpack_get_status_change_w_call(wStream* s,
122  GetStatusChangeW_Call* call);
123 
124  FREERDP_API LONG smartcard_pack_get_status_change_return(wStream* s,
125  const GetStatusChange_Return* ret,
126  BOOL unicode);
127 
128  FREERDP_API LONG smartcard_unpack_state_call(wStream* s, State_Call* call);
129  FREERDP_API LONG smartcard_pack_state_return(wStream* s, const State_Return* ret);
130 
131  FREERDP_API LONG smartcard_unpack_status_call(wStream* s, Status_Call* call, BOOL unicode);
132 
133  FREERDP_API LONG smartcard_pack_status_return(wStream* s, const Status_Return* ret,
134  BOOL unicode);
135 
136  FREERDP_API LONG smartcard_unpack_get_attrib_call(wStream* s, GetAttrib_Call* call);
137 
138  FREERDP_API LONG smartcard_pack_get_attrib_return(wStream* s, const GetAttrib_Return* ret,
139  DWORD dwAttrId, DWORD cbAttrCallLen);
140 
141  FREERDP_API LONG smartcard_unpack_set_attrib_call(wStream* s, SetAttrib_Call* call);
142 
143  FREERDP_API LONG smartcard_unpack_control_call(wStream* s, Control_Call* call);
144 
145  FREERDP_API LONG smartcard_pack_control_return(wStream* s, const Control_Return* ret);
146 
147  FREERDP_API LONG smartcard_unpack_transmit_call(wStream* s, Transmit_Call* call);
148 
149  FREERDP_API LONG smartcard_pack_transmit_return(wStream* s, const Transmit_Return* ret);
150 
151  FREERDP_API LONG smartcard_unpack_locate_cards_by_atr_a_call(wStream* s,
152  LocateCardsByATRA_Call* call);
153 
154  FREERDP_API LONG smartcard_unpack_locate_cards_by_atr_w_call(wStream* s,
155  LocateCardsByATRW_Call* call);
156 
157  FREERDP_API LONG smartcard_unpack_read_cache_a_call(wStream* s, ReadCacheA_Call* call);
158 
159  FREERDP_API LONG smartcard_unpack_read_cache_w_call(wStream* s, ReadCacheW_Call* call);
160 
161  FREERDP_API LONG smartcard_pack_read_cache_return(wStream* s, const ReadCache_Return* ret);
162 
163  FREERDP_API LONG smartcard_unpack_write_cache_a_call(wStream* s, WriteCacheA_Call* call);
164 
165  FREERDP_API LONG smartcard_unpack_write_cache_w_call(wStream* s, WriteCacheW_Call* call);
166 
167  FREERDP_API LONG smartcard_unpack_get_transmit_count_call(wStream* s,
168  GetTransmitCount_Call* call);
169  FREERDP_API LONG smartcard_pack_get_transmit_count_return(wStream* s,
170  const GetTransmitCount_Return* call);
171 
172  FREERDP_API LONG smartcard_unpack_get_reader_icon_call(wStream* s, GetReaderIcon_Call* call);
173  FREERDP_API LONG smartcard_pack_get_reader_icon_return(wStream* s,
174  const GetReaderIcon_Return* ret);
175 
176  FREERDP_API LONG smartcard_unpack_get_device_type_id_call(wStream* s,
177  GetDeviceTypeId_Call* call);
178 
179  FREERDP_API LONG smartcard_pack_device_type_id_return(wStream* s,
180  const GetDeviceTypeId_Return* ret);
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #endif /* FREERDP_CHANNEL_SMARTCARD_CLIENT_PACK_H */