diff options
author | sersut <serdar@opscode.com> | 2014-06-22 14:41:00 -0700 |
---|---|---|
committer | sersut <serdar@opscode.com> | 2014-06-24 10:45:02 -0700 |
commit | e0545f11b9d8b4901b13dac3dbbbdf61eb4282a0 (patch) | |
tree | 76186cdb3eca49908748cda506c51e2c9d59b2d4 /lib/chef/win32 | |
parent | d843efaf8809ba056dce5935cdad608c64c11199 (diff) | |
download | chef-e0545f11b9d8b4901b13dac3dbbbdf61eb4282a0.tar.gz |
Use FFI::LastError instead of GetLastError for ffi 1.9.x compatibility.
Diffstat (limited to 'lib/chef/win32')
-rw-r--r-- | lib/chef/win32/error.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/security.rb | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/win32/error.rb b/lib/chef/win32/error.rb index 716ca99d01..2175608eeb 100644 --- a/lib/chef/win32/error.rb +++ b/lib/chef/win32/error.rb @@ -47,7 +47,7 @@ class Chef end def self.get_last_error - GetLastError() + FFI::LastError.error end # Raises the last error. This should only be called by diff --git a/lib/chef/win32/security.rb b/lib/chef/win32/security.rb index ff97c465e5..48ca78647f 100644 --- a/lib/chef/win32/security.rb +++ b/lib/chef/win32/security.rb @@ -262,7 +262,7 @@ class Chef system_name = system_name.to_wstring if system_name if LookupAccountNameW(system_name, name.to_wstring, nil, sid_size, nil, referenced_domain_name_size, nil) raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupAccountName, and got no error!" - elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER + elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER Chef::ReservedNames::Win32::Error.raise! end @@ -284,7 +284,7 @@ class Chef system_name = system_name.to_wstring if system_name if LookupAccountSidW(system_name, sid, nil, name_size, nil, referenced_domain_name_size, nil) raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupAccountSid, and got no error!" - elsif Chef::ReservedNames::Win32::Error::get_last_error != ERROR_INSUFFICIENT_BUFFER + elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER Chef::ReservedNames::Win32::Error.raise! end @@ -303,7 +303,7 @@ class Chef name_size = FFI::Buffer.new(:long).write_long(0) if LookupPrivilegeNameW(system_name, luid, nil, name_size) raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupPrivilegeName, and got no error!" - elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER + elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER Chef::ReservedNames::Win32::Error.raise! end @@ -321,7 +321,7 @@ class Chef language_id = FFI::Buffer.new(:long) if LookupPrivilegeDisplayNameW(system_name, name.to_wstring, nil, display_name_size, language_id) raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupPrivilegeDisplayName, and got no error!" - elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER + elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER Chef::ReservedNames::Win32::Error.raise! end @@ -353,7 +353,7 @@ class Chef group_size = FFI::Buffer.new(:long).write_long(0) if MakeAbsoluteSD(security_descriptor, nil, absolute_sd_size, nil, dacl_size, nil, sacl_size, nil, owner_size, nil, group_size) raise "Expected ERROR_INSUFFICIENT_BUFFER from MakeAbsoluteSD, and got no error!" - elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER + elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER Chef::ReservedNames::Win32::Error.raise! end |