static bool act_val_hex(struct reg_parse* p, cbuf* value, bool cont) { cbuf_swap(p->valblob, value); assert((p->state == STATE_KEY_OPEN) || (p->state == STATE_VAL_HEX_CONT)); if (cont) { p->state = STATE_VAL_HEX_CONT; } else { p->state = STATE_KEY_OPEN; switch (p->valtype) { case REG_EXPAND_SZ: case REG_MULTI_SZ: if (p->str2UTF16 != NULL) { char* dst = NULL; const char* src = cbuf_gets(p->valblob, 0); const size_t slen = cbuf_getpos(p->valblob); size_t dlen = iconvert_talloc(p, p->str2UTF16, src, slen, &dst); if (dlen != -1) { cbuf_swapptr(p->valblob, &dst, dlen); } else { DEBUG(0, ("iconvert_talloc failed\n")); } talloc_free(dst); } default: break; } return value_callback(p); } return true; }
static bool act_val_sz(struct reg_parse* p, cbuf* value, bool cont) { cbuf_swap(p->valblob, value); assert(p->valtype == REG_SZ); assert((p->state == STATE_KEY_OPEN) || (p->state == STATE_VAL_SZ_CONT)); if (cont) { p->state = STATE_VAL_SZ_CONT; } else { char* dst = NULL; size_t dlen; const char* src = cbuf_gets(p->valblob, 0); p->state = STATE_KEY_OPEN; if (convert_string_talloc(p->valblob, CH_UNIX, CH_UTF16LE, src, strlen(src)+1, &dst, &dlen)) { cbuf_swapptr(p->valblob, &dst, dlen); } else { DEBUG(0, ("convert_string_talloc failed: >%s<\n" "use it as is\t", src)); } talloc_free(dst); return value_callback(p); } return true; }
void File_Browser::value_action_callback(const String & in) { value_callback(in); if (_value.type() != File::DIRECTORY) { ok_callback(true); } }
static bool act_val_dw(struct reg_parse* p, uint32_t val) { assert(p->valtype == REG_DWORD); assert(p->state == STATE_KEY_OPEN); cbuf_clear(p->valblob); if (cbuf_putdw(p->valblob, val) < 0) { return false; } return value_callback(p); }