summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-23 13:06:04 +0100
committerGünther Deschner <gd@samba.org>2009-02-23 16:17:37 +0100
commit2efa7cf6d9b20fe20a2bd6b0e64625c5082f97f1 (patch)
treee3ffc9e0ac4a3fba57b2f58b09f9928885dd5e5f
parent418691c2e7eae156b10ae29cf443e26cede92e93 (diff)
downloadsamba-2efa7cf6d9b20fe20a2bd6b0e64625c5082f97f1.tar.gz
samba-2efa7cf6d9b20fe20a2bd6b0e64625c5082f97f1.tar.bz2
samba-2efa7cf6d9b20fe20a2bd6b0e64625c5082f97f1.zip
s3-spoolss: add dup_spoolss_NotifyOption.
Guenther
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 33f139676c..4b7d42df54 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -2885,6 +2885,57 @@ static bool srv_spoolss_replyopenprinter(int snum, const char *printer,
return (W_ERROR_IS_OK(result));
}
+/****************************************************************
+ ****************************************************************/
+
+static struct spoolss_NotifyOption *dup_spoolss_NotifyOption(TALLOC_CTX *mem_ctx,
+ const struct spoolss_NotifyOption *r)
+{
+ struct spoolss_NotifyOption *option;
+ uint32_t i,k;
+
+ if (!r) {
+ return NULL;
+ }
+
+ option = talloc_zero(mem_ctx, struct spoolss_NotifyOption);
+ if (!option) {
+ return NULL;
+ }
+
+ *option = *r;
+
+ if (!option->count) {
+ return option;
+ }
+
+ option->types = talloc_zero_array(option,
+ struct spoolss_NotifyOptionType, option->count);
+ if (!option->types) {
+ talloc_free(option);
+ return NULL;
+ }
+
+ for (i=0; i < option->count; i++) {
+ option->types[i] = r->types[i];
+
+ if (option->types[i].count) {
+ option->types[i].fields = talloc_zero_array(option,
+ enum spoolss_Field, option->types[i].count);
+ if (!option->types[i].fields) {
+ talloc_free(option);
+ return NULL;
+ }
+ for (k=0; k<option->types[i].count; k++) {
+ option->types[i].fields[k] =
+ r->types[i].fields[k];
+ }
+ }
+ }
+
+ return option;
+}
+
/********************************************************************
* _spoolss_rffpcnex
* ReplyFindFirstPrinterChangeNotifyEx