Andreas Rosenberg wrote:
Thanks for your hints, Paul.
I added some tests for the Ansi variant of the function and fixed the problem you mentioned.
I also think that your addition of _GetAccountNameFromTokenW is holding the committing of this patch back, especially because you don't seem to use
that
function.
I also added an additional comment, why this function is not used. Maybe you didn't notice the comments later on. Hopefully this makes things clearer. Unfortunately I don't have enough knowledge to fix the LookupAccountSidW
You could start by adding some tests (if it's not there) for LookupAccountSid that shows the bug you mentioned.
which is the reason why I did not use it, and why I'm still using GetUserName to make the function return a valid path.
Is it regarded bad style what I did here? Any suggestions otherwise?
Well I don't think it will be accepted as is. We usually don't add functions that are not used anywhere especially when the comments say that there is a bug elsewhere that should be fixed first.
Regards Andreas