Module: Puppet::Util::Windows::COM Private

Extended by:
FFI::Library
Defined in:
lib/puppet/util/windows/com.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Modules: Factory, Helpers, Instance, Interface

Constant Summary collapse

S_OK =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0
S_FALSE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

1
CLSCTX_INPROC_SERVER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x1
CLSCTX_INPROC_HANDLER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x2
CLSCTX_LOCAL_SERVER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x4
CLSCTX_INPROC_SERVER16 =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x8
CLSCTX_REMOTE_SERVER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x10
CLSCTX_INPROC_HANDLER16 =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x20
CLSCTX_RESERVED1 =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x40
CLSCTX_RESERVED2 =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x80
CLSCTX_RESERVED3 =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x100
CLSCTX_RESERVED4 =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x200
CLSCTX_NO_CODE_DOWNLOAD =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x400
CLSCTX_RESERVED5 =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x800
CLSCTX_NO_CUSTOM_MARSHAL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x1000
CLSCTX_ENABLE_CODE_DOWNLOAD =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x2000
CLSCTX_NO_FAILURE_LOG =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x4000
CLSCTX_DISABLE_AAA =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x8000
CLSCTX_ENABLE_AAA =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x10000
CLSCTX_FROM_DEFAULT_CONTEXT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x20000
CLSCTX_ACTIVATE_32_BIT_SERVER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x40000
CLSCTX_ACTIVATE_64_BIT_SERVER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x80000
CLSCTX_ENABLE_CLOAKING =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

0x100000
CLSCTX_PS_DLL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

-0x80000000
CLSCTX_INPROC =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER
CLSCTX_ALL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER
CLSCTX_SERVER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER
IUnknown =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Interface[
  FFI::WIN32::GUID['00000000-0000-0000-C000-000000000046'],

  QueryInterface: [[:pointer, :pointer], :hresult],
  AddRef: [[], :win32_ulong],
  Release: [[], :win32_ulong]
]
Unknown =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Instance[IUnknown]

Class Method Summary collapse

Class Method Details

.FAILED(hr) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


12
# File 'lib/puppet/util/windows/com.rb', line 12

def FAILED(hr) hr < 0 end

.InitializeComObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


218
219
220
221
222
# File 'lib/puppet/util/windows/com.rb', line 218

def InitializeCom
  raise_if_hresult_failed(:CoInitialize, FFI::Pointer::NULL)

  at_exit { CoUninitialize() }
end

.raise_if_hresult_failed(name, *args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


16
17
18
19
20
21
22
# File 'lib/puppet/util/windows/com.rb', line 16

def raise_if_hresult_failed(name, *args)
  failed = FAILED(result = send(name, *args)) and raise _("%{name} failed (hresult %{result}).") % { name: name, result: format('%#08x', result) }

  result
ensure
  yield failed if block_given?
end

.SUCCEEDED(hr) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


11
# File 'lib/puppet/util/windows/com.rb', line 11

def SUCCEEDED(hr) hr >= 0 end