diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-08-26 14:52:31 -0700 |
---|---|---|
committer | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2015-08-27 11:54:52 -0400 |
commit | 763d15a07d76c21cba72527a6134ecf353909f91 (patch) | |
tree | 30c13ed39dc8bfe8d6346911e55c9a6b43fb312d /lib/chef/util | |
parent | 5a863dc4331799b5876edcf5fdc31666f47888d6 (diff) | |
download | chef-763d15a07d76c21cba72527a6134ecf353909f91.tar.gz |
Use ffi for GetVolumeNameForVolumeMountPoint
Diffstat (limited to 'lib/chef/util')
-rw-r--r-- | lib/chef/util/windows/volume.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/chef/util/windows/volume.rb b/lib/chef/util/windows/volume.rb index e28a5091ac..e29179277c 100644 --- a/lib/chef/util/windows/volume.rb +++ b/lib/chef/util/windows/volume.rb @@ -35,11 +35,10 @@ class Chef::Util::Windows::Volume < Chef::Util::Windows end def device - buffer = 0.chr * 256 - if GetVolumeNameForVolumeMountPoint(@name, buffer, buffer.size) - return buffer[0,buffer.size].unpack("Z*")[0] - else - raise ArgumentError, get_last_error + begin + Chef::ReservedNames::Win32::File.get_volume_name_for_volume_mount_point(@name) + rescue Chef::Exceptions::Win32APIError => e + raise ArgumentError, e end end |