-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Improve ClientDriveQueryDirectoryResponse.encode()
#12912
Merged
ibeckermayer
merged 139 commits into
windows-desktop-directory-sharing
from
isaiah/fix-query-dir-resp-encode
Jun 29, 2022
Merged
Changes from all commits
Commits
Show all changes
139 commits
Select commit
Hold shift + click to select a range
24c1a90
Creates a general vchan Client that can read chunked messages. rdpdr …
41ac367
Tidying up
58cac52
Merge branch 'master' into isaiah/reuse-vchan-read
fa3531f
small fixes
ab4d66d
Merge branch 'master' into isaiah/reuse-vchan-read
aaa8369
fixes linting errors
54b7e3d
Merge branch 'master' into isaiah/reuse-vchan-read
071620b
Merge branch 'master' into isaiah/reuse-vchan-read
52a3d5d
Merge branch 'master' into isaiah/reuse-vchan-read
ceddf84
Adds drive redirection capability set to the Client Core Capability R…
6baccf6
Adds the ClientDeviceListAnnounce message, plus some prototype code t…
9036618
Adds to_unicode util
770f6e7
refactor of vchan and rdpdr to use it
17a35e8
refactors cliprdr to use generalized vchan header and chunking
c946b52
nits
787b67e
Merge branch 'master' into isaiah/reuse-vchan-write
6cd9ac2
small fixes from CR
997b7d6
Merge branch 'master' into isaiah/reuse-vchan-write
eb8ed1a
Merge branch 'isaiah/reuse-vchan-write' into isaiah/mock-drive-redire…
54b53d0
A right click sends an ClientDeviceListAnnounce message and the rdp c…
8f1ead3
adds prototype logic for handling IRP_MJ_QUERY_INFORMATION and IRP_MJ…
9a88738
removes some un needed comments. the link to the documentation is eno…
fb60ebb
Successfully mocks a drive for redirection
51f83e5
adding important todo
b4192a6
removes unneeded pub decl
6cf694a
refactors rdpdr into its own self-contained folder module
fa0d555
moving scard into rdpdr
4b9c330
allowing dead code
66eb895
stubs out request_file_info
687b84c
fixes mismatched declaration
058530b
completes IRP_MJ_DEVICE_CONTROL
1543585
adds a check for allow_directory_sharing so that we guarantee its fun…
549eb02
adds SharedDirectoryAnnounce and removes the right click hack from cl…
8c5e2b1
Adds SharedDirectoryAcknowledge tdp message, refactors rust-go interf…
de13b64
updates naming convention
8017ef2
Making sense of handle_client_id_confirm
1ce587f
finishes out shared directory ack
66b5b00
updates to new sd_acknowledge
de8e052
uses a struct for ack
0feae71
roadblock at 'static lifetime error
20d9aeb
refactors codebase to only contain shared directory announce and shar…
ec900b8
Merge branch 'master' into isaiah/tdp-sd-announce-ack
e43694b
Merge branch 'master' into isaiah/tdp-sd-announce-ack
95af26b
fixes function name typo
2adf291
checking in to go work on other stuff
eec39f5
rather than passing errors via C-strings, we pass them as integers wh…
c43d688
Merge branch 'master' into isaiah/cgo-err-code
a56236f
giving CGOErrCode explicit values
20efe3e
removing useless format
dac6c41
adding feature flag
6251502
adding #[allow(dead_code)]
2cb663d
Merge branch 'master' into isaiah/cgo-err-code
3615580
Merge branch 'isaiah/cgo-err-code' into isaiah/tdp-sd-announce-ack
7fe5b95
Debugf
9274c31
Merge branch 'master' into isaiah/cgo-err-code
7975209
Merge branch 'isaiah/cgo-err-code' into isaiah/tdp-sd-announce-ack
b0072f9
Merge branch 'isaiah/tdp-sd-announce-ack' into isaiah/stub-irp-mj-create
ce1c6c5
removing mentions of code side
1732e90
Merge branch 'isaiah/cgo-err-code' into isaiah/tdp-sd-announce-ack
6605005
Merge branch 'isaiah/tdp-sd-announce-ack' into isaiah/stub-irp-mj-create
224db3a
removing dangling CGO_OK
9ec0cba
making a mod.rs
ee34ddd
moving scard in rdpdr
dbedfc8
moves constants into consts.rs
df26b8f
Adds go build flags for directory sharing and some basic scaffolding …
e0bbfcf
Merge branch 'isaiah/shared-directory-build-flag' into isaiah/tdp-sd-…
eccab5a
Merge branch 'master' into isaiah/tdp-sd-announce-ack
51c956c
reverting e
8d532c8
Id to ID
750fe60
typo
f4959ee
proof of concept for calling the closures from golang. Checkpoing com…
e5d849e
trims rust back to bare minimum required for poc
f146e42
adds TypeSharedDirectoryAcknowledge, TypeSharedDirectoryInfoRequest, …
53cc341
Adds sharedDirectoryInfoRequest to go client
fe4bd3e
adds SharedDirectoryInfoResponse to go client
6bfc7a3
Merge branch 'isaiah/tdp-sd-announce-ack' into isaiah/rdp-tdp-transl-…
27d7c53
CR
f00eeb6
fixes compiler errors
0227339
Adds the straightforward failure modes
cd4b5a2
adds file_cache
9ebf970
adds Shared Directory Create Request
8d97123
adds Shared Directory Delete Request
034f396
fills out the rest of IRP_MJ_CREATE
b01c4ee
adds plumbing for calling handle_tdp_sd_create_response and handle_td…
d7950f6
adds logic for calling handle_tdp_sd_create_response and handle_tdp_s…
1db2ff5
reverting mistaken Makefile change
e1ce4ce
Merge branch 'isaiah/rdp-tdp-transl-arch' into isaiah/complete-irp-mj…
664a8e4
adds missing STATUS_SUCCESS messages
6ce109a
adds logic for IRP_MJ_QUERY_INFORMATION
3dc58ad
adding dead_code tag
90350d1
reverting Makefile
a71b390
Adds handling of IRP_MJ_CLOSE
c4371da
Merge branch 'master' into isaiah/tdp-sd-announce-ack
9e4db09
refactored all available, now realizing that I should've branched off…
511b1d2
Merge branch 'isaiah/irp-mj-close' into isaiah/irp-mj-refactor
02f3ec9
moves IRP_MJ_CLOSE handling into process_irp_close
750e7ff
fixing build bug and go lint errors
5bd7968
merging branch isaiah/tdp-sd-announce-ack
15fb5c5
Merge branch 'isaiah/rdp-tdp-transl-arch' into isaiah/complete-irp-mj…
efa9ac1
reverting Makefile
23ddd4d
Merge branch 'isaiah/complete-irp-mj-create' into isaiah/irp-mj-query…
67ee1b8
Merge branch 'isaiah/irp-mj-query-information' into isaiah/irp-mj-close
8e0a0ed
Merge branch 'isaiah/irp-mj-close' into isaiah/irp-mj-refactor
61d2509
Adds CGOTdpErrCode. Go behaves oddly with enums being placed in struc…
f6f7c69
I decided there's no need to use errCodeToTdpErrCode at all. We can j…
8dc6616
adding CGOFileType
57a826c
changed up the naming convention for these enums, since the primary r…
b449124
fixing rust linting problems
6b304ff
Merge branch 'isaiah/tdp-sd-announce-ack' into isaiah/rdp-tdp-transl-…
766c0ca
fixing clippy errors
93ba0bf
Merge branch 'isaiah/rdp-tdp-transl-arch' into isaiah/complete-irp-mj…
3c3db15
Fixes linting errors
570019a
Merge branch 'isaiah/complete-irp-mj-create' into isaiah/irp-mj-query…
58cf5e2
fixing lint errors and reverting Makefile
7155ef4
Merge branch 'isaiah/irp-mj-query-information' into isaiah/irp-mj-close
7e4986f
fixing clippy errors
cde94ea
Merge branch 'isaiah/irp-mj-close' into isaiah/irp-mj-refactor
bd86280
fixing clippy errors
1abfd00
fixing Makefile
0732269
adds SharedDirectoryListRequest, support for IRP_MJ_DIRECTORY_CONTROL…
ab54ef5
Adding logic for FILE_SUPERSEDE
5c4aedb
taking an opportunity to improve code quality of process_irp_create a…
6213cb1
adds go code for encoding/decoding SharedDirectoryListResponse
91c855e
adds all the glue for getting SharedDirectoryListResponse's from the …
cd0a76a
updating a comment
25315f0
Merge branch 'isaiah/add-FILE-SUPERSEDE' into isaiah/irp-mj-directory…
1f93760
Merge branch 'isaiah/irp-mj-create-refactor' into isaiah/irp-mj-direc…
2edf592
Adding more detailed safety blocks for rust functions called from Go
5ed8bd0
Adding algorithm explanation to the doc string of process_irp_directo…
7427ea9
changing a mistaken cli.prep_file_cache_fail_drive_query_dir_response…
5b8a8e6
Adds explanatory comment
7b97bcf
fixing fsoList cgo/ffi passing so that empty lists can be properly pa…
57f2009
updates FileBothDirectoryInformation to use default values rather tha…
b53e375
Adds FileFullDirectoryInformation support
a009514
adds match block to ClientDriveQueryDirectoryResponse::new to ensure …
aeaa16e
updates encode() given the new constraints of new()
7fa4ec5
swapping to use buffer guard
9a33881
Merge branch 'windows-desktop-directory-sharing' into isaiah/fix-quer…
09d803f
reverts match guard
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Up to you whether using match guards makes this read cleaner.
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.
I just tried that, but it turns out that the issue with using a match guard here is that if the match guard fails, then the control gets bumped down to the wildcard match (which isn't what we want in the case of i.e.
NTSTATUS::STATUS_SUCCESS && buffer.is_some()
):So if I were to use a match guard here, I would need to then do something like another match in that wildcard to confirm a legitimate
NTSTATUS
was received, or add another match case forNTSTATUS::STATUS_SUCCESS if buffer.is_some()
(it would read worse).In a loose sense, adding the match guard sidesteps typical match semantics of matching on all possible values of
NTSTATUS
, and instead matches on allNTSTATUS && <match guards>
.