Class: WindowsCOM::PROPERTYKEY

Inherits:
FFI::Struct
  • Object
show all
Includes:
FFIStructMemoryEquality
Defined in:
lib/windows_com/ole.rb

Class Method Summary collapse

Methods included from FFIStructMemoryEquality

#==

Class Method Details

.[](type, index) ⇒ Object



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/windows_com/ole.rb', line 217

def self.[](type, index)
	propkey = new

	propkey[:pid] = type

	guid = propkey[:fmtid]
	guid[:Data1] = 0x00000000 + index
	guid[:Data2] = 0x7363
	guid[:Data3] = 0x696e
	[0x84, 0x41, 0x79, 0x8a, 0xcf, 0x5a, 0xeb, 0xb7].each_with_index { |part, i|
		guid[:Data4][i] = part
	}

	propkey
end