summaryrefslogtreecommitdiff
path: root/lib/chef/util/windows.rb
diff options
context:
space:
mode:
authorNathan Williams <nath.e.will@gmail.com>2015-10-23 22:19:25 -0700
committerNathan Williams <nath.e.will@gmail.com>2015-10-23 22:19:25 -0700
commita58c59460aa6b9cfe0824dabaf6cac0c445d0288 (patch)
treedaf8cfecdc01e45dd19bd888974b6a75913401c5 /lib/chef/util/windows.rb
parente6b2a07634f8eef374e1edb84387d69bca3044c1 (diff)
parent8bf1304da739d4be94edb101ad9e46c96b1d4ccd (diff)
downloadchef-a58c59460aa6b9cfe0824dabaf6cac0c445d0288.tar.gz
re-sync with master
Diffstat (limited to 'lib/chef/util/windows.rb')
-rw-r--r--lib/chef/util/windows.rb32
1 files changed, 0 insertions, 32 deletions
diff --git a/lib/chef/util/windows.rb b/lib/chef/util/windows.rb
index 777fe4adbb..7d29a67ac5 100644
--- a/lib/chef/util/windows.rb
+++ b/lib/chef/util/windows.rb
@@ -15,42 +15,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-#requires: gem install windows-pr
-require 'windows/api'
-require 'windows/error'
-require 'windows/handle'
-require 'windows/unicode'
-require 'windows/msvcrt/buffer'
-require 'windows/msvcrt/string'
-require 'windows/network/management'
class Chef
class Util
class Windows
- protected
-
- include ::Windows::Error
- include ::Windows::Unicode
- include ::Windows::MSVCRT::Buffer
- include ::Windows::MSVCRT::String
- include ::Windows::Network::Management
-
- PTR_SIZE = 4 #XXX 64-bit
-
- def lpwstr_to_s(buffer, offset)
- str = 0.chr * (256 * 2) #XXX unhardcode this length (*2 for WCHAR)
- wcscpy str, buffer[offset*PTR_SIZE,PTR_SIZE].unpack('L')[0]
- wide_to_multi str
- end
-
- def dword_to_i(buffer, offset)
- buffer[offset*PTR_SIZE,PTR_SIZE].unpack('i')[0] || 0
- end
-
- #return pointer for use with pack('L')
- def str_to_ptr(v)
- [v].pack('p*').unpack('L')[0]
- end
end
end
end