# File lib/chef/win32/api.rb, line 31 def safe_attach_function(win32_func, *args) begin attach_function(win32_func.to_sym, *args) rescue FFI::NotFoundError define_method(win32_func.to_sym) do |*margs| raise Chef::Exceptions::Win32APIFunctionNotImplemented, "This version of Windows does not implement the Win32 function [#{win32_func}]." end end end