Skip to content

Instantly share code, notes, and snippets.

@voxik
Created October 20, 2010 23:39
Show Gist options
  • Save voxik/637589 to your computer and use it in GitHub Desktop.
Save voxik/637589 to your computer and use it in GitHub Desktop.
From b0031ca74fdcf66f598a396751aabd68854646c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <[email protected]>
Date: Thu, 21 Oct 2010 01:34:19 +0200
Subject: [PATCH] Fixed spoon for Ruby 1.8.
---
lib/spoon.rb | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/spoon.rb b/lib/spoon.rb
index 47e8193..abf4f1d 100644
--- a/lib/spoon.rb
+++ b/lib/spoon.rb
@@ -14,7 +14,7 @@ module Spoon
attach_function :_posix_spawn, :posix_spawn, [:pointer, :string, :pointer, :pointer, :pointer, :pointer], :int
attach_function :_posix_spawnp, :posix_spawnp, [:pointer, :string, :pointer, :pointer, :pointer, :pointer], :int
- rescue FFI::NotFoundError
+ rescue LoadError, FFI::NotFoundError
end
# BOOL WINAPI CreateProcess(
@@ -34,7 +34,7 @@ module Spoon
ffi_lib 'kernel32'
ffi_convention :stdcall
- attach_function :_create_process, :CreateProcessW, [:buffer_in, :pointer, :pointer, :pointer, :int, :int, :pointer, :buffer_in, :pointer, :pointer], :int
+ attach_function :_create_process, :CreateProcessA, [:buffer_in, :pointer, :pointer, :pointer, :int, :int, :pointer, :buffer_in, :pointer, :pointer], :int
attach_function :_get_last_error, :GetLastError, [], :int
class SecurityAttributes < FFI::Struct
@@ -47,6 +47,7 @@ module Spoon
layout :cb, :int, # DWORD
:reserved, :pointer, # LPTSTR
:desktop, :pointer, # LPTSTR
+ :title, :pointer, # LPTSTR
:x, :int, # DWORD
:y, :int, # DWORD
:x_size, :int, # DWORD
--
1.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment