HomePhorge

(PUP-836) FFI Puppet::Util::Windows::User
5d82c55c73f5Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-836) FFI Puppet::Util::Windows::User

  • LogonUserW, LoadUserProfile, UnloadUserProfile and PROFILEINFO have been converted from manually packing params with Win32API.new to automatically managed with FFI definitions.
  • Use MemoryPointer where appropriate.
  • Note that wide character LogonUserW is used rather than platform varying LogonUser as FFI is unable to use that. The pointer widths of PROFILEINFO vary depending on platform, which is handled by using :pointer. With LogonUserW the string pointed to is always wide character, which is properly handled by using wide_string.
  • Add FFI::MemoryPointer helper read_handle
  • Add FFI::MemoryPointer.from_wide_string and corresponding tests that ensure that a properly terminated UTF-16LE string is passed in
  • Add FFI::MemoryPointer#read_wide_string that reads a wide string buffer into a Ruby string with Encoding.default_external and corresponding tests
  • Add additional tests around User methods that make native Win32 API calls that will intentionally fail
  • Fix wide_string helper to return nil when given nil so that can be passed directly to Win32 as a null pointer

Details

Provenance
Ethan J. Brown <Iristyle@github>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU46da0057e70e: Merge branch 'stable'
Branches
Unknown
Tags
Unknown

Event Timeline

Ethan J. Brown <Iristyle@github> committed rPU5d82c55c73f5: (PUP-836) FFI Puppet::Util::Windows::User (authored by Ethan J. Brown <Iristyle@github>).May 23 2014, 2:59 AM