[Lldb-commits] [PATCH] Use GUIDs to make pipe names unique on Windows.
Adrian McCarthy
amccarth at google.com
Mon Feb 9 17:01:53 PST 2015
In http://reviews.llvm.org/D7509#120962, @zturner wrote:
> In http://reviews.llvm.org/D7509#120920, @amccarth wrote:
>
> > Corrected pointer dereference. The reinterpret_cast is necessary because RPC_CSTR is a pointer to unsigned char and llvm::StringRef doesn't have a constructor for that. If I ditch the RPC_CSTR and just declare unique_string as a pointer to char, then I'd have to cast it in the call to UuidToString, which is uglier.
>
>
> If RPC_CSTR is a pointer to unsigned char*, then it sounds like it's probably unicode. In that case the += operator on SmallString<> won't work correctly. We need to use llvm::convertUTF16ToUTF8String() in that case.
Nope. RPC_CSTR is a pointer to unsigned char (not a pointer to a pointer).
I explicitly call UuidToStringA (the ANSI version of the function), which should get single byte characters in the current code page. Since GUIDs don't have any non-ASCII characters, so there should be no high-bit characters and the code page should be irrelevant. I don't think any conversion should be necessary.
I'd love to step through this code to verify, but I can't seem to find a test that exercises this code.
http://reviews.llvm.org/D7509
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the lldb-commits
mailing list