Commit Graph

189 Commits

Author SHA1 Message Date
akallabeth
54847499e9 [winpr,collections] fix ListDictionary New/Free handling 2023-06-27 15:05:43 +02:00
Armin Novak
e1eacad74c [scard] fixed memory leak
card_id_and_name_* return allocated values, free after use
2022-12-02 15:08:09 +01:00
Armin Novak
58bc1ee4c9 [smartcard] fix multi string conversion 2022-12-02 15:08:09 +01:00
Armin Novak
0091f72761 [winpr,smartcard] fix PCSC_SCardListReaders 2022-12-02 15:08:09 +01:00
akallabeth
6014efc19b [winpr,smartcart] simplified casts 2022-11-28 10:42:36 +01:00
akallabeth
7bf8b46726 [smartcard] Use multistring convertion functions 2022-11-28 10:42:36 +01:00
akallabeth
5799fb2018 Replace ConvertFromUnicode and ConvertToUnicode
* Use new ConvertUtf8ToWChar, ConvertUtf8NToWChar,
  ConvertUtf8ToWCharAlloc and ConvertUtf8NToWCharAlloc
* Use new ConvertWCharToUtf8, ConvertWCharNToUtf8,
  ConvertWCharToUtf8Alloc and ConvertWCharNToUtf8Alloc
* Use new Stream UTF16 to/from UTF8 read/write functions
* Use new settings UTF16 to/from UTF8 read/write functions
2022-11-28 10:42:36 +01:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
akallabeth
f25261e271 Unifiy string append functions 2022-06-17 08:41:46 +02:00
akallabeth
962c5c3ef0 Fixed dead store warnings 2022-04-28 12:37:19 +02:00
Armin Novak
6ed50b4b1d Refactored WinPR includes 2022-03-03 11:26:48 +01:00
akallabeth
8cc6582044
Unify struct definitions (#7633)
* Unified enum/struct definitions, fixed include issues

* Fixed mac compilation issues

* Added missing include

* Fixed windows server build warnings

* Fixed VS2010 build issue

* Removed unnecessary library linking

* Fixed ThreadPool WinXP compatibility

* Fixed pr review remarks
2022-02-14 14:59:22 +01:00
David Fort
06cb610207 smartcard: start implementing SCardListCards
This basic implementation tries to emulate the corresponding function by using a
predefined list of name for a given ATR.
2022-01-17 16:27:53 +01:00
akallabeth
8c543b1de2 Added smartcard emulation layer 2022-01-11 12:34:43 +01:00
Armin Novak
fbae9ba88c Added LoadLibraryX and LoadLibraryExX
These functions take a UTF8 string and load a library with
LoadLibraryW under windows.
2021-09-03 08:29:15 +02:00
Armin Novak
4dfee30934 Fixed smartcard related warnings 2021-06-18 11:32:16 +02:00
Armin Novak
09cf11ecf0 WinPR: Fixed warnings, added assertions 2021-06-18 11:32:16 +02:00
Armin Novak
64280aa13c Added WINPR_ASSERT to collections 2021-06-16 11:46:42 +02:00
Armin Novak
31862e60f9 Added missing return checks 2021-06-16 11:46:42 +02:00
Armin Novak
880c603c26 Renamed HashTable_Add to HashTable_Insert
* Since the changes break HashTable_Add rename it so that it will
  not fail silently
2021-06-16 11:46:42 +02:00
Armin Novak
cb642699c8 Modified HashTable API to be opaque
* Reuse wObject function pointers
* Add missing getters/setters
* Clean up return types, const correctness of arguments
2021-06-16 11:46:42 +02:00
sss
6574fdf6e4 reverted changes from clang-format 2021-02-25 14:05:40 +01:00
Gluzskiy Alexandr
bee2e1526d allow to use in single threaded mode
(some client side channels and all server side channels still need to be
ported to new api)

server: build fix, do not disable threads for rfx encoder

cliprdr client channel: implemented support for DisableThreads option
looks like thread does not make sense at all for this channel

do not initialize disabled image codecs (respect settings)

channels: client: rail: added support for DisableThreads setting

changed "BOOL DisableThreads" to "UINT32 ThreadingFlags"
dropped unnecessary apu changes

draft implementation of threading settings aware message handling api
for addins/channels

rail: use new messaging api

fixed memory leak

msgs handlers external api changes (as requested)

msgs_handlers: init fix

fixed memory leak

logic fix

resolved problems appeared after rebase to master, dropped unnecessary
changes

git clang-format origin/master

fixed TestFreeRDPCodecRemoteFX.c

"formatting, run `clang-format` please"

properly use new "rfx_context_new(BOOL, UINT32)" everywhere

passed Threading Flags to "rfx_context_new" where available

in older C standarts veriables declaration must be done before any code

requested changes

clang-format as requested

use broken signatures of standert C functions for m$ s**tos

clang-format

requested changes

requested changes

moved ThreadingFlags to stable api zone

define type for channel msg handler

typo fix

clang-format

build fix

us ThreadingFlags from server settings

git clang-format origin/master

clang-format
2021-02-25 14:05:40 +01:00
Armin Novak
7b211e5258 Fixed #6821: _stricmp does not like NULL strings 2021-02-17 16:45:56 +01:00
akallabeth
bad20340cc Fixed issue with GetAttr where the result buffer was not allocated 2021-02-10 10:36:51 +01:00
akallabeth
8217f5a9e3 Fixed SCardTransmit return 2021-02-10 10:36:51 +01:00
akallabeth
9ff0071b2e Fixed SCardState wrapper 2021-02-10 10:36:51 +01:00
akallabeth
6cf5ba4736 Unified smartcard handle converstion 2021-02-10 10:36:51 +01:00
akallabeth
a4bf477cca Fixed double free in PCSC_SCardGetAttrib_FriendlyName 2021-02-10 10:36:51 +01:00
akallabeth
cf2d26dbbd Fix length return for SCARD_ATTR_VENDOR_NAME 2021-01-27 23:29:09 +01:00
Armin Novak
17d8267de7 Fixed PCSC_SCardGetAttrib wrapper 2021-01-27 23:03:48 +01:00
Armin Novak
816e792e3f Fixed unit tests run under memory sanitizer 2020-09-07 10:42:28 +02:00
akallabeth
7890833af8 Replaced strtok with strtok_s 2020-05-18 11:39:22 +02:00
Alex Wilson
40f23e2728 SCardReadCache/SCardWriteCache should actually cache data
Currently since the hash/keyCompare/keyClone members on the
context->cache were never being set, we were using the
HashTable_Pointer* variants, meaning that lookup always
failed (since we never ask for the same *pointer* twice).

This also revealed that the logic for autoallocate on these ops
was a bit backwards, and some error codes and support for the
"freshness" counter were missing.

In Win10 (at least with some card minidrivers) the freshness
counter is load-bearing and smartcard login won't work without
implementing a very basic version of it.
2020-04-21 08:11:54 +02:00
Armin Novak
aa441d3238 Log smartcard to stdout. 2020-02-20 15:24:03 +01:00
Armin Novak
959be9d946 Fixed warnings in pcsc layer 2020-02-20 14:03:29 +01:00
Armin Novak
fa10dfa186 Fixed memory leaks in PCSC_SCardReadCache[AW] 2020-02-20 13:59:28 +01:00
Armin Novak
f885476423 Fixed 8bit and 16bit return string sizes. 2020-02-20 13:59:28 +01:00
Armin Novak
ef93109f42 Fixes for GetAttrib and some refactroing
* Fix accidental buffer free before transfer
* Refactored code to eliminate a bunch of warnings
* Updated copyright headers
2020-02-20 13:59:28 +01:00
Armin Novak
f0f476c7d5 Fixed pcsc function pointer casts. 2020-02-20 13:59:28 +01:00
Armin Novak
2acce6214c SCardFreeMemory non const argument. 2020-02-20 13:59:28 +01:00
Armin Novak
37e850cb24 Cleaned up smartcard pcsc wrapper. 2020-02-20 13:59:28 +01:00
Armin Novak
30983f4049 Cleaned up smartcard inspect. 2020-02-20 13:59:28 +01:00
Armin Novak
c98b3e0cef Added debug log messages for SCARD_E_NO_SERVICE
Log where and what caused SCARD_E_NO_SERVICE return in smartcard
wrapper
2020-01-09 08:20:42 +01:00
Martin Fleisz
71feb974ac
Merge pull request #5739 from akallabeth/improve_function_hiding
Improve function hiding
2019-12-02 11:31:35 +01:00
Armin Novak
7c243da6e1 Remove symbols exported by accident. 2019-12-02 10:57:31 +01:00
Armin Novak
708a28d8dd Do not export functions that are purely internal. 2019-11-20 11:08:02 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Bernhard Miklautz
f867c90e4c
Merge pull request #5308 from akallabeth/fix_win32_overlinking
Fixed windows overlinking.
2019-05-03 12:01:51 +02:00
Armin Novak
70e37746cb Fixed sign-compare warnings 2019-04-05 09:13:25 +02:00