Hi Justin,
If you want to check your current changes (that crash) in ntservice.cpp into a branch on your mongodb fork, I can look at it and suggest changes. That seems easier than operating indirectly through a stackoverflow question.
I think the answer you got on stackoverflow is correct ... .c_str() is giving you a buffer that is destroyed on exit from the function, so if you want to use a subroutine to create the LSA_UNICODE_STRING then you need to allocate memory yourself for the string's actual buffer. As the other answer said, this gets ugly because of buffer ownership issues, prompting the excessive RAII example given. My approach would be to write less code and just make sure that your buffer is valid when it needs to be and is freed when you are done with it.
Check in your code to your fork on a new temporary branch, post the branch name and I'll post suggested changes ... if you want.
Tad Marshall
--
You received this message because you are subscribed to the Google Groups
"mongodb-dev" group.
To post to this group, send email to mongo...@googlegroups.com.
To unsubscribe from this group, send email to
mongodb-dev...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/mongodb-dev?hl=en.
Hi Justin,
I added a comment to the SERVER-1227 Jira ticket ... https://jira.mongodb.org/browse/SERVER-1227?focusedCommentId=80078#comment-80078 . Just FYI ...
Tad Marshall
From:
mongo...@googlegroups.com [mailto:mongo...@googlegroups.com] On Behalf Of Justin Dearing
Sent: Sunday, January 15, 2012
10:07 PM
To: mongodb-dev
Subject: [mongodb-dev] Could use
some help converting std:wstring to a LSA_UNICODE string to close SERVER-1227
Make installService grant the "Login as a Service" right if necessary
to the user that is running the service
Hey,
--