FreeRDP/winpr
ilammy 33719d24ce wClipboard/posix: implement file size retrieval
This is an example of wClipboardDelegate method implementation. POSIX
subsystem uses synchronous methods, but the interface can be used for
asynchronous request processing as well. The client should call a
Client* callback to request some action and the wClipboard will process
the request and report the result by calling an approriate Clipboard*
callback. Usually there will be two callbacks: one for reporting success
and one to report errors.

All callbacks have at least two arguments: the wClipboardDelegate itself
to pass the system context, and the wClipboard*Request structure with
the arguments to pass the call context. The request context is also
passed to the result callbacks by wClipboard so that the client can
match up the result with its previous request.

The fields of wClipboard*Request structures are heavily influenced by
the MS-RDPECLIP spec and mirror the respective fields of
CLIPRDR_FILECONTENTS_REQUEST. wClipboard should not depend on
MS-RDPECLIP, that's the reason we don't use CLIPRDR_FILECONTENTS_REQUEST
directly. However, I believe that we should not have void* fields in the
request structs so that they can be easily copied around if needed.
This is why have the weird 'streamId' field there which has nothing to
do with wClipboard and will be used only by the clients when sending
replies to the server.

Return values of the callbacks are to be used for reporting errors with
processing the request or reply per se, not for errors encountered while
performing the action requested. Thus, for example, we return NO_ERROR
from posix_file_request_size() even when we fail to report the result to
the client, because we have successfully performed the request and do
not care if the client could not handle our reply for some reason.

Also note that setup_delegate() fills in dummy implementations of
Clipboard* reply callbacks so that we do not crash in case the client
does not fill them and do not have to perform paranoid NULL checks
before calling every single callback.
2017-04-09 03:15:49 +03:00
..
include wClipboard/posix: implement file size retrieval 2017-04-09 03:15:49 +03:00
libwinpr wClipboard/posix: implement file size retrieval 2017-04-09 03:15:49 +03:00
test fix string format specifiers 2016-12-16 13:48:43 +01:00
tools Fixed tests and dead store warnings. 2017-03-28 16:49:56 +02:00
.gitignore Add library libwinpr-tools 2016-05-03 14:42:08 +02:00
CMakeLists.txt Install man pages 2017-01-16 11:34:32 +01:00
winpr.pc.in Include major version number in library names 2017-01-16 11:11:58 +01:00
WinPRConfig.cmake.in build: remove FREERDP_MONOLITHIC_BUILD 2016-01-12 17:32:32 +01:00
wlog.7 Fix issues in wlog man page 2016-12-01 15:36:31 +01:00