Skip to content
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

Rework the writing of DictionaryProperty #107

Merged
merged 1 commit into from
Feb 25, 2024

Conversation

Numpsy
Copy link
Contributor

@Numpsy Numpsy commented Feb 10, 2024

According to the Microsoft documentation at https://learn.microsoft.com/en-us/openspecs/windows_protocols/MS-OLEPS/99127b7f-c440-4697-91a4-c853086d6b33 :

  1. The dictinoary entry should be
    Number of entries
    entries
    padding so the size is a multiple of 4 bytes

and the current code doesn't do the padding.

  1. Each dictionary entry should be
    Identifier
    Length
    Name

but the current code only writes the Identifier and Name, not the length.

Also, if the codepage is CP_WINUNICODE then each individual string entry should be passed as well.

@Numpsy Numpsy force-pushed the users/rw/user_defined_3 branch from 9245248 to 02e11c3 Compare February 19, 2024 00:11
@ironfede ironfede marked this pull request as ready for review February 19, 2024 22:33
@Numpsy
Copy link
Contributor Author

Numpsy commented Feb 19, 2024

Currently a draft because it doesn't handle the different padding behavior required when the code page is CP_WINUNICODE

I see that there's already some currently commented out code for the different code pages at

so maybe there's some scope for reusing things a bit more

@Numpsy Numpsy force-pushed the users/rw/user_defined_3 branch from 02e11c3 to e916c9a Compare February 25, 2024 02:02
@Numpsy Numpsy changed the title [WIP] fix up padding when writing DictionaryProperty Rework the writing of DictionaryProperty Feb 25, 2024
@Numpsy
Copy link
Contributor Author

Numpsy commented Feb 25, 2024

Ok to review I think.

The code for doing the null terminators for each string type is copied from elsewhere, so there is scope to make some more bits shared once it's all working, but as it stands this is keeping the changes self contained inside the dictionary code.

@Numpsy Numpsy force-pushed the users/rw/user_defined_3 branch from e916c9a to 1fba379 Compare February 25, 2024 02:11
@ironfede
Copy link
Owner

Many thanks @Numpsy

@ironfede ironfede merged commit 7c21600 into ironfede:master Feb 25, 2024
@Numpsy Numpsy deleted the users/rw/user_defined_3 branch February 25, 2024 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants