Make cli_session_setup_guest chainable
[ira/wip.git] / source3 / include / proto.h
index 3ddbf6f3b9d2722cb758e09b869f2fe2ca9590fc..c11d77d66f7e478a323ccb190864205866254028 100644 (file)
@@ -647,7 +647,6 @@ ssize_t drain_socket(int sockfd, size_t count);
 
 /* The following definitions come from lib/secdesc.c  */
 
-bool sec_desc_equal(SEC_DESC *s1, SEC_DESC *s2);
 uint32_t get_sec_info(const SEC_DESC *sd);
 SEC_DESC_BUF *sec_desc_merge(TALLOC_CTX *ctx, SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb);
 SEC_DESC *make_sec_desc(TALLOC_CTX *ctx,
@@ -1018,6 +1017,8 @@ void set_mtimespec(SMB_STRUCT_STAT *pst, struct timespec ts);
 struct timespec get_ctimespec(const SMB_STRUCT_STAT *pst);
 void set_ctimespec(SMB_STRUCT_STAT *pst, struct timespec ts);
 void dos_filetime_timespec(struct timespec *tsp);
+time_t make_unix_date2(const void *date_ptr, int zone_offset);
+time_t make_unix_date3(const void *date_ptr, int zone_offset);
 time_t srv_make_unix_date(const void *date_ptr);
 time_t srv_make_unix_date2(const void *date_ptr);
 time_t srv_make_unix_date3(const void *date_ptr);
@@ -1419,6 +1420,13 @@ struct tevent_req *read_smb_send(TALLOC_CTX *mem_ctx,
                                 int fd);
 ssize_t read_smb_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                      uint8_t **pbuf, int *perrno);
+struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
+                                   struct tevent_context *ev,
+                                   struct fncall_context *ctx,
+                                   const char *node,
+                                   const char *service,
+                                   const struct addrinfo *hints);
+int getaddrinfo_recv(struct tevent_req *req, struct addrinfo **res);
 
 /* The following definitions come from lib/util_str.c  */
 
@@ -2161,6 +2169,10 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
                           const char *pass, int passlen,
                           const char *ntpass, int ntpasslen,
                           const char *workgroup);
+struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
+                                                 struct event_context *ev,
+                                                 struct cli_state *cli,
+                                                 struct tevent_req **psmbreq);
 struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
                                                struct event_context *ev,
                                                struct cli_state *cli);
@@ -2325,27 +2337,58 @@ void cli_reset_error(struct cli_state *cli);
 
 /* The following definitions come from libsmb/clifile.c  */
 
-uint32 unix_perms_to_wire(mode_t perms);
-mode_t wire_perms_to_unix(uint32 perms);
+uint32_t unix_perms_to_wire(mode_t perms);
+mode_t wire_perms_to_unix(uint32_t perms);
 bool cli_unix_getfacl(struct cli_state *cli, const char *name, size_t *prb_size, char **retbuf);
 bool cli_unix_stat(struct cli_state *cli, const char *name, SMB_STRUCT_STAT *sbuf);
 bool cli_unix_symlink(struct cli_state *cli, const char *oldname, const char *newname);
 bool cli_unix_hardlink(struct cli_state *cli, const char *oldname, const char *newname);
 bool cli_unix_chmod(struct cli_state *cli, const char *fname, mode_t mode);
 bool cli_unix_chown(struct cli_state *cli, const char *fname, uid_t uid, gid_t gid);
-bool cli_rename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
-bool cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
-bool cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst);
-bool cli_unlink_full(struct cli_state *cli, const char *fname, uint16 attrs);
-bool cli_unlink(struct cli_state *cli, const char *fname);
+struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
+                                struct event_context *ev,
+                                struct cli_state *cli,
+                                const char *fname_src,
+                                const char *fname_dst);
+NTSTATUS cli_rename_recv(struct tevent_req *req);
+NTSTATUS cli_rename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
+struct tevent_req *cli_ntrename_send(TALLOC_CTX *mem_ctx,
+                                struct event_context *ev,
+                                struct cli_state *cli,
+                                const char *fname_src,
+                                const char *fname_dst);
+NTSTATUS cli_ntrename_recv(struct tevent_req *req);
+NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
+
+struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx,
+                                struct event_context *ev,
+                                struct cli_state *cli,
+                                const char *fname_src,
+                                const char *fname_dst);
+NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req);
+NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst);
+
+struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
+                                struct event_context *ev,
+                                struct cli_state *cli,
+                                const char *fname,
+                                uint16_t mayhave_attrs);
+NTSTATUS cli_unlink_recv(struct tevent_req *req);
+NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_attrs);
+
+struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
+                                 struct event_context *ev,
+                                 struct cli_state *cli,
+                                 const char *dname);
+NTSTATUS cli_mkdir_recv(struct tevent_req *req);
 NTSTATUS cli_mkdir(struct cli_state *cli, const char *dname);
-bool cli_rmdir(struct cli_state *cli, const char *dname);
-int cli_nt_delete_on_close(struct cli_state *cli, int fnum, bool flag);
-int cli_nt_create_full(struct cli_state *cli, const char *fname,
-                uint32 CreatFlags, uint32 DesiredAccess,
-                uint32 FileAttributes, uint32 ShareAccess,
-                uint32 CreateDisposition, uint32 CreateOptions,
-                uint8 SecuityFlags);
+struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
+                                 struct event_context *ev,
+                                 struct cli_state *cli,
+                                 const char *dname);
+NTSTATUS cli_rmdir_recv(struct tevent_req *req);
+NTSTATUS cli_rmdir(struct cli_state *cli, const char *dname);
+int cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
 struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
                                     struct event_context *ev,
                                     struct cli_state *cli,
@@ -2368,7 +2411,6 @@ NTSTATUS cli_ntcreate(struct cli_state *cli,
                      uint32_t CreateOptions,
                      uint8_t SecurityFlags,
                      uint16_t *pfid);
-int cli_nt_create(struct cli_state *cli, const char *fname, uint32 DesiredAccess);
 uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
                            size_t str_len, size_t *pconverted_size);
 struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
@@ -2379,62 +2421,126 @@ struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
 struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
                                 struct cli_state *cli, const char *fname,
                                 int flags, int share_mode);
-NTSTATUS cli_open_recv(struct tevent_req *req, int *fnum);
-int cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode);
+NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *fnum);
+NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
 struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
                                    struct event_context *ev,
-                                   struct cli_state *cli, int fnum,
+                                   struct cli_state *cli, uint16_t fnum,
                                    struct tevent_req **psubreq);
 struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
                                  struct event_context *ev,
-                                 struct cli_state *cli, int fnum);
+                                 struct cli_state *cli, uint16_t fnum);
 NTSTATUS cli_close_recv(struct tevent_req *req);
-bool cli_close(struct cli_state *cli, int fnum);
-bool cli_ftruncate(struct cli_state *cli, int fnum, uint64_t size);
-NTSTATUS cli_locktype(struct cli_state *cli, int fnum,
-                     uint32 offset, uint32 len,
+NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum);
+bool cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size);
+NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
+                     uint32_t offset, uint32_t len,
                      int timeout, unsigned char locktype);
-bool cli_lock(struct cli_state *cli, int fnum,
-             uint32 offset, uint32 len, int timeout, enum brl_type lock_type);
-bool cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len);
-bool cli_lock64(struct cli_state *cli, int fnum,
+bool cli_lock(struct cli_state *cli, uint16_t fnum,
+             uint32_t offset, uint32_t len, int timeout, enum brl_type lock_type);
+bool cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len);
+bool cli_lock64(struct cli_state *cli, uint16_t fnum,
                uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type);
-bool cli_unlock64(struct cli_state *cli, int fnum, uint64_t offset, uint64_t len);
-bool cli_posix_lock(struct cli_state *cli, int fnum,
+bool cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
+bool cli_posix_lock(struct cli_state *cli, uint16_t fnum,
                        uint64_t offset, uint64_t len,
                        bool wait_lock, enum brl_type lock_type);
-bool cli_posix_unlock(struct cli_state *cli, int fnum, uint64_t offset, uint64_t len);
-bool cli_posix_getlock(struct cli_state *cli, int fnum, uint64_t *poffset, uint64_t *plen);
-bool cli_getattrE(struct cli_state *cli, int fd,
-                 uint16 *attr, SMB_OFF_T *size,
-                 time_t *change_time,
-                  time_t *access_time,
-                  time_t *write_time);
-bool cli_getatr(struct cli_state *cli, const char *fname,
-               uint16 *attr, SMB_OFF_T *size, time_t *write_time);
-bool cli_setattrE(struct cli_state *cli, int fd,
-                 time_t change_time,
-                  time_t access_time,
-                  time_t write_time);
-bool cli_setatr(struct cli_state *cli, const char *fname, uint16 attr, time_t t);
-bool cli_chkpath(struct cli_state *cli, const char *path);
-bool cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
+bool cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
+bool cli_posix_getlock(struct cli_state *cli, uint16_t fnum, uint64_t *poffset, uint64_t *plen);
+struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
+                               struct event_context *ev,
+                               struct cli_state *cli,
+                                uint16_t fnum);
+NTSTATUS cli_getattrE_recv(struct tevent_req *req,
+                        uint16_t *attr,
+                        SMB_OFF_T *size,
+                        time_t *change_time,
+                        time_t *access_time,
+                        time_t *write_time);
+NTSTATUS cli_getattrE(struct cli_state *cli,
+                       uint16_t fnum,
+                       uint16_t *attr,
+                       SMB_OFF_T *size,
+                       time_t *change_time,
+                       time_t *access_time,
+                       time_t *write_time);
+struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx,
+                               struct event_context *ev,
+                               struct cli_state *cli,
+                               uint16_t fnum,
+                               time_t change_time,
+                               time_t access_time,
+                               time_t write_time);
+NTSTATUS cli_setattrE_recv(struct tevent_req *req);
+NTSTATUS cli_setattrE(struct cli_state *cli,
+                       uint16_t fnum,
+                       time_t change_time,
+                       time_t access_time,
+                       time_t write_time);
+struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
+                               struct event_context *ev,
+                               struct cli_state *cli,
+                               const char *fname);
+NTSTATUS cli_getatr_recv(struct tevent_req *req,
+                               uint16_t *attr,
+                               SMB_OFF_T *size,
+                               time_t *write_time);
+NTSTATUS cli_getatr(struct cli_state *cli,
+                       const char *fname,
+                       uint16_t *attr,
+                       SMB_OFF_T *size,
+                       time_t *write_time);
+struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
+                               struct event_context *ev,
+                               struct cli_state *cli,
+                               const char *fname,
+                               uint16_t attr,
+                               time_t mtime);
+NTSTATUS cli_setatr_recv(struct tevent_req *req);
+NTSTATUS cli_setatr(struct cli_state *cli,
+                const char *fname,
+                uint16_t attr,
+                time_t mtime);
+struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
+                                 struct event_context *ev,
+                                 struct cli_state *cli,
+                                 const char *fname);
+NTSTATUS cli_chkpath_recv(struct tevent_req *req);
+NTSTATUS cli_chkpath(struct cli_state *cli, const char *path);
+struct tevent_req *cli_dskattr_send(TALLOC_CTX *mem_ctx,
+                                 struct event_context *ev,
+                                 struct cli_state *cli);
+NTSTATUS cli_dskattr_recv(struct tevent_req *req, int *bsize, int *total,
+                         int *avail);
+NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
 int cli_ctemp(struct cli_state *cli, const char *path, char **tmp_path);
-NTSTATUS cli_raw_ioctl(struct cli_state *cli, int fnum, uint32 code, DATA_BLOB *blob);
+NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob);
 bool cli_set_ea_path(struct cli_state *cli, const char *path, const char *ea_name, const char *ea_val, size_t ea_len);
-bool cli_set_ea_fnum(struct cli_state *cli, int fnum, const char *ea_name, const char *ea_val, size_t ea_len);
+bool cli_set_ea_fnum(struct cli_state *cli, uint16_t fnum, const char *ea_name, const char *ea_val, size_t ea_len);
 bool cli_get_ea_list_path(struct cli_state *cli, const char *path,
                TALLOC_CTX *ctx,
                size_t *pnum_eas,
                struct ea_struct **pea_list);
-bool cli_get_ea_list_fnum(struct cli_state *cli, int fnum,
+bool cli_get_ea_list_fnum(struct cli_state *cli, uint16_t fnum,
                TALLOC_CTX *ctx,
                size_t *pnum_eas,
                struct ea_struct **pea_list);
 int cli_posix_open(struct cli_state *cli, const char *fname, int flags, mode_t mode);
 int cli_posix_mkdir(struct cli_state *cli, const char *fname, mode_t mode);
-bool cli_posix_unlink(struct cli_state *cli, const char *fname);
-int cli_posix_rmdir(struct cli_state *cli, const char *fname);
+
+struct tevent_req *cli_posix_unlink_send(TALLOC_CTX *mem_ctx,
+                                       struct event_context *ev,
+                                       struct cli_state *cli,
+                                       const char *fname);
+NTSTATUS cli_posix_unlink_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+NTSTATUS cli_posix_unlink(struct cli_state *cli, const char *fname);
+
+struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx,
+                                       struct event_context *ev,
+                                       struct cli_state *cli,
+                                       const char *fname);
+NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname);
 
 /* The following definitions come from libsmb/clifsinfo.c  */
 
@@ -2507,9 +2613,9 @@ struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx,
                                       struct cli_state *cli,
                                       uint16_t fnum, uint8_t level);
 NTSTATUS cli_oplock_ack_recv(struct tevent_req *req);
-bool cli_oplock_ack(struct cli_state *cli, int fnum, unsigned char level);
+NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level);
 void cli_oplock_handler(struct cli_state *cli, 
-                       bool (*handler)(struct cli_state *, int, unsigned char));
+                       NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char));
 
 /* The following definitions come from libsmb/cliprint.c  */
 
@@ -2517,11 +2623,11 @@ int cli_print_queue(struct cli_state *cli,
                    void (*fn)(struct print_job_info *));
 int cli_printjob_del(struct cli_state *cli, int job);
 int cli_spl_open(struct cli_state *cli, const char *fname, int flags, int share_mode);
-bool cli_spl_close(struct cli_state *cli, int fnum);
+bool cli_spl_close(struct cli_state *cli, uint16_t fnum);
 
 /* The following definitions come from libsmb/cliquota.c  */
 
-bool cli_get_quota_handle(struct cli_state *cli, int *quota_fnum);
+NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum);
 void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list);
 bool cli_get_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
 bool cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
@@ -2569,8 +2675,8 @@ bool cli_qpathinfo_streams(struct cli_state *cli, const char *fname,
                           TALLOC_CTX *mem_ctx,
                           unsigned int *pnum_streams,
                           struct stream_struct **pstreams);
-bool cli_qfilename(struct cli_state *cli, int fnum, char *name, size_t namelen);
-bool cli_qfileinfo(struct cli_state *cli, int fnum,
+bool cli_qfilename(struct cli_state *cli, uint16_t fnum, char *name, size_t namelen);
+bool cli_qfileinfo(struct cli_state *cli, uint16_t fnum,
                   uint16 *mode, SMB_OFF_T *size,
                   struct timespec *create_time,
                    struct timespec *access_time,
@@ -2579,7 +2685,7 @@ bool cli_qfileinfo(struct cli_state *cli, int fnum,
                    SMB_INO_T *ino);
 bool cli_qpathinfo_basic( struct cli_state *cli, const char *name,
                           SMB_STRUCT_STAT *sbuf, uint32 *attributes );
-bool cli_qfileinfo_test(struct cli_state *cli, int fnum, int level, char **poutdata, uint32 *poutlen);
+bool cli_qfileinfo_test(struct cli_state *cli, uint16_t fnum, int level, char **poutdata, uint32 *poutlen);
 NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
 
 /* The following definitions come from libsmb/clirap2.c  */
@@ -2636,12 +2742,12 @@ int cli_NetConnectionEnum(struct cli_state *cli, const char *qualifier,
 
 struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx,
                                        struct event_context *ev,
-                                       struct cli_state *cli, int fnum,
+                                       struct cli_state *cli, uint16_t fnum,
                                        off_t offset, size_t size,
                                        struct tevent_req **psmbreq);
 struct tevent_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
                                      struct event_context *ev,
-                                     struct cli_state *cli, int fnum,
+                                     struct cli_state *cli, uint16_t fnum,
                                      off_t offset, size_t size);
 NTSTATUS cli_read_andx_recv(struct tevent_req *req, ssize_t *received,
                            uint8_t **rcvbuf);
@@ -2658,14 +2764,14 @@ NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
                  off_t start_offset, SMB_OFF_T size, size_t window_size,
                  NTSTATUS (*sink)(char *buf, size_t n, void *priv),
                  void *priv, SMB_OFF_T *received);
-ssize_t cli_read(struct cli_state *cli, int fnum, char *buf,
+ssize_t cli_read(struct cli_state *cli, uint16_t fnum, char *buf,
                 off_t offset, size_t size);
-ssize_t cli_readraw(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size);
+ssize_t cli_readraw(struct cli_state *cli, uint16_t fnum, char *buf, off_t offset, size_t size);
 ssize_t cli_write(struct cli_state *cli,
-                int fnum, uint16 write_mode,
+                uint16_t fnum, uint16 write_mode,
                 const char *buf, off_t offset, size_t size);
 ssize_t cli_smbwrite(struct cli_state *cli,
-                    int fnum, char *buf, off_t offset, size_t size1);
+                    uint16_t fnum, char *buf, off_t offset, size_t size1);
 struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
                                         struct event_context *ev,
                                         struct cli_state *cli, uint16_t fnum,
@@ -2696,9 +2802,9 @@ NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
 
 /* The following definitions come from libsmb/clisecdesc.c  */
 
-SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum, 
+SEC_DESC *cli_query_secdesc(struct cli_state *cli, uint16_t fnum, 
                            TALLOC_CTX *mem_ctx);
-bool cli_set_secdesc(struct cli_state *cli, int fnum, SEC_DESC *sd);
+bool cli_set_secdesc(struct cli_state *cli, uint16_t fnum, SEC_DESC *sd);
 
 /* The following definitions come from libsmb/clispnego.c  */
 
@@ -4042,6 +4148,8 @@ bool lp_string_is_valid_boolean(const char *parm_value);
 bool lp_invert_boolean(const char *str, const char **inverse_str);
 bool lp_canonicalize_boolean(const char *str, const char**canon_str);
 bool service_ok(int iService);
+bool process_registry_service(const char *service_name);
+bool process_registry_shares(void);
 bool lp_config_backend_is_registry(void);
 bool lp_config_backend_is_file(void);
 bool lp_file_list_changed(void);
@@ -4609,7 +4717,7 @@ WERROR delete_all_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key );
 WERROR delete_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const char *value );
 WERROR add_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const char *value, 
                            uint32 type, uint8 *data, int real_len );
-REGISTRY_VALUE* get_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const char *value );
+struct regval_blob* get_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const char *value );
 WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level);
 bool set_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level);
 bool del_driver_init(const char *drivername);
@@ -4714,12 +4822,9 @@ bool print_job_end(int snum, uint32 jobid, enum file_close_type close_type);
 int print_queue_status(int snum, 
                       print_queue_struct **ppqueue,
                       print_status_struct *status);
-bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum,
-                      WERROR *errcode);
-bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum,
-                       WERROR *errcode);
-bool print_queue_purge(struct auth_serversupplied_info *server_info, int snum,
-                      WERROR *errcode);
+WERROR print_queue_pause(struct auth_serversupplied_info *server_info, int snum);
+WERROR print_queue_resume(struct auth_serversupplied_info *server_info, int snum);
+WERROR print_queue_purge(struct auth_serversupplied_info *server_info, int snum);
 
 /* The following definitions come from printing/printing_db.c  */
 
@@ -4802,10 +4907,10 @@ WERROR regdb_transaction_cancel(void);
 int regdb_get_seqnum(void);
 bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr);
 int regdb_fetch_keys(const char *key, struct regsubkey_ctr *ctr);
-int regdb_fetch_values( const char* key, REGVAL_CTR *values );
-bool regdb_store_values( const char *key, REGVAL_CTR *values );
+int regdb_fetch_values(const char* key, struct regval_ctr *values);
+bool regdb_store_values(const char *key, struct regval_ctr *values);
 bool regdb_subkeys_need_update(struct regsubkey_ctr *subkeys);
-bool regdb_values_need_update(REGVAL_CTR *values);
+bool regdb_values_need_update(struct regval_ctr *values);
 
 /* The following definitions come from registry/reg_backend_hkpt_params.c  */
 
@@ -4834,26 +4939,31 @@ bool regdb_values_need_update(REGVAL_CTR *values);
 /* The following definitions come from registry/reg_cachehook.c  */
 
 WERROR reghook_cache_init(void);
-WERROR reghook_cache_add(const char *keyname, REGISTRY_OPS *ops);
-REGISTRY_OPS *reghook_cache_find(const char *keyname);
+WERROR reghook_cache_add(const char *keyname, struct registry_ops *ops);
+struct registry_ops *reghook_cache_find(const char *keyname);
 void reghook_dump_cache( int debuglevel );
 
 /* The following definitions come from registry/reg_dispatcher.c  */
 
-bool store_reg_keys( REGISTRY_KEY *key, struct regsubkey_ctr *subkeys );
-bool store_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val );
-WERROR create_reg_subkey(REGISTRY_KEY *key, const char *subkey);
-WERROR delete_reg_subkey(REGISTRY_KEY *key, const char *subkey);
-int fetch_reg_keys( REGISTRY_KEY *key, struct regsubkey_ctr *subkey_ctr );
-int fetch_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val );
-bool regkey_access_check( REGISTRY_KEY *key, uint32 requested, uint32 *granted,
-                         const struct nt_user_token *token );
-WERROR regkey_get_secdesc(TALLOC_CTX *mem_ctx, REGISTRY_KEY *key,
+bool store_reg_keys(struct registry_key_handle *key,
+                   struct regsubkey_ctr *subkeys);
+bool store_reg_values(struct registry_key_handle *key, struct regval_ctr *val);
+WERROR create_reg_subkey(struct registry_key_handle *key, const char *subkey);
+WERROR delete_reg_subkey(struct registry_key_handle *key, const char *subkey);
+int fetch_reg_keys(struct registry_key_handle *key,
+                  struct regsubkey_ctr *subkey_ctr);
+int fetch_reg_values(struct registry_key_handle *key, struct regval_ctr *val);
+bool regkey_access_check(struct registry_key_handle *key, uint32 requested,
+                        uint32 *granted,
+                        const struct nt_user_token *token);
+WERROR regkey_get_secdesc(TALLOC_CTX *mem_ctx, struct registry_key_handle *key,
                          struct security_descriptor **psecdesc);
-WERROR regkey_set_secdesc(REGISTRY_KEY *key,
+WERROR regkey_set_secdesc(struct registry_key_handle *key,
                          struct security_descriptor *psecdesc);
-bool reg_subkeys_need_update(REGISTRY_KEY *key, struct regsubkey_ctr *subkeys);
-bool reg_values_need_update(REGISTRY_KEY *key, REGVAL_CTR *values);
+bool reg_subkeys_need_update(struct registry_key_handle *key,
+                            struct regsubkey_ctr *subkeys);
+bool reg_values_need_update(struct registry_key_handle *key,
+                           struct regval_ctr *values);
 
 /* The following definitions come from registry/reg_eventlog.c  */
 
@@ -4886,24 +4996,27 @@ WERROR regsubkey_ctr_delkey( struct regsubkey_ctr *ctr, const char *keyname );
 bool regsubkey_ctr_key_exists( struct regsubkey_ctr *ctr, const char *keyname );
 int regsubkey_ctr_numkeys( struct regsubkey_ctr *ctr );
 char* regsubkey_ctr_specific_key( struct regsubkey_ctr *ctr, uint32 key_index );
-int regval_ctr_numvals( REGVAL_CTR *ctr );
-REGISTRY_VALUE* dup_registry_value( REGISTRY_VALUE *val );
-void free_registry_value( REGISTRY_VALUE *val );
-uint8* regval_data_p( REGISTRY_VALUE *val );
-uint32 regval_size( REGISTRY_VALUE *val );
-char* regval_name( REGISTRY_VALUE *val );
-uint32 regval_type( REGISTRY_VALUE *val );
-REGISTRY_VALUE* regval_ctr_specific_value( REGVAL_CTR *ctr, uint32 idx );
-bool regval_ctr_key_exists( REGVAL_CTR *ctr, const char *value );
-REGISTRY_VALUE *regval_compose(TALLOC_CTX *ctx, const char *name, uint16 type,
-                              const char *data_p, size_t size);
-int regval_ctr_addvalue( REGVAL_CTR *ctr, const char *name, uint16 type,
-                         const char *data_p, size_t size );
-int regval_ctr_copyvalue( REGVAL_CTR *ctr, REGISTRY_VALUE *val );
-int regval_ctr_delvalue( REGVAL_CTR *ctr, const char *name );
-REGISTRY_VALUE* regval_ctr_getvalue( REGVAL_CTR *ctr, const char *name );
-uint32 regval_dword( REGISTRY_VALUE *val );
-char *regval_sz(REGISTRY_VALUE *val);
+int regval_ctr_numvals(struct regval_ctr *ctr);
+struct regval_blob* dup_registry_value(struct regval_blob *val);
+void free_registry_value(struct regval_blob *val);
+uint8* regval_data_p(struct regval_blob *val);
+uint32 regval_size(struct regval_blob *val);
+char* regval_name(struct regval_blob *val);
+uint32 regval_type(struct regval_blob *val);
+struct regval_blob* regval_ctr_specific_value(struct regval_ctr *ctr,
+                                             uint32 idx);
+bool regval_ctr_key_exists(struct regval_ctr *ctr, const char *value);
+struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name,
+                                  uint16 type,
+                                  const char *data_p, size_t size);
+int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint16 type,
+                       const char *data_p, size_t size);
+int regval_ctr_copyvalue(struct regval_ctr *ctr, struct regval_blob *val);
+int regval_ctr_delvalue(struct regval_ctr *ctr, const char *name);
+struct regval_blob* regval_ctr_getvalue(struct regval_ctr *ctr,
+                                       const char *name);
+uint32 regval_dword(struct regval_blob *val);
+char *regval_sz(struct regval_blob *val);
 
 /* The following definitions come from registry/reg_perfcount.c  */
 
@@ -4941,10 +5054,11 @@ size_t regval_build_multi_sz( char **values, uint16 **buffer );
 
 /* The following definitions come from registry/reg_util_legacy.c  */
 
-WERROR regkey_open_internal( TALLOC_CTX *ctx, REGISTRY_KEY **regkey,
-                            const char *path,
-                             const struct nt_user_token *token,
-                            uint32 access_desired );
+WERROR regkey_open_internal(TALLOC_CTX *ctx,
+                           struct registry_key_handle **regkey,
+                           const char *path,
+                           const struct nt_user_token *token,
+                           uint32 access_desired );
 
 /* The following definitions come from registry/regfio.c  */
 
@@ -5862,7 +5976,7 @@ SEC_DESC *svcctl_get_secdesc( TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *
 bool svcctl_set_secdesc( TALLOC_CTX *ctx, const char *name, SEC_DESC *sec_desc, NT_USER_TOKEN *token );
 const char *svcctl_lookup_dispname(TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *token );
 const char *svcctl_lookup_description(TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *token );
-REGVAL_CTR *svcctl_fetch_regvalues( const char *name, NT_USER_TOKEN *token );
+struct regval_ctr *svcctl_fetch_regvalues( const char *name, NT_USER_TOKEN *token );
 
 /* The following definitions come from services/svc_netlogon.c  */
 
@@ -7036,4 +7150,12 @@ void *avahi_start_register(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 
 /* Misc protos */
 
+struct fncall_context *fncall_context_init(TALLOC_CTX *mem_ctx,
+                                          int max_threads);
+struct tevent_req *fncall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+                              struct fncall_context *ctx,
+                              void (*fn)(void *private_data),
+                              void *private_data);
+int fncall_recv(struct tevent_req *req, int *perr);
+
 #endif /*  _PROTO_H_  */