s3: piddir creation fix part 2.
[ira/wip.git] / source3 / libgpo / gpo_reg.c
index 39d072f689dcbb5199a62f68346b322b43bc29b0..5142e919cc981e500bda634ab7af4d804b86ec56 100644 (file)
 #include "../libgpo/gpo.h"
 #include "libgpo/gpo_proto.h"
 #include "registry.h"
+#include "registry/reg_api.h"
 #include "registry/reg_backend_db.h"
+#include "registry/reg_api_util.h"
+#include "registry/reg_init_basic.h"
+#include "../libcli/security/security.h"
+#include "../libcli/registry/util_reg.h"
 
 
 /****************************************************************
@@ -31,13 +36,13 @@ struct security_token *registry_create_system_token(TALLOC_CTX *mem_ctx)
 {
        struct security_token *token = NULL;
 
-       token = TALLOC_ZERO_P(mem_ctx, struct security_token);
+       token = talloc_zero(mem_ctx, struct security_token);
        if (!token) {
                DEBUG(1,("talloc failed\n"));
                return NULL;
        }
 
-       token->privilege_mask = se_priv_all;
+       token->privilege_mask = SE_ALL_PRIVS;
 
        if (!NT_STATUS_IS_OK(add_sid_to_array(token, &global_sid_System,
                         &token->sids, &token->num_sids))) {
@@ -69,7 +74,7 @@ WERROR gp_init_reg_ctx(TALLOC_CTX *mem_ctx,
                return werr;
        }
 
-       tmp_ctx = TALLOC_ZERO_P(mem_ctx, struct gp_registry_context);
+       tmp_ctx = talloc_zero(mem_ctx, struct gp_registry_context);
        W_ERROR_HAVE_NO_MEMORY(tmp_ctx);
 
        if (token) {
@@ -323,7 +328,7 @@ static WERROR gp_reg_del_groupmembership(TALLOC_CTX *mem_ctx,
                                           flags);
        W_ERROR_HAVE_NO_MEMORY(path);
 
-       return reg_deletekey_recursive(mem_ctx, key, path);
+       return reg_deletekey_recursive(key, path);
 
 }
 
@@ -390,7 +395,7 @@ static WERROR gp_reg_read_groupmembership(TALLOC_CTX *mem_ctx,
        int num_token_sids = 0;
        struct security_token *tmp_token = NULL;
 
-       tmp_token = TALLOC_ZERO_P(mem_ctx, struct security_token);
+       tmp_token = talloc_zero(mem_ctx, struct security_token);
        W_ERROR_HAVE_NO_MEMORY(tmp_token);
 
        path = gp_reg_groupmembership_path(mem_ctx, object_sid, flags);
@@ -444,7 +449,7 @@ static WERROR gp_del_reg_state(TALLOC_CTX *mem_ctx,
                               struct registry_key *key,
                               const char *path)
 {
-       return reg_deletesubkeys_recursive(mem_ctx, key, path);
+       return reg_deletesubkeys_recursive(key, path);
 }
 
 /****************************************************************
@@ -597,7 +602,7 @@ static WERROR gp_read_reg_gpo(TALLOC_CTX *mem_ctx,
                return WERR_INVALID_PARAM;
        }
 
-       gpo = TALLOC_ZERO_P(mem_ctx, struct GROUP_POLICY_OBJECT);
+       gpo = talloc_zero(mem_ctx, struct GROUP_POLICY_OBJECT);
        W_ERROR_HAVE_NO_MEMORY(gpo);
 
        werr = gp_read_reg_gpovals(mem_ctx, key, gpo);
@@ -896,7 +901,7 @@ bool add_gp_registry_entry_to_array(TALLOC_CTX *mem_ctx,
                                    struct gp_registry_entry **entries,
                                    size_t *num)
 {
-       *entries = TALLOC_REALLOC_ARRAY(mem_ctx, *entries,
+       *entries = talloc_realloc(mem_ctx, *entries,
                                        struct gp_registry_entry,
                                        (*num)+1);