Method: FFI::Pointer.from_string_to_wide_string
- Defined in:
- lib/pdk/util/windows/api_types.rb
.from_string_to_wide_string(str, &_block) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/pdk/util/windows/api_types.rb', line 19 def self.from_string_to_wide_string(str, &_block) str = PDK::Util::Windows::String.wide_string(str) FFI::MemoryPointer.new(:byte, str.bytesize) do |ptr| # uchar here is synonymous with byte ptr.put_array_of_uchar(0, str.bytes.to_a) yield ptr end # ptr has already had free called, so nothing to return nil end |