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

Method CopyWStringFromBuffer

cpp/iedriver/HookProcessor.cpp:393–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393std::wstring HookProcessor::CopyWStringFromBuffer() {
394 // Allocate a buffer of wchar_t the length of the data in the
395 // shared memory buffer, plus one extra wide char, so that we
396 // can null terminate.
397 int local_buffer_size = GetDataBufferSize() + sizeof(wchar_t);
398 std::vector<wchar_t> local_buffer(local_buffer_size / sizeof(wchar_t));
399
400 // Copy the data from the shared memory buffer, and force
401 // a terminating null char into the local vector, then
402 // convert to wstring.
403 CopyDataFromBuffer(local_buffer_size, &local_buffer[0]);
404 local_buffer[local_buffer.size() - 1] = L'\0';
405 std::wstring data = &local_buffer[0];
406 return data;
407}
408
409void HookProcessor::ClearBuffer() {
410 // Zero out the shared buffer

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected