HomePhorge

(PUP-2382) Create FFI typedefs for Win32 API
f9afe613fbf8Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-2382) Create FFI typedefs for Win32 API

  • Add new file windows/api_types to contain global FFI typedefs that can be reused wherever we attach_function for FFI
  • Replace existing function definitions with new Win32 API style typedefs such as :dword, :lpcstr, :handle, etc
  • Fix some API definitions that were using incorrect FFI typedefs such as :ulong and :long. In FFI, these typedefs are platform specific and will vary in size. On Windows, these are fixed width. New Win32 typedefs of :win32_ulong and :win32_long were added to accommodate these in function definitions.
  • Fix replace_file by passing FFI::Pointer::NULL to match it's updated definition.
  • Where applicable, modify FFI::MemoryPointer.new to use the Win32 typedef being created, so .new(:dword, 1) instead of .new(:uint, 1)
  • Prefix each attach_function with an ffi_lib for the dll it's actually loaded in.
  • Add missing documentation / links where helpful.

Paired-with: Rob Reynolds <rob@puppetlabs.com>

Details

Provenance
Ethan J. Brown <Iristyle@github>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUdaf8daf2582d: Merge pull request #2621 from jeffb-bt/feature/azn-linux-build-3.5.1
Branches
Unknown
Tags
Unknown

Event Timeline

Ethan J. Brown <Iristyle@github> committed rPUf9afe613fbf8: (PUP-2382) Create FFI typedefs for Win32 API (authored by Ethan J. Brown <Iristyle@github>).May 21 2014, 12:48 AM