Ejemplo n.º 1
0
static PyObject *
py_hivex_node_set_value (PyObject *self, PyObject *args)
{
  PyObject *py_r;
  int r;
  hive_h *h;
  PyObject *py_h;
  long node;
  hive_set_value val;
  PyObject *py_val;

  if (!PyArg_ParseTuple (args, (char *) "OlO:hivex_node_set_value", &py_h, &node, &py_val))
    return NULL;
  h = get_handle (py_h);
  if (get_value (py_val, &val) == -1)
    return NULL;
  r = hivex_node_set_value (h, node, &val, 0);
  if (r == -1) {
    PyErr_SetString (PyExc_RuntimeError,
                     strerror (errno));
    return NULL;
  }

  Py_INCREF (Py_None);
  py_r = Py_None;
  return py_r;
}
Ejemplo n.º 2
0
int
do_hivex_node_set_value (int64_t nodeh,
                         const char *key, int64_t t,
                         const char *val, size_t val_size)
{
  const hive_set_value v =
    { .key = (char *) key, .t = t, .len = val_size, .value = (char *) val };

  NEED_HANDLE (-1);

  if (hivex_node_set_value (h, nodeh, &v, 0) == -1) {
    reply_with_perror ("failed");
    return -1;
  }

  return 0;
}

#else /* !HAVE_HIVEX */

OPTGROUP_HIVEX_NOT_AVAILABLE