Signed-off-by: Santino Mazza mazzasantino1206@gmail.com --- dlls/ncrypt/main.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c index 8e789573924..dbcb0087445 100644 --- a/dlls/ncrypt/main.c +++ b/dlls/ncrypt/main.c @@ -181,11 +181,10 @@ static struct object *allocate_object(enum object_type type) return ret; }
-static SECURITY_STATUS set_object_property(struct object *object, const WCHAR *name, BYTE *value, DWORD value_size) +struct object_property *create_object_property(struct object *object, const WCHAR *name) { struct object_property *property;
- FIXME("check duplicates\n"); if (!object->num_properties) { if (!(object->properties = malloc(sizeof(*property)))) @@ -215,8 +214,18 @@ static SECURITY_STATUS set_object_property(struct object *object, const WCHAR *n }
lstrcpyW(property->key, name); + + return property; +} + +static SECURITY_STATUS set_object_property(struct object *object, const WCHAR *name, BYTE *value, DWORD value_size) +{ + struct object_property *property = get_object_property(object, name); + + if(!property) property = create_object_property(object, name); + property->value_size = value_size; - if (!(property->value = malloc(value_size))) + if (!(property->value = realloc(property->value, value_size))) { ERR("Error allocating memory."); free(property->key);