I'm not sure about this construct. If `API.get_current_process` blows up, then handle will be `nil` and calling `close_handle` in the ensure block may then fail, and mask what the original `GetLastError` was. I think you're better off doing something like:

<pre>
handle = API.get_current_process
begin
  yield handle
ensure
  API.close_handle(handle)
end
</pre>

Slightly more verbose, but that way you're assured you're only calling close_handle on a valid handle. And actually now that I write this, I don't think we need to close the handle from GetCurrentProcess. From http://msdn.microsoft.com/en-us/library/windows/desktop/ms683179(v=vs.85).aspx "The pseudo handle need not be closed when it is no longer needed. Calling the CloseHandle function with a pseudo handle has no effect."