MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / CreateGuid

Method CreateGuid

cpp/iedriver/StringUtilities.cpp:215–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215std::wstring StringUtilities::CreateGuid() {
216 UUID guid;
217 RPC_WSTR guid_string = NULL;
218 RPC_STATUS status = ::UuidCreate(&guid);
219 if (status != RPC_S_OK) {
220 // If we encounter an error, not bloody much we can do about it.
221 // Just log it and continue.
222 // LOG(WARN) << "UuidCreate returned a status other then RPC_S_OK: " << status;
223 }
224 status = ::UuidToString(&guid, &guid_string);
225 if (status != RPC_S_OK) {
226 // If we encounter an error, not bloody much we can do about it.
227 // Just log it and continue.
228 // LOG(WARN) << "UuidToString returned a status other then RPC_S_OK: " << status;
229 }
230
231 // RPC_WSTR is currently typedef'd in RpcDce.h (pulled in by rpc.h)
232 // as unsigned short*. It needs to be typedef'd as wchar_t*
233 wchar_t* cast_guid_string = reinterpret_cast<wchar_t*>(guid_string);
234 std::wstring returned_guid(cast_guid_string);
235
236 ::RpcStringFree(&guid_string);
237 return returned_guid;
238}
239
240void StringUtilities::ComposeUnicodeString(std::wstring* input) {
241 StringUtilities::NormalizeUnicodeString(NormalizationC, input);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected