-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SetInformation
and UnsupportedMinorFunctionRequest
#312
Conversation
- 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.
… functions in ServerDriveIoRequest - Add a 'discard' method to ReadCursor in ironrdp-pdu, which advances the cursor by the remaining length of the buffer. This method aids in efficiently skipping over unused data. - Modify ServerDriveIoRequest in ironrdp-rdpdr to handle unsupported minor functions. Instead of returning an error for an unsupported minor function, the new approach discards the remaining data and returns a special 'UnsupportedMinorFunctionRequest' type. This change allows for more flexible handling of unsupported functions by upstream logic
Coverage Report 🤖 ⚙️Past: New: Diff: -0.47% [this comment will be updated automatically] |
👍
I expressed my concern about the new variant in the comment above, but I’m okay with this if this is really simpler for your use case. self.backend.handle_drive_io_request(req)?; But I don’t know how it’s actually handled in your backend. Maybe this callback is really required for other kind of manual clean up. (In this case I would suggest documenting a bit more the trait, just to make sure we don’t accidentally break your assumption later.) EDIT: Upon reading further, I understand that indeed you likely need this callback for closing the underlying resource. |
- Remove the 'discard' method from ReadCursor in ironrdp-pdu. - Refactor MinorFunction in DeviceIoRequest from an enum to a struct with constants, simplifying its representation and usage. - Add handling for ServerDriveNotifyChangeDirectoryRequest in ServerDriveIoRequest, supporting the specific case when MinorFunction is set to IRP_MN_NOTIFY_CHANGE_DIRECTORY. - Update decoding logic in DeviceIoRequest to directly convert the minor function value from u32 to MinorFunction without conditional checks, simplifying the code. - Remove handling of unsupported minor functions, as the new approach directly supports all minor function values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. This looks good to me. Approving and enabling auto-merge.
For some reason CI is failing with an error at the fuzzing step, but I don’t see how your code could be the reason for that. 🤔
@CBenoit it's passing for me locally |
Update the Cargo.lock files to reflect the changes
SetInformation
is straightforward.UnsupportedMinorFunctionRequest
because I realized that the server is liable to send us back an occasionalNotifyChangeDirectory
orNone
which we want to handle. This allows us to handle these cases gracefully (but without writing all the decode/encode logic), and kicks the handling up the stack to theRdpdrBackend
implementer (Teleport in our case). Teleport simply mimics what FreeRDP currently does with these.