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

Incorrect function signature for IPersistFolder3.InitializeEx #301

Closed
Arik-Playground opened this issue Jun 1, 2022 · 1 comment
Closed

Comments

@Arik-Playground
Copy link

Arik-Playground commented Jun 1, 2022

Describe the bug
The function declaration for InitializeEx in the IPersistFolder3 interface is incorrect; ppfti should be nullable according to the msdn

What code is involved
here

Expected behavior
The line should probably be
void InitializeEx([In] IBindCtx pbc, [In] PIDL pidlRoot, [In] PERSIST_FOLDER_TARGET_INFO? ppfti);

@dahall
Copy link
Owner

dahall commented Jun 8, 2022

Good catch. I have corrected the syntax to

void InitializeEx([In] IBindCtx pbc, [In] PIDL pidlRoot, [In, Optional] IntPtr ppfti);

since nullable types (e.g. PERSIST_FOLDER_TARGET_INFO?) cannot be marshaled. I added an overload that still supports the old syntax and handles converting the PERSIST_FOLDER_TARGET_INFO value to a pointer.

@dahall dahall closed this as completed Jun 8, 2022
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

No branches or pull requests

2 participants