Example #1
0
func (self *RegKey) SetValueQWORD(valueName string, data uint64) error {
	err := wrappers.RegSetValueEx(
		self.handle,
		syscall.StringToUTF16Ptr(valueName),
		0,
		wrappers.REG_QWORD,
		(*byte)(unsafe.Pointer(&data)),
		uint32(unsafe.Sizeof(data)))
	if err != nil {
		return NewWindowsError("RegSetValueEx", err)
	}
	return nil
}
Example #2
0
func (self *RegKey) SetValueString(valueName string, data string) error {
	err := wrappers.RegSetValueEx(
		self.handle,
		syscall.StringToUTF16Ptr(valueName),
		0,
		wrappers.REG_SZ,
		(*byte)(unsafe.Pointer(syscall.StringToUTF16Ptr(data))),
		uint32(2*(len(data)+1)))
	if err != nil {
		return NewWindowsError("RegSetValueEx", err)
	}
	return nil
}
Example #3
0
func (self *RegKey) SetValueBinary(valueName string, data []byte) error {
	err := wrappers.RegSetValueEx(
		self.handle,
		syscall.StringToUTF16Ptr(valueName),
		0,
		wrappers.REG_BINARY,
		&data[0],
		uint32(len(data)))
	if err != nil {
		return NewWindowsError("RegSetValueEx", err)
	}
	return nil
}