diff options
Diffstat (limited to 'lib/chef/win32/api')
-rw-r--r-- | lib/chef/win32/api/crypto.rb | 126 | ||||
-rw-r--r-- | lib/chef/win32/api/error.rb | 4 | ||||
-rw-r--r-- | lib/chef/win32/api/file.rb | 10 | ||||
-rw-r--r-- | lib/chef/win32/api/installer.rb | 10 | ||||
-rw-r--r-- | lib/chef/win32/api/memory.rb | 4 | ||||
-rw-r--r-- | lib/chef/win32/api/net.rb | 4 | ||||
-rw-r--r-- | lib/chef/win32/api/process.rb | 4 | ||||
-rw-r--r-- | lib/chef/win32/api/psapi.rb | 4 | ||||
-rw-r--r-- | lib/chef/win32/api/registry.rb | 4 | ||||
-rw-r--r-- | lib/chef/win32/api/security.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/api/synchronization.rb | 4 | ||||
-rw-r--r-- | lib/chef/win32/api/system.rb | 4 | ||||
-rw-r--r-- | lib/chef/win32/api/unicode.rb | 4 |
13 files changed, 92 insertions, 92 deletions
diff --git a/lib/chef/win32/api/crypto.rb b/lib/chef/win32/api/crypto.rb index 1837a57557..d329ee3995 100644 --- a/lib/chef/win32/api/crypto.rb +++ b/lib/chef/win32/api/crypto.rb @@ -1,63 +1,63 @@ -#
-# Author:: Jay Mundrawala (<jdm@chef.io>)
-# Copyright:: Copyright 2015 Chef Software, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require 'chef/win32/api'
-
-class Chef
- module ReservedNames::Win32
- module API
- module Crypto
- extend Chef::ReservedNames::Win32::API
-
- ###############################################
- # Win32 API Bindings
- ###############################################
-
- ffi_lib 'Crypt32'
-
- CRYPTPROTECT_UI_FORBIDDEN = 0x1
- CRYPTPROTECT_LOCAL_MACHINE = 0x4
- CRYPTPROTECT_AUDIT = 0x10
-
- class CRYPT_INTEGER_BLOB < FFI::Struct
- layout :cbData, :DWORD, # Count, in bytes, of data
- :pbData, :pointer # Pointer to data buffer
- def initialize(str=nil)
- super(nil)
- if str
- self[:pbData] = FFI::MemoryPointer.from_string(str)
- self[:cbData] = str.bytesize
- end
- end
-
- end
-
- safe_attach_function :CryptProtectData, [
- :PDATA_BLOB,
- :LPCWSTR,
- :PDATA_BLOB,
- :pointer,
- :PCRYPTPROTECT_PROMPTSTRUCT,
- :DWORD,
- :PDATA_BLOB
- ], :BOOL
-
- end
- end
- end
-end
+# +# Author:: Jay Mundrawala (<jdm@chef.io>) +# Copyright:: Copyright 2015 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require "chef/win32/api" + +class Chef + module ReservedNames::Win32 + module API + module Crypto + extend Chef::ReservedNames::Win32::API + + ############################################### + # Win32 API Bindings + ############################################### + + ffi_lib "Crypt32" + + CRYPTPROTECT_UI_FORBIDDEN = 0x1 + CRYPTPROTECT_LOCAL_MACHINE = 0x4 + CRYPTPROTECT_AUDIT = 0x10 + + class CRYPT_INTEGER_BLOB < FFI::Struct + layout :cbData, :DWORD, # Count, in bytes, of data + :pbData, :pointer # Pointer to data buffer + def initialize(str=nil) + super(nil) + if str + self[:pbData] = FFI::MemoryPointer.from_string(str) + self[:cbData] = str.bytesize + end + end + + end + + safe_attach_function :CryptProtectData, [ + :PDATA_BLOB, + :LPCWSTR, + :PDATA_BLOB, + :pointer, + :PCRYPTPROTECT_PROMPTSTRUCT, + :DWORD, + :PDATA_BLOB + ], :BOOL + + end + end + end +end diff --git a/lib/chef/win32/api/error.rb b/lib/chef/win32/api/error.rb index d1f9a309fe..0ea3633202 100644 --- a/lib/chef/win32/api/error.rb +++ b/lib/chef/win32/api/error.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'chef/win32/api' +require "chef/win32/api" class Chef module ReservedNames::Win32 @@ -877,7 +877,7 @@ class Chef # Win32 API Bindings ############################################### - ffi_lib 'kernel32', 'user32' + ffi_lib "kernel32", "user32" =begin DWORD WINAPI FormatMessage( diff --git a/lib/chef/win32/api/file.rb b/lib/chef/win32/api/file.rb index 3618d125a1..51ae3b47c7 100644 --- a/lib/chef/win32/api/file.rb +++ b/lib/chef/win32/api/file.rb @@ -17,10 +17,10 @@ # limitations under the License. # -require 'chef/win32/api' -require 'chef/win32/api/security' -require 'chef/win32/api/system' -require 'chef/win32/unicode' +require "chef/win32/api" +require "chef/win32/api/security" +require "chef/win32/api/system" +require "chef/win32/unicode" class Chef module ReservedNames::Win32 @@ -182,7 +182,7 @@ class Chef # Win32 API Bindings ############################################### - ffi_lib 'kernel32', 'version' + ffi_lib "kernel32", "version" # Does not map directly to a win32 struct # see https://msdn.microsoft.com/en-us/library/windows/desktop/ms647464(v=vs.85).aspx diff --git a/lib/chef/win32/api/installer.rb b/lib/chef/win32/api/installer.rb index b4851eccf1..20d021b9ab 100644 --- a/lib/chef/win32/api/installer.rb +++ b/lib/chef/win32/api/installer.rb @@ -16,10 +16,10 @@ # limitations under the License. # -require 'chef/exceptions' -require 'chef/win32/api' -require 'chef/win32/error' -require 'pathname' +require "chef/exceptions" +require "chef/win32/api" +require "chef/win32/error" +require "pathname" class Chef module ReservedNames::Win32 @@ -37,7 +37,7 @@ class Chef # Win32 API Bindings ############################################### - ffi_lib 'msi' + ffi_lib "msi" =begin UINT MsiOpenPackage( diff --git a/lib/chef/win32/api/memory.rb b/lib/chef/win32/api/memory.rb index abd1191718..2c3e305f08 100644 --- a/lib/chef/win32/api/memory.rb +++ b/lib/chef/win32/api/memory.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'chef/win32/api' +require "chef/win32/api" class Chef module ReservedNames::Win32 @@ -48,7 +48,7 @@ class Chef # Win32 API Bindings ############################################### - ffi_lib 'kernel32' + ffi_lib "kernel32" =begin HLOCAL WINAPI LocalAlloc( diff --git a/lib/chef/win32/api/net.rb b/lib/chef/win32/api/net.rb index 7a578a3833..a3710bdaf5 100644 --- a/lib/chef/win32/api/net.rb +++ b/lib/chef/win32/api/net.rb @@ -16,8 +16,8 @@ # limitations under the License. # -require 'chef/win32/api' -require 'chef/win32/unicode' +require "chef/win32/api" +require "chef/win32/unicode" class Chef module ReservedNames::Win32 diff --git a/lib/chef/win32/api/process.rb b/lib/chef/win32/api/process.rb index 217880b737..6c4e567f74 100644 --- a/lib/chef/win32/api/process.rb +++ b/lib/chef/win32/api/process.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'chef/win32/api' +require "chef/win32/api" class Chef module ReservedNames::Win32 @@ -28,7 +28,7 @@ class Chef # Win32 API Bindings ############################################### - ffi_lib 'kernel32' + ffi_lib "kernel32" safe_attach_function :GetCurrentProcess, [], :HANDLE safe_attach_function :GetProcessHandleCount, [ :HANDLE, :LPDWORD ], :BOOL diff --git a/lib/chef/win32/api/psapi.rb b/lib/chef/win32/api/psapi.rb index 3a5df3f179..347396b50a 100644 --- a/lib/chef/win32/api/psapi.rb +++ b/lib/chef/win32/api/psapi.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'chef/win32/api' +require "chef/win32/api" class Chef module ReservedNames::Win32 @@ -41,7 +41,7 @@ class Chef :PeakPagefileUsage, :SIZE_T end - ffi_lib 'psapi' + ffi_lib "psapi" safe_attach_function :GetProcessMemoryInfo, [ :HANDLE, :pointer, :DWORD ], :BOOL diff --git a/lib/chef/win32/api/registry.rb b/lib/chef/win32/api/registry.rb index cbbf6b66bb..d01700f159 100644 --- a/lib/chef/win32/api/registry.rb +++ b/lib/chef/win32/api/registry.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'chef/win32/api' +require "chef/win32/api" class Chef module ReservedNames::Win32 @@ -28,7 +28,7 @@ class Chef # Win32 API Bindings ############################################### - ffi_lib 'advapi32' + ffi_lib "advapi32" # LONG WINAPI RegDeleteKeyEx( # _In_ HKEY hKey, diff --git a/lib/chef/win32/api/security.rb b/lib/chef/win32/api/security.rb index 4353c488f8..91ce7c92f8 100644 --- a/lib/chef/win32/api/security.rb +++ b/lib/chef/win32/api/security.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'chef/win32/api' +require "chef/win32/api" class Chef module ReservedNames::Win32 diff --git a/lib/chef/win32/api/synchronization.rb b/lib/chef/win32/api/synchronization.rb index 9c148d7e2b..b541e5aaf3 100644 --- a/lib/chef/win32/api/synchronization.rb +++ b/lib/chef/win32/api/synchronization.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'chef/win32/api' +require "chef/win32/api" class Chef module ReservedNames::Win32 @@ -24,7 +24,7 @@ class Chef module Synchronization extend Chef::ReservedNames::Win32::API - ffi_lib 'kernel32' + ffi_lib "kernel32" # Constant synchronization functions use to indicate wait # forever. diff --git a/lib/chef/win32/api/system.rb b/lib/chef/win32/api/system.rb index a485f89708..218a9b95e7 100644 --- a/lib/chef/win32/api/system.rb +++ b/lib/chef/win32/api/system.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'chef/win32/api' +require "chef/win32/api" class Chef module ReservedNames::Win32 @@ -132,7 +132,7 @@ class Chef # Win32 API Bindings ############################################### - ffi_lib 'kernel32', 'user32' + ffi_lib "kernel32", "user32" class OSVERSIONINFOEX < FFI::Struct layout :dw_os_version_info_size, :DWORD, diff --git a/lib/chef/win32/api/unicode.rb b/lib/chef/win32/api/unicode.rb index 2a9166aa99..29cdfba5fd 100644 --- a/lib/chef/win32/api/unicode.rb +++ b/lib/chef/win32/api/unicode.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'chef/win32/api' +require "chef/win32/api" class Chef module ReservedNames::Win32 @@ -92,7 +92,7 @@ class Chef # Win32 API Bindings ############################################### - ffi_lib 'kernel32', 'advapi32' + ffi_lib "kernel32", "advapi32" =begin BOOL IsTextUnicode( |