Deletes any now-superfluous `const NAME: &'static str = "name";` definitions.
This gives a path to the function that is being called, which is useful
for debugging errors. It replaces the necessity of implementing
`const NAME: &'static str = "name";` in every function that wants to
use these macros (or coming up with a custom context).
mstsc does not display bitmap update, for some reason. Using
SetSurfaceBits instead solves it, and is required for more advanced codecs.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Those flags are set both by client and server. Even if the server
doesn't send those commands yet, this should be supported by most
clients.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Use u16 since that's the limit for resolution and bitmap data.
Use non-zero types for width & height, to avoid various issues, such as
division by zero.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
The fragment index is not correctly updated, staying at 0, making
invalid series of First/First/..Last.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Since FreeRDP commit
7cef0cb8d6cfc2307af967a851f44ad6c376a24d ("Refactored capability
parsing"), protocol version default to 0. This is probably an issue
there, but IronRDP can also be tolerant here...
Add a new "protocol_version" field in the General capability structure,
so that client code can check the version and report an error if they
need to.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This allows to simplify some user code, and let us introduce a
"protocol_version" field in the next patch without having to explicitly
set its value but rely on the default instead.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
- Add a new `UnsupportedPdu` kind to `PduError`, enhancing error handling capabilities in ironrdp-pdu.
This new error kind allows for more specific error messages when encountering unsupported PDUs.
- Implement a macro `unsupported_pdu_err` for conveniently creating `PduError` instances with the `UnsupportedPdu` kind.
- Implement handling for `ServerDriveLockControlRequest` in ironrdp-rdpdr, including the definition of
the struct and its decoding method. This adds support for processing lock control requests in the RDPDR protocol.
- Update `Rdpdr`'s `process` method to utilize the new `unsupported_pdu_err` when encountering unknown packet IDs, replacing the previous handling of unimplemented PDUs.
- Remove the `Unimplemented` variant from `RdpdrPdu` and `Component` enums, replacing it with `EmptyResponse` in `RdpdrPdu`.
This change streamlines the handling of unimplemented or unexpected PDUs.
- Enhance `FileInformationClass` and `FileInformationClassLevel` with `Display` implementations, providing better logging and error message capabilities.
- Extend ReadCursor with methods to read and try reading i64 values in both little and big endian formats.
- Update RdpdrPdu to handle ClientDriveSetInformationResponse, reflecting the addition of ServerDriveSetInformationRequest handling in the RDPDR (Remote Desktop Protocol: Device Redirection) protocol.
- Implement decoding and encoding of various FileInformationClass types such as FileEndOfFileInformation, FileDispositionInformation, FileRenameInformation, and FileAllocationInformation.
- Refactor the existing code to improve the handling of different FileInformationClassLevels and FileSystemInformationClassLevels.
- Add handling for ServerDriveNotifyChangeDirectoryRequest in ServerDriveIoRequest, supporting the specific case when MinorFunction is set to IRP_MN_NOTIFY_CHANGE_DIRECTORY.