s3:ldap: Use #ifdef instead of #if for config.h definitions
[samba.git] / source3 / include / registry.h
index 703176f3391c10c52f248b53433476d8cb14d89d..7d2aad9d64d817cd3645b19a015e62d626264999 100644 (file)
 #ifndef _REGISTRY_H
 #define _REGISTRY_H
 
-/*
- * A REG_SZ string is not necessarily NULL terminated. When retrieving it from
- * the net, we guarantee this however. A server might want to push it without
- * the terminator though.
- */
-
-struct registry_string {
-       size_t len;
-       char *str;
-};
+#include "../librpc/gen_ndr/winreg.h"
 
 struct registry_value {
        enum winreg_Type type;
-       union {
-               uint32 dword;
-               uint64 qword;
-               struct registry_string sz;
-               struct {
-                       uint32 num_strings;
-                       char **strings;
-               } multi_sz;
-               DATA_BLOB binary;
-       } v;
+       DATA_BLOB data;
 };
 
 /* forward declarations. definitions in reg_objects.c */
@@ -63,11 +45,11 @@ struct registry_ops {
        int     (*fetch_values) ( const char *key, struct regval_ctr *val );
        bool    (*store_subkeys)( const char *key, struct regsubkey_ctr *subkeys );
        WERROR  (*create_subkey)(const char *key, const char *subkey);
-       WERROR  (*delete_subkey)(const char *key, const char *subkey);
+       WERROR  (*delete_subkey)(const char *key, const char *subkey, bool lazy);
        bool    (*store_values)( const char *key, struct regval_ctr *val );
-       bool    (*reg_access_check)( const char *keyname, uint32 requested,
-                                    uint32 *granted,
-                                    const NT_USER_TOKEN *token );
+       bool    (*reg_access_check)( const char *keyname, uint32_t requested,
+                                    uint32_t *granted,
+                                    const struct security_token *token );
        WERROR (*get_secdesc)(TALLOC_CTX *mem_ctx, const char *key,
                              struct security_descriptor **psecdesc);
        WERROR (*set_secdesc)(const char *key,
@@ -79,9 +61,9 @@ struct registry_ops {
 /* structure to store the registry handles */
 
 struct registry_key_handle {
-       uint32          type;
+       uint32_t        type;
        char            *name;          /* full name of registry key */
-       uint32          access_granted;
+       uint32_t        access_granted;
        struct registry_ops     *ops;
 };
 
@@ -89,7 +71,7 @@ struct registry_key {
        struct registry_key_handle *key;
        struct regsubkey_ctr *subkeys;
        struct regval_ctr *values;
-       struct nt_user_token *token;
+       struct security_token *token;
 };
 
 
@@ -121,6 +103,7 @@ struct registry_key {
 #define KEY_TCPIP_PARAMS       "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"
 #define KEY_PROD_OPTIONS       "HKLM\\SYSTEM\\CurrentControlSet\\Control\\ProductOptions"
 #define KEY_PRINTING           "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print"
+#define KEY_PCC                        "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\PackageInstallation"
 #define KEY_PRINTING_2K                "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Printers"
 #define KEY_PRINTING_PORTS     "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Ports"
 #define KEY_CURRENT_VERSION    "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"
@@ -147,71 +130,4 @@ struct registry_key {
 #define REG_KEY_HKPD           1
 #define REG_KEY_HKPT           2
 
-
-/* The following definitions come from registry/reg_api.c  */
-
-WERROR reg_openhive(TALLOC_CTX *mem_ctx, const char *hive,
-                   uint32 desired_access,
-                   const struct nt_user_token *token,
-                   struct registry_key **pkey);
-WERROR reg_openkey(TALLOC_CTX *mem_ctx, struct registry_key *parent,
-                  const char *name, uint32 desired_access,
-                  struct registry_key **pkey);
-WERROR reg_enumkey(TALLOC_CTX *mem_ctx, struct registry_key *key,
-                  uint32 idx, char **name, NTTIME *last_write_time);
-WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key,
-                    uint32 idx, char **pname, struct registry_value **pval);
-WERROR reg_queryvalue(TALLOC_CTX *mem_ctx, struct registry_key *key,
-                     const char *name, struct registry_value **pval);
-WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys,
-                       uint32_t *max_subkeylen, uint32_t *max_subkeysize,
-                       uint32_t *num_values, uint32_t *max_valnamelen,
-                       uint32_t *max_valbufsize, uint32_t *secdescsize,
-                       NTTIME *last_changed_time);
-WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent,
-                    const char *subkeypath, uint32 desired_access,
-                    struct registry_key **pkey,
-                    enum winreg_CreateAction *paction);
-WERROR reg_deletekey(struct registry_key *parent, const char *path);
-WERROR reg_setvalue(struct registry_key *key, const char *name,
-                   const struct registry_value *val);
-WERROR reg_deletevalue(struct registry_key *key, const char *name);
-WERROR reg_getkeysecurity(TALLOC_CTX *mem_ctx, struct registry_key *key,
-                         struct security_descriptor **psecdesc);
-WERROR reg_setkeysecurity(struct registry_key *key,
-                         struct security_descriptor *psecdesc);
-WERROR reg_getversion(uint32_t *version);
-WERROR reg_restorekey(struct registry_key *key, const char *fname);
-WERROR reg_savekey(struct registry_key *key, const char *fname);
-WERROR reg_deleteallvalues(struct registry_key *key);
-WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path,
-                    uint32 desired_access, const struct nt_user_token *token,
-                    struct registry_key **pkey);
-WERROR reg_deletekey_recursive(TALLOC_CTX *ctx,
-                              struct registry_key *parent,
-                              const char *path);
-WERROR reg_deletesubkeys_recursive(TALLOC_CTX *ctx,
-                                  struct registry_key *parent,
-                                  const char *path);
-WERROR reg_create_path(TALLOC_CTX *mem_ctx, const char *orig_path,
-                      uint32 desired_access,
-                      const struct nt_user_token *token,
-                      enum winreg_CreateAction *paction,
-                      struct registry_key **pkey);
-WERROR reg_delete_path(const struct nt_user_token *token,
-                      const char *orig_path);
-
-/* The following definitions come from registry/reg_init_basic.c  */
-
-WERROR registry_init_common(void);
-WERROR registry_init_basic(void);
-
-/* The following definitions come from registry/reg_init_full.c  */
-
-WERROR registry_init_full(void);
-
-/* The following definitions come from registry/reg_init_smbconf.c  */
-
-WERROR registry_init_smbconf(const char *keyname);
-
 #endif /* _REGISTRY_H */