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

Review Windows-specific code #1

Closed
soc opened this issue Feb 22, 2018 · 7 comments
Closed

Review Windows-specific code #1

soc opened this issue Feb 22, 2018 · 7 comments

Comments

@soc
Copy link
Collaborator

soc commented Feb 22, 2018

I'm not a Windows developer, so I'm not experienced in dealing with the various native Windows APIs.

It would be really helpful if someone more knowledgeable than me could have a look at https://github.com/soc/directories-rs/blob/master/src/win.rs#L82 and make sure that I have used the Windows API correctly, and haven't introduced any glaring issues on the Rust side either.

@francesca64
Copy link

Feel free to ping me in the future for any native API review (at least for Windows, X11, and macOS). I maintain winit, so I have to interact with them on a regular basis.

@soc
Copy link
Collaborator Author

soc commented May 6, 2018

@francesca64 Amazing, thanks a lot!

Could you have a look whether https://github.com/soc/directories-rs/blob/master/src/win.rs#L84 correctly manages the memory coming from the Windows API?

@francesca64
Copy link

Looks good to me. OsString copies the data, and you free the original with CoTaskMemFree just as the docs for SHGetKnownFolderPath say.

@soc
Copy link
Collaborator Author

soc commented May 7, 2018

@francesca64 Thank you. I looked at code like https://github.com/tbu-/dirs/blob/master/src/windows/sys.rs#L88 that explicitly defined Dropand was concerned that there was a way to leave the method in my code without cleanup that I didn't see..

@soc
Copy link
Collaborator Author

soc commented May 7, 2018

@francesca64 Last question: Do the changes in c0d6956 look good to you?

@francesca64
Copy link

Yeah, that looks good.

@soc
Copy link
Collaborator Author

soc commented May 7, 2018

@francesca64 Thanks for your help! I'll close this ticket then.

@soc soc closed this as completed May 7, 2018
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