Class: Fzeet::Windows::PROPERTYKEY

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/fzeet/windows/shell/Common.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.[](type, index) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fzeet/windows/shell/Common.rb', line 33

def self.[](type, index)
	new.tap { |key|
		key[:fmtid].tap { |guid|
			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
			}
		}

		key[:pid] = type
	}
end

Instance Method Details

#==(other) ⇒ Object



48
# File 'lib/fzeet/windows/shell/Common.rb', line 48

def ==(other) Windows.memcmp(other, self, size) == 0 end