33719d24ce
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. |
||
---|---|---|
.. | ||
include | ||
libwinpr | ||
test | ||
tools | ||
.gitignore | ||
CMakeLists.txt | ||
winpr.pc.in | ||
WinPRConfig.cmake.in | ||
wlog.7 |