vendored/puppet/lib/puppet/util/windows.rb in bolt-0.23.0 vs vendored/puppet/lib/puppet/util/windows.rb in bolt-0.24.0
- old
+ new
@@ -1,21 +1,36 @@
require 'puppet/util/platform'
module Puppet::Util::Windows
module ADSI
- class User; end
+ class ADSIObject; end
+ class User < ADSIObject; end
class UserProfile; end
- class Group; end
+ class Group < ADSIObject; end
end
module File; end
module Registry
end
module SID
class Principal; end
end
class EventLog; end
if Puppet::Util::Platform.windows?
+ require 'Win32API' # case matters in this require!
+
+ # Note: Setting codepage here globally ensures all strings returned via
+ # WIN32OLE (Ruby's late-bound COM support) are encoded in Encoding::UTF_8
+ #
+ # Also, this does not modify the value of WIN32OLE.locale - which defaults
+ # to 2048 (at least on US English Windows) and is not listed in the MS
+ # locales table, here: https://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx
+ require 'win32ole' ; WIN32OLE.codepage = WIN32OLE::CP_UTF8
+ # gems
+ require 'win32/process'
+ require 'win32/dir'
+ require 'win32/service'
+
# these reference platform specific gems
require 'puppet/util/windows/api_types'
require 'puppet/util/windows/string'
require 'puppet/util/windows/error'
require 'puppet/util/windows/com'
@@ -30,7 +45,8 @@
require 'puppet/util/windows/access_control_list'
require 'puppet/util/windows/security_descriptor'
require 'puppet/util/windows/adsi'
require 'puppet/util/windows/registry'
require 'puppet/util/windows/eventlog'
+ require 'puppet/util/windows/service'
end
end