summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in9
-rw-r--r--source3/librpc/gen_ndr/ndr_winreg.c252
-rw-r--r--source3/librpc/gen_ndr/winreg.h18
-rw-r--r--source3/librpc/idl/dfs.idl234
-rw-r--r--source3/librpc/idl/echo.idl128
-rw-r--r--source3/librpc/idl/eventlog.idl178
-rw-r--r--source3/librpc/idl/idl_types.h86
-rw-r--r--source3/librpc/idl/initshutdown.idl47
-rw-r--r--source3/librpc/idl/lsa.idl976
-rw-r--r--source3/librpc/idl/misc.idl47
-rw-r--r--source3/librpc/idl/netlogon.idl1203
-rw-r--r--source3/librpc/idl/ntsvcs.idl77
-rw-r--r--source3/librpc/idl/samr.idl1235
-rw-r--r--source3/librpc/idl/security.idl355
-rw-r--r--source3/librpc/idl/spoolss.idl1417
-rw-r--r--source3/librpc/idl/srvsvc.idl1504
-rw-r--r--source3/librpc/idl/svcctl.idl446
-rw-r--r--source3/librpc/idl/unixinfo.idl56
-rw-r--r--source3/librpc/idl/winreg.idl365
-rw-r--r--source3/librpc/idl/wkssvc.idl394
-rw-r--r--source3/script/build_idl.sh2
21 files changed, 8849 insertions, 180 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 6cdc5126be..329e9c9d51 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -849,14 +849,7 @@ cac: SHOWFLAGS $(LIBMSRPC)
## Perl IDL Compiler
IDL_FILES = unixinfo.idl lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl
-pidl/Makefile: pidl/Makefile.PL
- @echo Building Perl IDL Compiler....
- @cd $(srcdir)/pidl && $(PERL) Makefile.PL
-
-pidl/lib/Parse/Pidl/IDL.pm: pidl/Makefile
- @cd $(srcdir)/pidl && make
-
-idl: pidl/lib/Parse/Pidl/IDL.pm
+idl:
@IDL_FILES="$(IDL_FILES)" CPP="$(CPP)" PERL="$(PERL)" \
srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh $(PIDL_ARGS)
diff --git a/source3/librpc/gen_ndr/ndr_winreg.c b/source3/librpc/gen_ndr/ndr_winreg.c
index 0bd5528c9c..ca007bb449 100644
--- a/source3/librpc/gen_ndr/ndr_winreg.c
+++ b/source3/librpc/gen_ndr/ndr_winreg.c
@@ -2070,38 +2070,22 @@ NTSTATUS ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const str
if (r->out.class_out) {
NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.class_out));
}
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.num_subkeys));
- if (r->out.num_subkeys) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_subkeys));
- }
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.max_subkeylen));
- if (r->out.max_subkeylen) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_subkeylen));
- }
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.max_subkeysize));
- if (r->out.max_subkeysize) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_subkeysize));
- }
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.num_values));
- if (r->out.num_values) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_values));
- }
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.max_valnamelen));
- if (r->out.max_valnamelen) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_valnamelen));
- }
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.max_valbufsize));
- if (r->out.max_valbufsize) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_valbufsize));
- }
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.secdescsize));
- if (r->out.secdescsize) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.secdescsize));
- }
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.last_changed_time));
- if (r->out.last_changed_time) {
- NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->out.last_changed_time));
- }
+ if (r->out.num_subkeys == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_subkeys));
+ if (r->out.max_subkeylen == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_subkeylen));
+ if (r->out.max_subkeysize == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_subkeysize));
+ if (r->out.num_values == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_values));
+ if (r->out.max_valnamelen == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_valnamelen));
+ if (r->out.max_valbufsize == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_valbufsize));
+ if (r->out.secdescsize == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.secdescsize));
+ if (r->out.last_changed_time == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->out.last_changed_time));
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
}
return NT_STATUS_OK;
@@ -2110,14 +2094,6 @@ NTSTATUS ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const str
NTSTATUS ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r)
{
uint32_t _ptr_class_out;
- uint32_t _ptr_num_subkeys;
- uint32_t _ptr_max_subkeylen;
- uint32_t _ptr_max_subkeysize;
- uint32_t _ptr_num_values;
- uint32_t _ptr_max_valnamelen;
- uint32_t _ptr_max_valbufsize;
- uint32_t _ptr_secdescsize;
- uint32_t _ptr_last_changed_time;
TALLOC_CTX *_mem_save_handle_0;
TALLOC_CTX *_mem_save_class_out_0;
TALLOC_CTX *_mem_save_num_subkeys_0;
@@ -2139,6 +2115,22 @@ NTSTATUS ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct wi
NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.class_in));
+ NDR_PULL_ALLOC(ndr, r->out.num_subkeys);
+ ZERO_STRUCTP(r->out.num_subkeys);
+ NDR_PULL_ALLOC(ndr, r->out.max_subkeylen);
+ ZERO_STRUCTP(r->out.max_subkeylen);
+ NDR_PULL_ALLOC(ndr, r->out.max_subkeysize);
+ ZERO_STRUCTP(r->out.max_subkeysize);
+ NDR_PULL_ALLOC(ndr, r->out.num_values);
+ ZERO_STRUCTP(r->out.num_values);
+ NDR_PULL_ALLOC(ndr, r->out.max_valnamelen);
+ ZERO_STRUCTP(r->out.max_valnamelen);
+ NDR_PULL_ALLOC(ndr, r->out.max_valbufsize);
+ ZERO_STRUCTP(r->out.max_valbufsize);
+ NDR_PULL_ALLOC(ndr, r->out.secdescsize);
+ ZERO_STRUCTP(r->out.secdescsize);
+ NDR_PULL_ALLOC(ndr, r->out.last_changed_time);
+ ZERO_STRUCTP(r->out.last_changed_time);
}
if (flags & NDR_OUT) {
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_class_out));
@@ -2153,102 +2145,62 @@ NTSTATUS ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct wi
NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.class_out));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_class_out_0, 0);
}
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_num_subkeys));
- if (_ptr_num_subkeys) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.num_subkeys);
- } else {
- r->out.num_subkeys = NULL;
- }
- if (r->out.num_subkeys) {
- _mem_save_num_subkeys_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.num_subkeys, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_subkeys));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_subkeys_0, 0);
}
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_max_subkeylen));
- if (_ptr_max_subkeylen) {
+ _mem_save_num_subkeys_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.num_subkeys, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_subkeys));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_subkeys_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.max_subkeylen);
- } else {
- r->out.max_subkeylen = NULL;
}
- if (r->out.max_subkeylen) {
- _mem_save_max_subkeylen_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.max_subkeylen, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_subkeylen));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_subkeylen_0, 0);
- }
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_max_subkeysize));
- if (_ptr_max_subkeysize) {
+ _mem_save_max_subkeylen_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.max_subkeylen, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_subkeylen));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_subkeylen_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.max_subkeysize);
- } else {
- r->out.max_subkeysize = NULL;
- }
- if (r->out.max_subkeysize) {
- _mem_save_max_subkeysize_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.max_subkeysize, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_subkeysize));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_subkeysize_0, 0);
}
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_num_values));
- if (_ptr_num_values) {
+ _mem_save_max_subkeysize_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.max_subkeysize, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_subkeysize));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_subkeysize_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.num_values);
- } else {
- r->out.num_values = NULL;
}
- if (r->out.num_values) {
- _mem_save_num_values_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.num_values, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_values));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_values_0, 0);
- }
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_max_valnamelen));
- if (_ptr_max_valnamelen) {
+ _mem_save_num_values_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.num_values, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_values));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_values_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.max_valnamelen);
- } else {
- r->out.max_valnamelen = NULL;
- }
- if (r->out.max_valnamelen) {
- _mem_save_max_valnamelen_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.max_valnamelen, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_valnamelen));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_valnamelen_0, 0);
}
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_max_valbufsize));
- if (_ptr_max_valbufsize) {
+ _mem_save_max_valnamelen_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.max_valnamelen, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_valnamelen));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_valnamelen_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.max_valbufsize);
- } else {
- r->out.max_valbufsize = NULL;
- }
- if (r->out.max_valbufsize) {
- _mem_save_max_valbufsize_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.max_valbufsize, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_valbufsize));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_valbufsize_0, 0);
}
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdescsize));
- if (_ptr_secdescsize) {
+ _mem_save_max_valbufsize_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.max_valbufsize, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_valbufsize));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_valbufsize_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.secdescsize);
- } else {
- r->out.secdescsize = NULL;
}
- if (r->out.secdescsize) {
- _mem_save_secdescsize_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.secdescsize, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.secdescsize));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdescsize_0, 0);
- }
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_last_changed_time));
- if (_ptr_last_changed_time) {
+ _mem_save_secdescsize_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.secdescsize, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.secdescsize));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdescsize_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.last_changed_time);
- } else {
- r->out.last_changed_time = NULL;
- }
- if (r->out.last_changed_time) {
- _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.last_changed_time, 0);
- NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->out.last_changed_time));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, 0);
}
+ _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.last_changed_time, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->out.last_changed_time));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
}
return NT_STATUS_OK;
@@ -2282,51 +2234,35 @@ _PUBLIC_ void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *n
ndr->depth--;
ndr_print_ptr(ndr, "num_subkeys", r->out.num_subkeys);
ndr->depth++;
- if (r->out.num_subkeys) {
- ndr_print_uint32(ndr, "num_subkeys", *r->out.num_subkeys);
- }
+ ndr_print_uint32(ndr, "num_subkeys", *r->out.num_subkeys);
ndr->depth--;
ndr_print_ptr(ndr, "max_subkeylen", r->out.max_subkeylen);
ndr->depth++;
- if (r->out.max_subkeylen) {
- ndr_print_uint32(ndr, "max_subkeylen", *r->out.max_subkeylen);
- }
+ ndr_print_uint32(ndr, "max_subkeylen", *r->out.max_subkeylen);
ndr->depth--;
ndr_print_ptr(ndr, "max_subkeysize", r->out.max_subkeysize);
ndr->depth++;
- if (r->out.max_subkeysize) {
- ndr_print_uint32(ndr, "max_subkeysize", *r->out.max_subkeysize);
- }
+ ndr_print_uint32(ndr, "max_subkeysize", *r->out.max_subkeysize);
ndr->depth--;
ndr_print_ptr(ndr, "num_values", r->out.num_values);
ndr->depth++;
- if (r->out.num_values) {
- ndr_print_uint32(ndr, "num_values", *r->out.num_values);
- }
+ ndr_print_uint32(ndr, "num_values", *r->out.num_values);
ndr->depth--;
ndr_print_ptr(ndr, "max_valnamelen", r->out.max_valnamelen);
ndr->depth++;
- if (r->out.max_valnamelen) {
- ndr_print_uint32(ndr, "max_valnamelen", *r->out.max_valnamelen);
- }
+ ndr_print_uint32(ndr, "max_valnamelen", *r->out.max_valnamelen);
ndr->depth--;
ndr_print_ptr(ndr, "max_valbufsize", r->out.max_valbufsize);
ndr->depth++;
- if (r->out.max_valbufsize) {
- ndr_print_uint32(ndr, "max_valbufsize", *r->out.max_valbufsize);
- }
+ ndr_print_uint32(ndr, "max_valbufsize", *r->out.max_valbufsize);
ndr->depth--;
ndr_print_ptr(ndr, "secdescsize", r->out.secdescsize);
ndr->depth++;
- if (r->out.secdescsize) {
- ndr_print_uint32(ndr, "secdescsize", *r->out.secdescsize);
- }
+ ndr_print_uint32(ndr, "secdescsize", *r->out.secdescsize);
ndr->depth--;
ndr_print_ptr(ndr, "last_changed_time", r->out.last_changed_time);
ndr->depth++;
- if (r->out.last_changed_time) {
- ndr_print_NTTIME(ndr, "last_changed_time", *r->out.last_changed_time);
- }
+ ndr_print_NTTIME(ndr, "last_changed_time", *r->out.last_changed_time);
ndr->depth--;
ndr_print_WERROR(ndr, "result", r->out.result);
ndr->depth--;
@@ -3114,10 +3050,8 @@ NTSTATUS ndr_push_winreg_GetVersion(struct ndr_push *ndr, int flags, const struc
NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
}
if (flags & NDR_OUT) {
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.version));
- if (r->out.version) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.version));
- }
+ if (r->out.version == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.version));
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
}
return NT_STATUS_OK;
@@ -3125,7 +3059,6 @@ NTSTATUS ndr_push_winreg_GetVersion(struct ndr_push *ndr, int flags, const struc
NTSTATUS ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winreg_GetVersion *r)
{
- uint32_t _ptr_version;
TALLOC_CTX *_mem_save_handle_0;
TALLOC_CTX *_mem_save_version_0;
if (flags & NDR_IN) {
@@ -3138,20 +3071,17 @@ NTSTATUS ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winr
NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_PULL_ALLOC(ndr, r->out.version);
+ ZERO_STRUCTP(r->out.version);
}
if (flags & NDR_OUT) {
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_version));
- if (_ptr_version) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.version);
- } else {
- r->out.version = NULL;
- }
- if (r->out.version) {
- _mem_save_version_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.version, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.version));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_version_0, 0);
}
+ _mem_save_version_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.version, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.version));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_version_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
}
return NT_STATUS_OK;
@@ -3178,9 +3108,7 @@ _PUBLIC_ void ndr_print_winreg_GetVersion(struct ndr_print *ndr, const char *nam
ndr->depth++;
ndr_print_ptr(ndr, "version", r->out.version);
ndr->depth++;
- if (r->out.version) {
- ndr_print_uint32(ndr, "version", *r->out.version);
- }
+ ndr_print_uint32(ndr, "version", *r->out.version);
ndr->depth--;
ndr_print_WERROR(ndr, "result", r->out.result);
ndr->depth--;
diff --git a/source3/librpc/gen_ndr/winreg.h b/source3/librpc/gen_ndr/winreg.h
index eadcc2fef4..bdc377783d 100644
--- a/source3/librpc/gen_ndr/winreg.h
+++ b/source3/librpc/gen_ndr/winreg.h
@@ -315,14 +315,14 @@ struct winreg_QueryInfoKey {
struct {
struct winreg_String *class_out;/* [unique,keepref] */
- uint32_t *num_subkeys;/* [unique,keepref] */
- uint32_t *max_subkeylen;/* [unique,keepref] */
- uint32_t *max_subkeysize;/* [unique,keepref] */
- uint32_t *num_values;/* [unique,keepref] */
- uint32_t *max_valnamelen;/* [unique,keepref] */
- uint32_t *max_valbufsize;/* [unique,keepref] */
- uint32_t *secdescsize;/* [unique,keepref] */
- NTTIME *last_changed_time;/* [unique,keepref] */
+ uint32_t *num_subkeys;/* [keepref,ref] */
+ uint32_t *max_subkeylen;/* [keepref,ref] */
+ uint32_t *max_subkeysize;/* [keepref,ref] */
+ uint32_t *num_values;/* [keepref,ref] */
+ uint32_t *max_valnamelen;/* [keepref,ref] */
+ uint32_t *max_valbufsize;/* [keepref,ref] */
+ uint32_t *secdescsize;/* [keepref,ref] */
+ NTTIME *last_changed_time;/* [keepref,ref] */
WERROR result;
} out;
@@ -447,7 +447,7 @@ struct winreg_GetVersion {
} in;
struct {
- uint32_t *version;/* [unique,keepref] */
+ uint32_t *version;/* [keepref,ref] */
WERROR result;
} out;
diff --git a/source3/librpc/idl/dfs.idl b/source3/librpc/idl/dfs.idl
new file mode 100644
index 0000000000..82c04ad67a
--- /dev/null
+++ b/source3/librpc/idl/dfs.idl
@@ -0,0 +1,234 @@
+/*
+ dfs interface definition
+*/
+
+[ uuid("4fc742e0-4a10-11cf-8273-00aa004ae673"),
+ version(3.0),
+ pointer_default(unique),
+ helpstring("Settings for Microsoft Distributed File System"),
+ keepref
+] interface netdfs
+{
+ /******************/
+ /* Function: 0x00 */
+ void dfs_GetManagerVersion(
+ [out] uint32 *exist_flag
+ );
+
+
+ /******************/
+ /* Function: 0x01 */
+ WERROR dfs_Add (
+ [in,string,charset(UTF16)] uint16 *path,
+ [in,string,charset(UTF16)] uint16 *server,
+ [in,unique,string,charset(UTF16)] uint16 *share,
+ [in,unique,string,charset(UTF16)] uint16 *comment,
+ [in] uint32 flags
+ );
+
+ /******************/
+ /* Function: 0x02 */
+ WERROR dfs_Remove (
+ [in,string,charset(UTF16)] uint16 *path,
+ [in,unique,string,charset(UTF16)] uint16 *server,
+ [in,unique,string,charset(UTF16)] uint16 *share
+ );
+
+ /******************/
+ /* Function: 0x03 */
+ WERROR dfs_SetInfo ();
+
+ /******************/
+ /* Function: 0x04 */
+
+ typedef struct {
+ } dfs_Info0;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *path;
+ } dfs_Info1;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *path;
+ [string,charset(UTF16)] uint16 *comment;
+ uint32 state;
+ uint32 num_stores;
+ } dfs_Info2;
+
+ typedef struct {
+ uint32 state;
+ [string,charset(UTF16)] uint16 *server;
+ [string,charset(UTF16)] uint16 *share;
+ } dfs_StorageInfo;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *path;
+ [string,charset(UTF16)] uint16 *comment;
+ uint32 state;
+ uint32 num_stores;
+ [size_is(num_stores)] dfs_StorageInfo *stores;
+ } dfs_Info3;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *path;
+ [string,charset(UTF16)] uint16 *comment;
+ uint32 state;
+ uint32 timeout;
+ GUID guid;
+ uint32 num_stores;
+ [size_is(num_stores)] dfs_StorageInfo *stores;
+ } dfs_Info4;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *comment;
+ } dfs_Info100;
+
+ typedef struct {
+ uint32 state;
+ } dfs_Info101;
+
+ typedef struct {
+ uint32 timeout;
+ } dfs_Info102;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *dom_root;
+ } dfs_Info200;
+
+ typedef struct {
+ uint32 flags;
+ [string,charset(UTF16)] uint16 *dom_root;
+ } dfs_Info300;
+
+ typedef union {
+ [case(0)] dfs_Info0 *info0;
+ [case(1)] dfs_Info1 *info1;
+ [case(2)] dfs_Info2 *info2;
+ [case(3)] dfs_Info3 *info3;
+ [case(4)] dfs_Info4 *info4;
+ [case(100)] dfs_Info100 *info100;
+ [case(101)] dfs_Info101 *info101;
+ [case(102)] dfs_Info102 *info102;
+ } dfs_Info;
+
+ WERROR dfs_GetInfo (
+ [in,string,charset(UTF16)] uint16 *path,
+ [in,unique,string,charset(UTF16)] uint16 *server,
+ [in,unique,string,charset(UTF16)] uint16 *share,
+ [in] uint32 level,
+ [out,switch_is(level)] dfs_Info *info
+ );
+
+ /******************/
+ /* Function: 0x05 */
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] dfs_Info1 *s;
+ } dfs_EnumArray1;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] dfs_Info2 *s;
+ } dfs_EnumArray2;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] dfs_Info3 *s;
+ } dfs_EnumArray3;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] dfs_Info4 *s;
+ } dfs_EnumArray4;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] dfs_Info200 *s;
+ } dfs_EnumArray200;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] dfs_Info300 *s;
+ } dfs_EnumArray300;
+
+
+ typedef union {
+ [case(1)] dfs_EnumArray1 *info1;
+ [case(2)] dfs_EnumArray2 *info2;
+ [case(3)] dfs_EnumArray3 *info3;
+ [case(4)] dfs_EnumArray4 *info4;
+ [case(200)] dfs_EnumArray200 *info200;
+ [case(300)] dfs_EnumArray300 *info300;
+ } dfs_EnumInfo;
+
+ typedef struct {
+ uint32 level;
+ [switch_is(level)] dfs_EnumInfo e;
+ } dfs_EnumStruct;
+
+ WERROR dfs_Enum (
+ [in] uint32 level,
+ [in] uint32 bufsize,
+ [in,out,unique] dfs_EnumStruct *info,
+ [in,unique] uint32 *unknown,
+ [in,out,unique] uint32 *total
+ );
+
+ /* Function 0x06 */
+ WERROR dfs_Rename();
+
+ /* Function 0x07 */
+ WERROR dfs_Move();
+
+ /* Function 0x08 */
+ WERROR dfs_ManagerGetConfigInfo();
+
+ /* Function 0x09 */
+ WERROR dfs_ManagerSendSiteInfo();
+
+ /* Function 0x0a */
+ WERROR dfs_AddFtRoot();
+
+ /* Function 0x0b */
+ WERROR dfs_RemoveFtRoot();
+
+ /* Function 0x0c */
+ WERROR dfs_AddStdRoot();
+
+ /* Function 0x0d */
+ WERROR dfs_RemoveStdRoot();
+
+ /* Function 0x0e */
+ WERROR dfs_ManagerInitialize();
+
+ /* Function 0x0f */
+ WERROR dfs_AddStdRootForced();
+
+ /* Function 0x10 */
+ WERROR dfs_GetDcAddress();
+
+ /* Function 0x11 */
+ WERROR dfs_SetDcAddress();
+
+ /* Function 0x12 */
+ WERROR dfs_FlushFtTable();
+
+ /* Function 0x13 */
+ WERROR dfs_Add2();
+
+ /* Function 0x14 */
+ WERROR dfs_Remove2();
+
+ /* Function 0x15 */
+ WERROR dfs_EnumEx(
+ [in,string,charset(UTF16)] uint16 *name,
+ [in] uint32 level,
+ [in] uint32 bufsize,
+ [in,out,unique] dfs_EnumStruct *info,
+ [in,out,unique] uint32 *total
+ );
+
+ /* Function 0x16 */
+ WERROR dfs_SetInfo2();
+}
diff --git a/source3/librpc/idl/echo.idl b/source3/librpc/idl/echo.idl
new file mode 100644
index 0000000000..80123f9922
--- /dev/null
+++ b/source3/librpc/idl/echo.idl
@@ -0,0 +1,128 @@
+
+[
+ uuid("60a15ec5-4de8-11d7-a637-005056a20182"),
+ endpoint("ncacn_np:[\\pipe\\rpcecho]", "ncacn_ip_tcp:", "ncalrpc:"),
+ pointer_default(unique),
+ version(1.0),
+ helpstring("Simple echo pipe"),
+ keepref
+]
+interface rpcecho
+{
+ /* Add one to an integer */
+ void echo_AddOne(
+ [in] uint32 in_data,
+ [out] uint32 *out_data
+ );
+ /* Echo an array of bytes back at the caller */
+ void echo_EchoData(
+ [in] uint32 len,
+ [in] [size_is(len)] uint8 in_data[],
+ [out] [size_is(len)] uint8 out_data[]
+ );
+ /* Sink data to the server */
+ void echo_SinkData(
+ [in] uint32 len,
+ [in,size_is(len)] uint8 data[]
+ );
+ /* Source data from server */
+ void echo_SourceData(
+ [in] uint32 len,
+ [out,size_is(len)] uint8 data[]
+ );
+
+ /* test strings */
+ void echo_TestCall (
+ [in,string,charset(UTF16)] uint16 *s1,
+ [out,string,charset(UTF16)] uint16 **s2
+ );
+
+
+ /* test some alignment issues */
+ typedef struct {
+ uint8 v;
+ } echo_info1;
+
+ typedef struct {
+ uint16 v;
+ } echo_info2;
+
+ typedef struct {
+ uint32 v;
+ } echo_info3;
+
+ typedef struct {
+ hyper v;
+ } echo_info4;
+
+ typedef struct {
+ uint8 v1;
+ hyper v2;
+ } echo_info5;
+
+ typedef struct {
+ uint8 v1;
+ echo_info1 info1;
+ } echo_info6;
+
+ typedef struct {
+ uint8 v1;
+ echo_info4 info4;
+ } echo_info7;
+
+ typedef [switch_type(uint16)] union {
+ [case(1)] echo_info1 info1;
+ [case(2)] echo_info2 info2;
+ [case(3)] echo_info3 info3;
+ [case(4)] echo_info4 info4;
+ [case(5)] echo_info5 info5;
+ [case(6)] echo_info6 info6;
+ [case(7)] echo_info7 info7;
+ } echo_Info;
+
+ NTSTATUS echo_TestCall2 (
+ [in] uint16 level,
+ [out,switch_is(level)] echo_Info *info
+ );
+
+ uint32 echo_TestSleep(
+ [in] uint32 seconds
+ );
+
+ typedef enum {
+ ECHO_ENUM1 = 1,
+ ECHO_ENUM2 = 2
+ } echo_Enum1;
+
+ typedef [v1_enum] enum {
+ ECHO_ENUM1_32 = 1,
+ ECHO_ENUM2_32 = 2
+ } echo_Enum1_32;
+
+ typedef struct {
+ echo_Enum1 e1;
+ echo_Enum1_32 e2;
+ } echo_Enum2;
+
+ typedef [switch_type(uint16)] union {
+ [case(ECHO_ENUM1)] echo_Enum1 e1;
+ [case(ECHO_ENUM2)] echo_Enum2 e2;
+ } echo_Enum3;
+
+ void echo_TestEnum(
+ [in,out,ref] echo_Enum1 *foo1,
+ [in,out,ref] echo_Enum2 *foo2,
+ [in,out,ref,switch_is(*foo1)] echo_Enum3 *foo3
+ );
+
+ typedef struct {
+ uint32 x;
+ [size_is(x)] uint16 surrounding[*];
+ } echo_Surrounding;
+
+ void echo_TestSurrounding(
+ [in,out,ref] echo_Surrounding *data
+ );
+
+ uint16 echo_TestDoublePointer([in] uint16 ***data);
+}
diff --git a/source3/librpc/idl/eventlog.idl b/source3/librpc/idl/eventlog.idl
new file mode 100644
index 0000000000..c8a146b272
--- /dev/null
+++ b/source3/librpc/idl/eventlog.idl
@@ -0,0 +1,178 @@
+#include "idl_types.h"
+
+/*
+ eventlog interface definition
+*/
+[ uuid("82273fdc-e32a-18c3-3f78-827929dc23ea"),
+ version(0.0),
+ depends(lsa,security),
+ pointer_default(unique),
+ helpstring("Event Logger"),
+ keepref
+] interface eventlog
+{
+ typedef bitmap {
+ EVENTLOG_SEQUENTIAL_READ = 0x0001,
+ EVENTLOG_SEEK_READ = 0x0002,
+ EVENTLOG_FORWARDS_READ = 0x0004,
+ EVENTLOG_BACKWARDS_READ = 0x0008
+ } eventlogReadFlags;
+
+ typedef bitmap {
+ EVENTLOG_SUCCESS = 0x0000,
+ EVENTLOG_ERROR_TYPE = 0x0001,
+ EVENTLOG_WARNING_TYPE = 0x0002,
+ EVENTLOG_INFORMATION_TYPE = 0x0004,
+ EVENTLOG_AUDIT_SUCCESS = 0x0008,
+ EVENTLOG_AUDIT_FAILURE = 0x0010
+ } eventlogEventTypes;
+
+ typedef struct {
+ uint16 unknown0;
+ uint16 unknown1;
+ } eventlog_OpenUnknown0;
+
+ typedef [public] struct {
+ uint32 size;
+ uint32 reserved;
+ uint32 record_number;
+ uint32 time_generated;
+ uint32 time_written;
+ uint32 event_id;
+ uint16 event_type;
+ uint16 num_of_strings;
+ uint16 event_category;
+ uint16 reserved_flags;
+ uint32 closing_record_number;
+ uint32 stringoffset;
+ uint32 sid_length;
+ uint32 sid_offset;
+ uint32 data_length;
+ uint32 data_offset;
+ nstring source_name;
+ nstring computer_name;
+ nstring strings[num_of_strings];
+ astring raw_data;
+ } eventlog_Record;
+
+ /******************/
+ /* Function: 0x00 */
+ NTSTATUS eventlog_ClearEventLogW(
+ [in] policy_handle *handle,
+ [in,unique] lsa_String *unknown
+ );
+
+ /******************/
+ /* Function: 0x01 */
+ NTSTATUS eventlog_BackupEventLogW();
+
+ /******************/
+ /* Function: 0x02 */
+ NTSTATUS eventlog_CloseEventLog(
+ [in,out] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x03 */
+ NTSTATUS eventlog_DeregisterEventSource();
+
+ /******************/
+ /* Function: 0x04 */
+ NTSTATUS eventlog_GetNumRecords(
+ [in] policy_handle *handle,
+ [out] uint32 number
+ );
+
+ /******************/
+ /* Function: 0x05 */
+ NTSTATUS eventlog_GetOldestRecord();
+
+ /******************/
+ /* Function: 0x06 */
+ NTSTATUS eventlog_ChangeNotify();
+
+ /******************/
+ /* Function: 0x07 */
+ NTSTATUS eventlog_OpenEventLogW(
+ [in,unique] eventlog_OpenUnknown0 *unknown0,
+ [in] lsa_String logname,
+ [in] lsa_String servername,
+ [in] uint32 unknown2,
+ [in] uint32 unknown3,
+ [out] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x08 */
+ NTSTATUS eventlog_RegisterEventSourceW();
+
+ /******************/
+ /* Function: 0x09 */
+ NTSTATUS eventlog_OpenBackupEventLogW();
+
+ /******************/
+ /* Function: 0x0a */
+ NTSTATUS eventlog_ReadEventLogW(
+ [in] policy_handle *handle,
+ [in] uint32 flags,
+ [in] uint32 offset,
+ [in] uint32 number_of_bytes,
+ [out,size_is(number_of_bytes)] uint8 *data,
+ [out] uint32 sent_size,
+ [out] uint32 real_size
+ );
+
+ /*****************/
+ /* Function 0x0b */
+ NTSTATUS eventlog_ReportEventW();
+
+ /*****************/
+ /* Function 0x0c */
+ NTSTATUS eventlog_ClearEventLogA();
+
+ /******************/
+ /* Function: 0x0d */
+ NTSTATUS eventlog_BackupEventLogA();
+
+ /*****************/
+ /* Function 0x0e */
+ NTSTATUS eventlog_OpenEventLogA();
+
+ /*****************/
+ /* Function 0x0f */
+ NTSTATUS eventlog_RegisterEventSourceA();
+
+ /*****************/
+ /* Function 0x10 */
+ NTSTATUS eventlog_OpenBackupEventLogA();
+
+ /*****************/
+ /* Function 0x11 */
+ NTSTATUS eventlog_ReadEventLogA();
+
+ /*****************/
+ /* Function 0x12 */
+ NTSTATUS eventlog_ReportEventA();
+
+ /*****************/
+ /* Function 0x13 */
+ NTSTATUS eventlog_RegisterClusterSvc();
+
+ /*****************/
+ /* Function 0x14 */
+ NTSTATUS eventlog_DeregisterClusterSvc();
+
+ /*****************/
+ /* Function 0x15 */
+ NTSTATUS eventlog_WriteClusterEvents();
+
+ /*****************/
+ /* Function 0x16 */
+ NTSTATUS eventlog_GetLogIntormation();
+
+ /*****************/
+ /* Function 0x17 */
+ NTSTATUS eventlog_FlushEventLog(
+ [in] policy_handle *handle
+ );
+}
diff --git a/source3/librpc/idl/idl_types.h b/source3/librpc/idl/idl_types.h
new file mode 100644
index 0000000000..f21f3e660d
--- /dev/null
+++ b/source3/librpc/idl/idl_types.h
@@ -0,0 +1,86 @@
+#define STR_ASCII LIBNDR_FLAG_STR_ASCII
+#define STR_LEN4 LIBNDR_FLAG_STR_LEN4
+#define STR_SIZE4 LIBNDR_FLAG_STR_SIZE4
+#define STR_SIZE2 LIBNDR_FLAG_STR_SIZE2
+#define STR_NOTERM LIBNDR_FLAG_STR_NOTERM
+#define STR_NULLTERM LIBNDR_FLAG_STR_NULLTERM
+#define STR_BYTESIZE LIBNDR_FLAG_STR_BYTESIZE
+#define STR_FIXLEN32 LIBNDR_FLAG_STR_FIXLEN32
+#define STR_FIXLEN15 LIBNDR_FLAG_STR_FIXLEN15
+#define STR_CONFORMANT LIBNDR_FLAG_STR_CONFORMANT
+#define STR_CHARLEN LIBNDR_FLAG_STR_CHARLEN
+#define STR_UTF8 LIBNDR_FLAG_STR_UTF8
+
+/*
+ a UCS2 string prefixed with [size], 32 bits
+*/
+#define lstring [flag(STR_SIZE4)] string
+
+/*
+ a null terminated UCS2 string
+*/
+#define nstring [flag(STR_NULLTERM)] string
+
+/*
+ fixed length 32 character UCS-2 string
+*/
+#define string32 [flag(STR_FIXLEN32)] string
+
+/*
+ fixed length 16 character ascii string
+*/
+#define astring15 [flag(STR_ASCII|STR_FIXLEN15)] string
+
+/*
+ an ascii string prefixed with [offset] [length], both 32 bits
+ null terminated
+*/
+#define ascstr2 [flag(STR_ASCII|STR_LEN4)] string
+
+/*
+ an ascii string prefixed with [size], 32 bits
+*/
+#define asclstr [flag(STR_ASCII|STR_SIZE4)] string
+
+/*
+ an ascii string prefixed with [size], 16 bits
+ null terminated
+*/
+#define ascstr3 [flag(STR_ASCII|STR_SIZE2)] string
+
+/*
+ an ascii string prefixed with [size] [offset] [length], all 32 bits
+ not null terminated
+*/
+#define ascstr_noterm [flag(STR_NOTERM|STR_ASCII|STR_SIZE4|STR_LEN4)] string
+
+/*
+ a null terminated ascii string
+*/
+#define astring [flag(STR_ASCII|STR_NULLTERM)] string
+
+/*
+ a null terminated UTF8 string
+*/
+#define utf8string [flag(STR_UTF8|STR_NULLTERM)] string
+
+/*
+ a null terminated UCS2 string
+*/
+#define nstring_array [flag(STR_NULLTERM)] string_array
+
+#define NDR_NOALIGN LIBNDR_FLAG_NOALIGN
+#define NDR_REMAINING LIBNDR_FLAG_REMAINING
+#define NDR_ALIGN2 LIBNDR_FLAG_ALIGN2
+#define NDR_ALIGN4 LIBNDR_FLAG_ALIGN4
+#define NDR_ALIGN8 LIBNDR_FLAG_ALIGN8
+
+/* this flag is used to force a section of IDL as little endian. It is
+ needed for the epmapper IDL, which is defined as always being LE */
+#define NDR_LITTLE_ENDIAN LIBNDR_FLAG_LITTLE_ENDIAN
+#define NDR_BIG_ENDIAN LIBNDR_FLAG_BIGENDIAN
+
+/*
+ this is used to control formatting of uint8 arrays
+*/
+#define NDR_PAHEX LIBNDR_PRINT_ARRAY_HEX
diff --git a/source3/librpc/idl/initshutdown.idl b/source3/librpc/idl/initshutdown.idl
new file mode 100644
index 0000000000..8555ed0c5c
--- /dev/null
+++ b/source3/librpc/idl/initshutdown.idl
@@ -0,0 +1,47 @@
+#include "idl_types.h"
+
+/*
+ initshutdown interface definition
+*/
+
+[
+ uuid("894de0c0-0d55-11d3-a322-00c04fa321a1"),
+ version(1.0),
+ endpoint("ncacn_np:[\\pipe\\InitShutdown]"),
+ pointer_default(unique),
+ helpstring("Init shutdown service"),
+ keepref
+] interface initshutdown
+{
+ typedef struct {
+ [value(strlen_m_term(name))] uint32 name_size;
+ [flag(STR_LEN4|STR_NOTERM)] string name;
+ } initshutdown_String_sub;
+
+ typedef [public] struct {
+ [value(strlen_m(r->name->name)*2)] uint16 name_len;
+ [value(strlen_m_term(r->name->name)*2)] uint16 name_size;
+ initshutdown_String_sub *name;
+ } initshutdown_String;
+
+ WERROR initshutdown_Init(
+ [in,unique] uint16 *hostname,
+ [in,unique] initshutdown_String *message,
+ [in] uint32 timeout,
+ [in] uint8 force_apps,
+ [in] uint8 reboot
+ );
+
+ WERROR initshutdown_Abort(
+ [in,unique] uint16 *server
+ );
+
+ WERROR initshutdown_InitEx(
+ [in,unique] uint16 *hostname,
+ [in,unique] initshutdown_String *message,
+ [in] uint32 timeout,
+ [in] uint8 force_apps,
+ [in] uint8 reboot,
+ [in] uint32 reason
+ );
+}
diff --git a/source3/librpc/idl/lsa.idl b/source3/librpc/idl/lsa.idl
new file mode 100644
index 0000000000..f78c36ec59
--- /dev/null
+++ b/source3/librpc/idl/lsa.idl
@@ -0,0 +1,976 @@
+#include "idl_types.h"
+
+/*
+ lsa interface definition
+*/
+
+[ uuid("12345778-1234-abcd-ef00-0123456789ab"),
+ version(0.0),
+ endpoint("ncacn_np:[\\pipe\\lsarpc]","ncacn_np:[\\pipe\\netlogon]","ncacn_np:[\\pipe\\lsass]", "ncacn_ip_tcp:", "ncalrpc:"),
+ pointer_default(unique),
+ helpstring("Local Security Authority"),
+ depends(security),
+ keepref
+] interface lsarpc
+{
+ declare bitmap security_secinfo;
+
+ typedef [public,noejs] struct {
+ [value(2*strlen_m(string))] uint16 length;
+ [value(2*strlen_m(string))] uint16 size;
+ [charset(UTF16),size_is(size/2),length_is(length/2)] uint16 *string;
+ } lsa_String;
+
+ typedef [public] struct {
+ [value(2*strlen_m(string))] uint16 length;
+ [value(2*(strlen_m(string)+1))] uint16 size;
+ [charset(UTF16),size_is(size/2),length_is(length/2)] uint16 *string;
+ } lsa_StringLarge;
+
+ typedef [public] struct {
+ uint32 count;
+ [size_is(count)] lsa_String *names;
+ } lsa_Strings;
+
+ typedef [public] struct {
+ [value(strlen_m(string))] uint16 length;
+ [value(strlen_m(string))] uint16 size;
+ ascstr_noterm *string;
+ } lsa_AsciiString;
+
+ /******************/
+ /* Function: 0x00 */
+ NTSTATUS lsa_Close (
+ [in,out] policy_handle *handle
+ );
+
+
+ /******************/
+ /* Function: 0x01 */
+ NTSTATUS lsa_Delete (
+ [in] policy_handle *handle
+ );
+
+
+ /******************/
+ /* Function: 0x02 */
+ typedef struct {
+ uint32 low;
+ uint32 high;
+ } lsa_LUID;
+
+ typedef struct {
+ lsa_StringLarge name;
+ lsa_LUID luid;
+ } lsa_PrivEntry;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] lsa_PrivEntry *privs;
+ } lsa_PrivArray;
+
+ NTSTATUS lsa_EnumPrivs (
+ [in] policy_handle *handle,
+ [in,out] uint32 *resume_handle,
+ [in] uint32 max_count,
+ [out] lsa_PrivArray *privs
+ );
+
+ /******************/
+ /* Function: 0x03 */
+
+ NTSTATUS lsa_QuerySecurity (
+ [in] policy_handle *handle,
+ [in] security_secinfo sec_info,
+ [out,unique] sec_desc_buf *sdbuf
+ );
+
+
+ /******************/
+ /* Function: 0x04 */
+ NTSTATUS lsa_SetSecObj ();
+
+
+ /******************/
+ /* Function: 0x05 */
+ NTSTATUS lsa_ChangePassword ();
+
+
+ /******************/
+ /* Function: 0x06 */
+ typedef struct {
+ uint32 len; /* ignored */
+ uint16 impersonation_level;
+ uint8 context_mode;
+ uint8 effective_only;
+ } lsa_QosInfo;
+
+ typedef struct {
+ uint32 len; /* ignored */
+ uint8 *root_dir;
+ [string,charset(UTF16)] uint16 *object_name;
+ uint32 attributes;
+ security_descriptor *sec_desc;
+ lsa_QosInfo *sec_qos;
+ } lsa_ObjectAttribute;
+
+ /* notice the screwup with the system_name - thats why MS created
+ OpenPolicy2 */
+ NTSTATUS lsa_OpenPolicy (
+ [in,unique] uint16 *system_name,
+ [in] lsa_ObjectAttribute *attr,
+ [in] uint32 access_mask,
+ [out] policy_handle *handle
+ );
+
+
+
+ /******************/
+ /* Function: 0x07 */
+
+ typedef struct {
+ uint32 percent_full;
+ uint32 log_size;
+ NTTIME retention_time;
+ uint8 shutdown_in_progress;
+ NTTIME time_to_shutdown;
+ uint32 next_audit_record;
+ uint32 unknown;
+ } lsa_AuditLogInfo;
+
+ typedef struct {
+ uint32 auditing_mode;
+ [size_is(count)] uint32 *settings;
+ uint32 count;
+ } lsa_AuditEventsInfo;
+
+ typedef struct {
+ lsa_StringLarge name;
+ dom_sid2 *sid;
+ } lsa_DomainInfo;
+
+ typedef struct {
+ lsa_String name;
+ } lsa_PDAccountInfo;
+
+ typedef struct {
+ uint16 unknown; /* an midl padding bug? */
+ uint16 role;
+ } lsa_ServerRole;
+
+ typedef struct {
+ lsa_String source;
+ lsa_String account;
+ } lsa_ReplicaSourceInfo;
+
+ typedef struct {
+ uint32 paged_pool;
+ uint32 non_paged_pool;
+ uint32 min_wss;
+ uint32 max_wss;
+ uint32 pagefile;
+ hyper unknown;
+ } lsa_DefaultQuotaInfo;
+
+ typedef struct {
+ hyper modified_id;
+ NTTIME db_create_time;
+ } lsa_ModificationInfo;
+
+ typedef struct {
+ uint8 shutdown_on_full;
+ } lsa_AuditFullSetInfo;
+
+ typedef struct {
+ uint16 unknown; /* an midl padding bug? */
+ uint8 shutdown_on_full;
+ uint8 log_is_full;
+ } lsa_AuditFullQueryInfo;
+
+ typedef struct {
+ /* it's important that we use the lsa_StringLarge here,
+ * because otherwise windows clients result with such dns hostnames
+ * e.g. w2k3-client.samba4.samba.orgsamba4.samba.org
+ * where it should be
+ * w2k3-client.samba4.samba.org
+ */
+ lsa_StringLarge name;
+ lsa_StringLarge dns_domain;
+ lsa_StringLarge dns_forest;
+ GUID domain_guid;
+ dom_sid2 *sid;
+ } lsa_DnsDomainInfo;
+
+ typedef enum {
+ LSA_POLICY_INFO_AUDIT_LOG=1,
+ LSA_POLICY_INFO_AUDIT_EVENTS=2,
+ LSA_POLICY_INFO_DOMAIN=3,
+ LSA_POLICY_INFO_PD=4,
+ LSA_POLICY_INFO_ACCOUNT_DOMAIN=5,
+ LSA_POLICY_INFO_ROLE=6,
+ LSA_POLICY_INFO_REPLICA=7,
+ LSA_POLICY_INFO_QUOTA=8,
+ LSA_POLICY_INFO_DB=9,
+ LSA_POLICY_INFO_AUDIT_FULL_SET=10,
+ LSA_POLICY_INFO_AUDIT_FULL_QUERY=11,
+ LSA_POLICY_INFO_DNS=12
+ } lsaPolicyInfo;
+
+ typedef [switch_type(uint16)] union {
+ [case(LSA_POLICY_INFO_AUDIT_LOG)] lsa_AuditLogInfo audit_log;
+ [case(LSA_POLICY_INFO_AUDIT_EVENTS)] lsa_AuditEventsInfo audit_events;
+ [case(LSA_POLICY_INFO_DOMAIN)] lsa_DomainInfo domain;
+ [case(LSA_POLICY_INFO_PD)] lsa_PDAccountInfo pd;
+ [case(LSA_POLICY_INFO_ACCOUNT_DOMAIN)] lsa_DomainInfo account_domain;
+ [case(LSA_POLICY_INFO_ROLE)] lsa_ServerRole role;
+ [case(LSA_POLICY_INFO_REPLICA)] lsa_ReplicaSourceInfo replica;
+ [case(LSA_POLICY_INFO_QUOTA)] lsa_DefaultQuotaInfo quota;
+ [case(LSA_POLICY_INFO_DB)] lsa_ModificationInfo db;
+ [case(LSA_POLICY_INFO_AUDIT_FULL_SET)] lsa_AuditFullSetInfo auditfullset;
+ [case(LSA_POLICY_INFO_AUDIT_FULL_QUERY)] lsa_AuditFullQueryInfo auditfullquery;
+ [case(LSA_POLICY_INFO_DNS)] lsa_DnsDomainInfo dns;
+ } lsa_PolicyInformation;
+
+ NTSTATUS lsa_QueryInfoPolicy (
+ [in] policy_handle *handle,
+ [in] uint16 level,
+ [out,unique,switch_is(level)] lsa_PolicyInformation *info
+ );
+
+ /******************/
+ /* Function: 0x08 */
+ NTSTATUS lsa_SetInfoPolicy ();
+
+ /******************/
+ /* Function: 0x09 */
+ NTSTATUS lsa_ClearAuditLog ();
+
+ /******************/
+ /* Function: 0x0a */
+ NTSTATUS lsa_CreateAccount (
+ [in] policy_handle *handle,
+ [in] dom_sid2 *sid,
+ [in] uint32 access_mask,
+ [out] policy_handle *acct_handle
+ );
+
+ /******************/
+ /* NOTE: This only returns accounts that have at least
+ one privilege set
+ */
+ /* Function: 0x0b */
+ typedef struct {
+ dom_sid2 *sid;
+ } lsa_SidPtr;
+
+ typedef [public] struct {
+ [range(0,1000)] uint32 num_sids;
+ [size_is(num_sids)] lsa_SidPtr *sids;
+ } lsa_SidArray;
+
+ NTSTATUS lsa_EnumAccounts (
+ [in] policy_handle *handle,
+ [in,out] uint32 *resume_handle,
+ [in,range(0,8192)] uint32 num_entries,
+ [out] lsa_SidArray *sids
+ );
+
+
+ /*************************************************/
+ /* Function: 0x0c */
+
+ NTSTATUS lsa_CreateTrustedDomain(
+ [in] policy_handle *handle,
+ [in] lsa_DomainInfo *info,
+ [in] uint32 access_mask,
+ [out] policy_handle *trustdom_handle
+ );
+
+
+ /******************/
+ /* Function: 0x0d */
+
+ /* w2k3 treats max_size as max_domains*60 */
+ const int LSA_ENUM_TRUST_DOMAIN_MULTIPLIER = 60;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] lsa_DomainInfo *domains;
+ } lsa_DomainList;
+
+ NTSTATUS lsa_EnumTrustDom (
+ [in] policy_handle *handle,
+ [in,out] uint32 *resume_handle,
+ [in,range(0,1000)] uint32 max_size,
+ [out] lsa_DomainList *domains
+ );
+
+
+ /******************/
+ /* Function: 0x0e */
+ typedef enum {
+ SID_NAME_USE_NONE = 0,/* NOTUSED */
+ SID_NAME_USER = 1, /* user */
+ SID_NAME_DOM_GRP = 2, /* domain group */
+ SID_NAME_DOMAIN = 3, /* domain: don't know what this is */
+ SID_NAME_ALIAS = 4, /* local group */
+ SID_NAME_WKN_GRP = 5, /* well-known group */
+ SID_NAME_DELETED = 6, /* deleted account: needed for c2 rating */
+ SID_NAME_INVALID = 7, /* invalid account */
+ SID_NAME_UNKNOWN = 8, /* oops. */
+ SID_NAME_COMPUTER = 9 /* machine */
+ } lsa_SidType;
+
+ typedef struct {
+ lsa_SidType sid_type;
+ uint32 rid;
+ uint32 sid_index;
+ } lsa_TranslatedSid;
+
+ typedef struct {
+ [range(0,1000)] uint32 count;
+ [size_is(count)] lsa_TranslatedSid *sids;
+ } lsa_TransSidArray;
+
+ const int LSA_REF_DOMAIN_LIST_MULTIPLIER = 32;
+ typedef struct {
+ [range(0,1000)] uint32 count;
+ [size_is(count)] lsa_DomainInfo *domains;
+ uint32 max_size;
+ } lsa_RefDomainList;
+
+ NTSTATUS lsa_LookupNames (
+ [in] policy_handle *handle,
+ [in,range(0,1000)] uint32 num_names,
+ [in,size_is(num_names)] lsa_String names[],
+ [out,unique] lsa_RefDomainList *domains,
+ [in,out] lsa_TransSidArray *sids,
+ [in] uint16 level,
+ [in,out] uint32 *count
+ );
+
+
+ /******************/
+ /* Function: 0x0f */
+
+ typedef struct {
+ lsa_SidType sid_type;
+ lsa_String name;
+ uint32 sid_index;
+ } lsa_TranslatedName;
+
+ typedef struct {
+ [range(0,1000)] uint32 count;
+ [size_is(count)] lsa_TranslatedName *names;
+ } lsa_TransNameArray;
+
+ NTSTATUS lsa_LookupSids (
+ [in] policy_handle *handle,
+ [in] lsa_SidArray *sids,
+ [out,unique] lsa_RefDomainList *domains,
+ [in,out] lsa_TransNameArray *names,
+ [in] uint16 level,
+ [in,out] uint32 *count
+ );
+
+
+ /* Function: 0x10 */
+ NTSTATUS lsa_CreateSecret(
+ [in] policy_handle *handle,
+ [in] lsa_String name,
+ [in] uint32 access_mask,
+ [out] policy_handle *sec_handle
+ );
+
+
+ /*****************************************/
+ /* Function: 0x11 */
+ NTSTATUS lsa_OpenAccount (
+ [in] policy_handle *handle,
+ [in] dom_sid2 *sid,
+ [in] uint32 access_mask,
+ [out] policy_handle *acct_handle
+ );
+
+
+ /****************************************/
+ /* Function: 0x12 */
+
+ typedef struct {
+ lsa_LUID luid;
+ uint32 attribute;
+ } lsa_LUIDAttribute;
+
+ typedef struct {
+ [range(0,1000)] uint32 count;
+ uint32 unknown;
+ [size_is(count)] lsa_LUIDAttribute set[*];
+ } lsa_PrivilegeSet;
+
+ NTSTATUS lsa_EnumPrivsAccount (
+ [in] policy_handle *handle,
+ [out,unique] lsa_PrivilegeSet *privs
+ );
+
+
+ /****************************************/
+ /* Function: 0x13 */
+ NTSTATUS lsa_AddPrivilegesToAccount(
+ [in] policy_handle *handle,
+ [in] lsa_PrivilegeSet *privs
+ );
+
+
+ /****************************************/
+ /* Function: 0x14 */
+ NTSTATUS lsa_RemovePrivilegesFromAccount(
+ [in] policy_handle *handle,
+ [in] uint8 remove_all,
+ [in,unique] lsa_PrivilegeSet *privs
+ );
+
+ /* Function: 0x15 */
+ NTSTATUS lsa_GetQuotasForAccount();
+
+ /* Function: 0x16 */
+ NTSTATUS lsa_SetQuotasForAccount();
+
+ /* Function: 0x17 */
+ NTSTATUS lsa_GetSystemAccessAccount();
+ /* Function: 0x18 */
+ NTSTATUS lsa_SetSystemAccessAccount();
+
+ /* Function: 0x19 */
+ NTSTATUS lsa_OpenTrustedDomain(
+ [in] policy_handle *handle,
+ [in] dom_sid2 *sid,
+ [in] uint32 access_mask,
+ [out] policy_handle *trustdom_handle
+ );
+
+ typedef [flag(NDR_PAHEX)] struct {
+ uint32 length;
+ uint32 size;
+ [size_is(size),length_is(length)] uint8 *data;
+ } lsa_DATA_BUF;
+
+ typedef [flag(NDR_PAHEX)] struct {
+ [range(0,65536)] uint32 size;
+ [size_is(size)] uint8 *data;
+ } lsa_DATA_BUF2;
+
+ typedef enum {
+ LSA_TRUSTED_DOMAIN_INFO_NAME = 1,
+ LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO = 2,
+ LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET = 3,
+ LSA_TRUSTED_DOMAIN_INFO_PASSWORD = 4,
+ LSA_TRUSTED_DOMAIN_INFO_BASIC = 5,
+ LSA_TRUSTED_DOMAIN_INFO_INFO_EX = 6,
+ LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO = 7,
+ LSA_TRUSTED_DOMAIN_INFO_FULL_INFO = 8,
+ LSA_TRUSTED_DOMAIN_INFO_11 = 11,
+ LSA_TRUSTED_DOMAIN_INFO_INFO_ALL = 12
+ } lsa_TrustDomInfoEnum;
+
+ typedef struct {
+ lsa_StringLarge netbios_name;
+ } lsa_TrustDomainInfoName;
+
+ typedef struct {
+ uint32 posix_offset;
+ } lsa_TrustDomainInfoPosixOffset;
+
+ typedef struct {
+ lsa_DATA_BUF *password;
+ lsa_DATA_BUF *old_password;
+ } lsa_TrustDomainInfoPassword;
+
+ typedef struct {
+ lsa_String netbios_name;
+ dom_sid2 *sid;
+ } lsa_TrustDomainInfoBasic;
+
+ typedef struct {
+ lsa_StringLarge domain_name;
+ lsa_StringLarge netbios_name;
+ dom_sid2 *sid;
+ uint32 trust_direction;
+ uint32 trust_type;
+ uint32 trust_attributes;
+ } lsa_TrustDomainInfoInfoEx;
+
+ typedef struct {
+ NTTIME_hyper last_update_time;
+ uint32 secret_type;
+ lsa_DATA_BUF2 data;
+ } lsa_TrustDomainInfoBuffer;
+
+ typedef struct {
+ uint32 incoming_count;
+ lsa_TrustDomainInfoBuffer *incoming_current_auth_info;
+ lsa_TrustDomainInfoBuffer *incoming_previous_auth_info;
+ uint32 outgoing_count;
+ lsa_TrustDomainInfoBuffer *outgoing_current_auth_info;
+ lsa_TrustDomainInfoBuffer *outgoing_previous_auth_info;
+ } lsa_TrustDomainInfoAuthInfo;
+
+ typedef struct {
+ lsa_TrustDomainInfoInfoEx info_ex;
+ lsa_TrustDomainInfoPosixOffset posix_offset;
+ lsa_TrustDomainInfoAuthInfo auth_info;
+ } lsa_TrustDomainInfoFullInfo;
+
+ typedef struct {
+ lsa_TrustDomainInfoInfoEx info_ex;
+ lsa_DATA_BUF2 data1;
+ } lsa_TrustDomainInfo11;
+
+ typedef struct {
+ lsa_TrustDomainInfoInfoEx info_ex;
+ lsa_DATA_BUF2 data1;
+ lsa_TrustDomainInfoPosixOffset posix_offset;
+ lsa_TrustDomainInfoAuthInfo auth_info;
+ } lsa_TrustDomainInfoInfoAll;
+
+ typedef [switch_type(lsa_TrustDomInfoEnum)] union {
+ [case(LSA_TRUSTED_DOMAIN_INFO_NAME)] lsa_TrustDomainInfoName name;
+ [case(LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET)] lsa_TrustDomainInfoPosixOffset posix_offset;
+ [case(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)] lsa_TrustDomainInfoPassword password;
+ [case(LSA_TRUSTED_DOMAIN_INFO_BASIC)] lsa_TrustDomainInfoBasic info_basic;
+ [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)] lsa_TrustDomainInfoInfoEx info_ex;
+ [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)] lsa_TrustDomainInfoAuthInfo auth_info;
+ [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)] lsa_TrustDomainInfoFullInfo full_info;
+ [case(LSA_TRUSTED_DOMAIN_INFO_11)] lsa_TrustDomainInfo11 info11;
+ [case(LSA_TRUSTED_DOMAIN_INFO_INFO_ALL)] lsa_TrustDomainInfoInfoAll info_all;
+ } lsa_TrustedDomainInfo;
+
+ /* Function: 0x1a */
+ NTSTATUS lsa_QueryTrustedDomainInfo(
+ [in] policy_handle *trustdom_handle,
+ [in] lsa_TrustDomInfoEnum level,
+ [out,switch_is(level),unique] lsa_TrustedDomainInfo *info
+ );
+
+ /* Function: 0x1b */
+ NTSTATUS lsa_SetInformationTrustedDomain();
+
+ /* Function: 0x1c */
+ NTSTATUS lsa_OpenSecret(
+ [in] policy_handle *handle,
+ [in] lsa_String name,
+ [in] uint32 access_mask,
+ [out] policy_handle *sec_handle
+ );
+
+ /* Function: 0x1d */
+
+ NTSTATUS lsa_SetSecret(
+ [in] policy_handle *sec_handle,
+ [in,unique] lsa_DATA_BUF *new_val,
+ [in,unique] lsa_DATA_BUF *old_val
+ );
+
+ typedef struct {
+ lsa_DATA_BUF *buf;
+ } lsa_DATA_BUF_PTR;
+
+ /* Function: 0x1e */
+ NTSTATUS lsa_QuerySecret (
+ [in] policy_handle *sec_handle,
+ [in,out,unique] lsa_DATA_BUF_PTR *new_val,
+ [in,out,unique] NTTIME_hyper *new_mtime,
+ [in,out,unique] lsa_DATA_BUF_PTR *old_val,
+ [in,out,unique] NTTIME_hyper *old_mtime
+ );
+
+ /* Function: 0x1f */
+ NTSTATUS lsa_LookupPrivValue(
+ [in] policy_handle *handle,
+ [in] lsa_String *name,
+ [out] lsa_LUID *luid
+ );
+
+
+ /* Function: 0x20 */
+ NTSTATUS lsa_LookupPrivName (
+ [in] policy_handle *handle,
+ [in] lsa_LUID *luid,
+ [out,unique] lsa_StringLarge *name
+ );
+
+
+ /*******************/
+ /* Function: 0x21 */
+ NTSTATUS lsa_LookupPrivDisplayName (
+ [in] policy_handle *handle,
+ [in] lsa_String *name,
+ [out,unique] lsa_StringLarge *disp_name,
+ /* see http://www.microsoft.com/globaldev/nlsweb/ for
+ language definitions */
+ [in,out] uint16 *language_id,
+ [in] uint16 unknown
+ );
+
+ /* Function: 0x22 */
+ NTSTATUS lsa_DeleteObject();
+
+
+ /*******************/
+ /* Function: 0x23 */
+ NTSTATUS lsa_EnumAccountsWithUserRight (
+ [in] policy_handle *handle,
+ [in,unique] lsa_String *name,
+ [out] lsa_SidArray *sids
+ );
+
+ /* Function: 0x24 */
+ typedef struct {
+ [string,charset(UTF16)] uint16 *name;
+ } lsa_RightAttribute;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] lsa_StringLarge *names;
+ } lsa_RightSet;
+
+ NTSTATUS lsa_EnumAccountRights (
+ [in] policy_handle *handle,
+ [in] dom_sid2 *sid,
+ [out] lsa_RightSet *rights
+ );
+
+
+ /**********************/
+ /* Function: 0x25 */
+ NTSTATUS lsa_AddAccountRights (
+ [in] policy_handle *handle,
+ [in] dom_sid2 *sid,
+ [in] lsa_RightSet *rights
+ );
+
+ /**********************/
+ /* Function: 0x26 */
+ NTSTATUS lsa_RemoveAccountRights (
+ [in] policy_handle *handle,
+ [in] dom_sid2 *sid,
+ [in] uint32 unknown,
+ [in] lsa_RightSet *rights
+ );
+
+ /* Function: 0x27 */
+ NTSTATUS lsa_QueryTrustedDomainInfoBySid(
+ [in] policy_handle *handle,
+ [in] dom_sid2 *dom_sid,
+ [in] lsa_TrustDomInfoEnum level,
+ [out,switch_is(level),unique] lsa_TrustedDomainInfo *info
+ );
+
+ /* Function: 0x28 */
+ NTSTATUS lsa_SetTrustedDomainInfo();
+ /* Function: 0x29 */
+ NTSTATUS lsa_DeleteTrustedDomain(
+ [in] policy_handle *handle,
+ [in] dom_sid2 *dom_sid
+ );
+
+ /* Function: 0x2a */
+ NTSTATUS lsa_StorePrivateData();
+ /* Function: 0x2b */
+ NTSTATUS lsa_RetrievePrivateData();
+
+
+ /**********************/
+ /* Function: 0x2c */
+ NTSTATUS lsa_OpenPolicy2 (
+ [in,unique] [string,charset(UTF16)] uint16 *system_name,
+ [in] lsa_ObjectAttribute *attr,
+ [in] uint32 access_mask,
+ [out] policy_handle *handle
+ );
+
+ /**********************/
+ /* Function: 0x2d */
+ typedef struct {
+ lsa_String *string;
+ } lsa_StringPointer;
+
+ NTSTATUS lsa_GetUserName(
+ [in,unique] [string,charset(UTF16)] uint16 *system_name,
+ [in,out,unique] lsa_String *account_name,
+ [in,out,unique] lsa_StringPointer *authority_name
+ );
+
+ /**********************/
+ /* Function: 0x2e */
+
+ NTSTATUS lsa_QueryInfoPolicy2(
+ [in] policy_handle *handle,
+ [in] uint16 level,
+ [out,unique,switch_is(level)] lsa_PolicyInformation *info
+ );
+
+ /* Function 0x2f */
+ NTSTATUS lsa_SetInfoPolicy2();
+
+ /**********************/
+ /* Function 0x30 */
+ NTSTATUS lsa_QueryTrustedDomainInfoByName(
+ [in] policy_handle *handle,
+ [in] lsa_String trusted_domain,
+ [in] lsa_TrustDomInfoEnum level,
+ [out,unique,switch_is(level)] lsa_TrustedDomainInfo *info
+ );
+
+ /**********************/
+ /* Function 0x31 */
+ NTSTATUS lsa_SetTrustedDomainInfoByName(
+ [in] policy_handle *handle,
+ [in] lsa_String trusted_domain,
+ [in] lsa_TrustDomInfoEnum level,
+ [in,unique,switch_is(level)] lsa_TrustedDomainInfo *info
+ );
+
+ /* Function 0x32 */
+
+ /* w2k3 treats max_size as max_domains*82 */
+ const int LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER = 82;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] lsa_TrustDomainInfoInfoEx *domains;
+ } lsa_DomainListEx;
+
+ NTSTATUS lsa_EnumTrustedDomainsEx (
+ [in] policy_handle *handle,
+ [in,out] uint32 *resume_handle,
+ [out] lsa_DomainListEx *domains,
+ [in] uint32 max_size
+ );
+
+
+ /* Function 0x33 */
+ NTSTATUS lsa_CreateTrustedDomainEx();
+
+ /* Function 0x34 */
+ NTSTATUS lsa_CloseTrustedDomainEx(
+ [in,out] policy_handle *handle
+ );
+
+ /* Function 0x35 */
+
+ /* w2k3 returns either 0x000bbbd000000000 or 0x000a48e800000000
+ for unknown6 - gd */
+ typedef struct {
+ uint32 enforce_restrictions;
+ hyper service_tkt_lifetime;
+ hyper user_tkt_lifetime;
+ hyper user_tkt_renewaltime;
+ hyper clock_skew;
+ hyper unknown6;
+ } lsa_DomainInfoKerberos;
+
+ typedef struct {
+ uint32 blob_size;
+ [size_is(blob_size)] uint8 *efs_blob;
+ } lsa_DomainInfoEfs;
+
+ typedef enum {
+ LSA_DOMAIN_INFO_POLICY_EFS=2,
+ LSA_DOMAIN_INFO_POLICY_KERBEROS=3
+ } lsa_DomainInfoEnum;
+
+ typedef [switch_type(uint16)] union {
+ [case(LSA_DOMAIN_INFO_POLICY_EFS)] lsa_DomainInfoEfs efs_info;
+ [case(LSA_DOMAIN_INFO_POLICY_KERBEROS)] lsa_DomainInfoKerberos kerberos_info;
+ } lsa_DomainInformationPolicy;
+
+ NTSTATUS lsa_QueryDomainInformationPolicy(
+ [in] policy_handle *handle,
+ [in] uint16 level,
+ [out,unique,switch_is(level)] lsa_DomainInformationPolicy *info
+ );
+
+ /* Function 0x36 */
+ NTSTATUS lsa_SetDomainInformationPolicy(
+ [in] policy_handle *handle,
+ [in] uint16 level,
+ [in,unique,switch_is(level)] lsa_DomainInformationPolicy *info
+ );
+
+ /**********************/
+ /* Function 0x37 */
+ NTSTATUS lsa_OpenTrustedDomainByName(
+ [in] policy_handle *handle,
+ [in] lsa_String name,
+ [in] uint32 access_mask,
+ [out] policy_handle *trustdom_handle
+ );
+
+ /* Function 0x38 */
+ NTSTATUS lsa_TestCall();
+
+ /**********************/
+ /* Function 0x39 */
+
+ typedef struct {
+ lsa_SidType sid_type;
+ lsa_String name;
+ uint32 sid_index;
+ uint32 unknown;
+ } lsa_TranslatedName2;
+
+ typedef struct {
+ [range(0,1000)] uint32 count;
+ [size_is(count)] lsa_TranslatedName2 *names;
+ } lsa_TransNameArray2;
+
+ NTSTATUS lsa_LookupSids2(
+ [in] policy_handle *handle,
+ [in] lsa_SidArray *sids,
+ [out,unique] lsa_RefDomainList *domains,
+ [in,out] lsa_TransNameArray2 *names,
+ [in] uint16 level,
+ [in,out] uint32 *count,
+ [in] uint32 unknown1,
+ [in] uint32 unknown2
+ );
+
+ /**********************/
+ /* Function 0x3a */
+
+ typedef struct {
+ lsa_SidType sid_type;
+ uint32 rid;
+ uint32 sid_index;
+ uint32 unknown;
+ } lsa_TranslatedSid2;
+
+ typedef struct {
+ [range(0,1000)] uint32 count;
+ [size_is(count)] lsa_TranslatedSid2 *sids;
+ } lsa_TransSidArray2;
+
+ NTSTATUS lsa_LookupNames2 (
+ [in] policy_handle *handle,
+ [in,range(0,1000)] uint32 num_names,
+ [in,size_is(num_names)] lsa_String names[],
+ [out,unique] lsa_RefDomainList *domains,
+ [in,out] lsa_TransSidArray2 *sids,
+ [in] uint16 level,
+ [in,out] uint32 *count,
+ [in] uint32 unknown1,
+ [in] uint32 unknown2
+ );
+
+ /* Function 0x3b */
+ NTSTATUS lsa_CreateTrustedDomainEx2();
+
+ /* Function 0x3c */
+ NTSTATUS lsa_CREDRWRITE();
+
+ /* Function 0x3d */
+ NTSTATUS lsa_CREDRREAD();
+
+ /* Function 0x3e */
+ NTSTATUS lsa_CREDRENUMERATE();
+
+ /* Function 0x3f */
+ NTSTATUS lsa_CREDRWRITEDOMAINCREDENTIALS();
+
+ /* Function 0x40 */
+ NTSTATUS lsa_CREDRREADDOMAINCREDENTIALS();
+
+ /* Function 0x41 */
+ NTSTATUS lsa_CREDRDELETE();
+
+ /* Function 0x42 */
+ NTSTATUS lsa_CREDRGETTARGETINFO();
+
+ /* Function 0x43 */
+ NTSTATUS lsa_CREDRPROFILELOADED();
+
+ /**********************/
+ /* Function 0x44 */
+ typedef struct {
+ lsa_SidType sid_type;
+ dom_sid2 *sid;
+ uint32 sid_index;
+ uint32 unknown;
+ } lsa_TranslatedSid3;
+
+ typedef struct {
+ [range(0,1000)] uint32 count;
+ [size_is(count)] lsa_TranslatedSid3 *sids;
+ } lsa_TransSidArray3;
+
+ NTSTATUS lsa_LookupNames3 (
+ [in] policy_handle *handle,
+ [in,range(0,1000)] uint32 num_names,
+ [in,size_is(num_names)] lsa_String names[],
+ [out,unique] lsa_RefDomainList *domains,
+ [in,out] lsa_TransSidArray3 *sids,
+ [in] uint16 level,
+ [in,out] uint32 *count,
+ [in] uint32 unknown1,
+ [in] uint32 unknown2
+ );
+
+ /* Function 0x45 */
+ NTSTATUS lsa_CREDRGETSESSIONTYPES();
+
+ /* Function 0x46 */
+ NTSTATUS lsa_LSARREGISTERAUDITEVENT();
+
+ /* Function 0x47 */
+ NTSTATUS lsa_LSARGENAUDITEVENT();
+
+ /* Function 0x48 */
+ NTSTATUS lsa_LSARUNREGISTERAUDITEVENT();
+
+ /* Function 0x49 */
+ NTSTATUS lsa_LSARQUERYFORESTTRUSTINFORMATION();
+
+ /* Function 0x4a */
+ NTSTATUS lsa_LSARSETFORESTTRUSTINFORMATION();
+
+ /* Function 0x4b */
+ NTSTATUS lsa_CREDRRENAME();
+
+ /*****************/
+ /* Function 0x4c */
+
+ NTSTATUS lsa_LookupSids3(
+ [in] lsa_SidArray *sids,
+ [out,unique] lsa_RefDomainList *domains,
+ [in,out] lsa_TransNameArray2 *names,
+ [in] uint16 level,
+ [in,out] uint32 *count,
+ [in] uint32 unknown1,
+ [in] uint32 unknown2
+ );
+
+ /* Function 0x4d */
+ NTSTATUS lsa_LookupNames4(
+ [in,range(0,1000)] uint32 num_names,
+ [in,size_is(num_names)] lsa_String names[],
+ [out,unique] lsa_RefDomainList *domains,
+ [in,out] lsa_TransSidArray3 *sids,
+ [in] uint16 level,
+ [in,out] uint32 *count,
+ [in] uint32 unknown1,
+ [in] uint32 unknown2
+ );
+
+ /* Function 0x4e */
+ NTSTATUS lsa_LSAROPENPOLICYSCE();
+
+ /* Function 0x4f */
+ NTSTATUS lsa_LSARADTREGISTERSECURITYEVENTSOURCE();
+
+ /* Function 0x50 */
+ NTSTATUS lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE();
+
+ /* Function 0x51 */
+ NTSTATUS lsa_LSARADTREPORTSECURITYEVENT();
+
+}
diff --git a/source3/librpc/idl/misc.idl b/source3/librpc/idl/misc.idl
new file mode 100644
index 0000000000..353457dd02
--- /dev/null
+++ b/source3/librpc/idl/misc.idl
@@ -0,0 +1,47 @@
+/*
+ miscellaneous IDL structures
+*/
+
+
+[
+ pointer_default(unique)
+]
+interface misc
+{
+ typedef [public,noprint,gensize,noejs] struct {
+ uint32 time_low;
+ uint16 time_mid;
+ uint16 time_hi_and_version;
+ uint8 clock_seq[2];
+ uint8 node[6];
+ } GUID;
+
+ typedef [public] struct {
+ uint32 handle_type;
+ GUID uuid;
+ } policy_handle;
+
+ /* secure channel types */
+ /* Only SEC_CHAN_WKSTA can forward requests to other domains. */
+
+ typedef [public] enum {
+ SEC_CHAN_WKSTA = 2,
+ SEC_CHAN_DOMAIN = 4,
+ SEC_CHAN_BDC = 6
+ } netr_SchannelType;
+
+ /* SAM database types */
+ typedef [public,v1_enum] enum {
+ SAM_DATABASE_DOMAIN = 0, /* Domain users and groups */
+ SAM_DATABASE_BUILTIN = 1, /* BUILTIN users and groups */
+ SAM_DATABASE_PRIVS = 2 /* Privileges */
+ } netr_SamDatabaseID;
+
+ typedef [public,v1_enum] enum {
+ SAMR_REJECT_OTHER = 0,
+ SAMR_REJECT_TOO_SHORT = 1,
+ SAMR_REJECT_COMPLEXITY = 2
+ } samr_RejectReason;
+
+
+}
diff --git a/source3/librpc/idl/netlogon.idl b/source3/librpc/idl/netlogon.idl
new file mode 100644
index 0000000000..e406d51329
--- /dev/null
+++ b/source3/librpc/idl/netlogon.idl
@@ -0,0 +1,1203 @@
+/*
+ netlogon interface
+ much of this was derived from the ethereal sources - thanks to everyone
+ who contributed!
+*/
+
+#include "idl_types.h"
+
+[
+ uuid("12345678-1234-abcd-ef00-01234567cffb"),
+ version(1.0),
+ endpoint("ncacn_np:[\\pipe\\netlogon]","ncacn_ip_tcp:","ncalrpc:"),
+ pointer_default(unique),
+ pointer_default_top(unique),
+ depends(lsa,samr,security),
+ keepref
+]
+
+interface netlogon
+{
+ declare bitmap samr_AcctFlags;
+
+ /*****************/
+ /* Function 0x00 */
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *account_name;
+ uint32 priv;
+ uint32 auth_flags;
+ uint32 logon_count;
+ uint32 bad_pw_count;
+ time_t last_logon;
+ time_t last_logoff;
+ time_t logoff_time;
+ time_t kickoff_time;
+ uint32 password_age;
+ time_t pw_can_change;
+ time_t pw_must_change;
+ [string,charset(UTF16)] uint16 *computer;
+ [string,charset(UTF16)] uint16 *domain;
+ [string,charset(UTF16)] uint16 *script_path;
+ uint32 unknown;
+ } netr_UasInfo;
+
+ WERROR netr_LogonUasLogon(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16)] uint16 account_name[],
+ [in] [string,charset(UTF16)] uint16 workstation[],
+ [out] netr_UasInfo *info
+ );
+
+
+ /*****************/
+ /* Function 0x01 */
+
+ typedef struct {
+ uint32 duration;
+ uint16 logon_count;
+ } netr_UasLogoffInfo;
+
+ WERROR netr_LogonUasLogoff(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16)] uint16 account_name[],
+ [in] [string,charset(UTF16)] uint16 workstation[],
+ [out] netr_UasLogoffInfo info
+ );
+
+
+ /*****************/
+ /* Function 0x02 */
+
+ /* in netr_AcctLockStr size seems to be be 24, and rrenard thinks
+ that the structure of the bindata looks like this:
+
+ dlong lockout_duration;
+ udlong reset_count;
+ uint32 bad_attempt_lockout;
+ uint32 dummy;
+
+ but it doesn't look as though this structure is reflected at the
+ NDR level. Maybe it is left to the application to decode the bindata array.
+ */
+ typedef struct {
+ uint16 size;
+ uint16 length;
+ [size_is(size/2),length_is(length/2)] uint16 *bindata;
+ } netr_AcctLockStr;
+
+ const int MSV1_0_CLEARTEXT_PASSWORD_ALLOWED = 0x002;
+ const int MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT = 0x020;
+ const int MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT = 0x800;
+
+ typedef struct {
+ lsa_String domain_name;
+ uint32 parameter_control; /* see MSV1_0_* */
+ uint32 logon_id_low;
+ uint32 logon_id_high;
+ lsa_String account_name;
+ lsa_String workstation;
+ } netr_IdentityInfo;
+
+ typedef struct {
+ netr_IdentityInfo identity_info;
+ samr_Password lmpassword;
+ samr_Password ntpassword;
+ } netr_PasswordInfo;
+
+ typedef [flag(NDR_PAHEX)] struct {
+ uint16 length;
+ [value(length)] uint16 size;
+ [size_is(length),length_is(length)] uint8 *data;
+ } netr_ChallengeResponse;
+
+ typedef [flag(NDR_PAHEX)] struct {
+ netr_IdentityInfo identity_info;
+ uint8 challenge[8];
+ netr_ChallengeResponse nt;
+ netr_ChallengeResponse lm;
+ } netr_NetworkInfo;
+
+ typedef [public,switch_type(uint16)] union {
+ [case(1)] netr_PasswordInfo *password;
+ [case(2)] netr_NetworkInfo *network;
+ [case(3)] netr_PasswordInfo *password;
+ [case(5)] netr_PasswordInfo *password;
+ [case(6)] netr_NetworkInfo *network;
+ } netr_LogonLevel;
+
+ typedef [public] struct {
+ uint32 rid;
+ uint32 attributes;
+ } netr_GroupMembership;
+
+ typedef [public,flag(NDR_PAHEX)] struct {
+ uint8 key[16];
+ } netr_UserSessionKey;
+
+ typedef [public,flag(NDR_PAHEX)] struct {
+ uint8 key[8];
+ } netr_LMSessionKey;
+
+ /* Flags for user_flags below */
+ typedef [public,bitmap32bit] bitmap {
+ NETLOGON_GUEST = 0x0001,
+ NETLOGON_NOENCRYPTION = 0x0002,
+ NETLOGON_CACHED_ACCOUNT = 0x0004,
+ NETLOGON_USED_LM_PASSWORD = 0x0008,
+ NETLOGON_EXTRA_SIDS = 0x0020,
+ NETLOGON_SUBAUTH_SESSION_KEY = 0x0040,
+ NETLOGON_SERVER_TRUST_ACCOUNT = 0x0080,
+ NETLOGON_NTLMV2_ENABLED = 0x0100,
+ NETLOGON_RESOURCE_GROUPS = 0x0200,
+ NETLOGON_PROFILE_PATH_RETURNED = 0x0400
+ } netr_UserFlags;
+
+ typedef struct {
+ NTTIME last_logon;
+ NTTIME last_logoff;
+ NTTIME acct_expiry;
+ NTTIME last_password_change;
+ NTTIME allow_password_change;
+ NTTIME force_password_change;
+ lsa_String account_name;
+ lsa_String full_name;
+ lsa_String logon_script;
+ lsa_String profile_path;
+ lsa_String home_directory;
+ lsa_String home_drive;
+ uint16 logon_count;
+ uint16 bad_password_count;
+ uint32 rid;
+ uint32 primary_gid;
+ samr_RidWithAttributeArray groups;
+ netr_UserFlags user_flags;
+ netr_UserSessionKey key;
+ lsa_StringLarge logon_server;
+ lsa_StringLarge domain;
+ dom_sid2 *domain_sid;
+ netr_LMSessionKey LMSessKey;
+ samr_AcctFlags acct_flags;
+ uint32 unknown[7];
+ } netr_SamBaseInfo;
+
+ typedef struct {
+ netr_SamBaseInfo base;
+ } netr_SamInfo2;
+
+ typedef struct {
+ dom_sid2 *sid;
+ uint32 attribute;
+ } netr_SidAttr;
+
+ typedef [public] struct {
+ netr_SamBaseInfo base;
+ uint32 sidcount;
+ [size_is(sidcount)] netr_SidAttr *sids;
+ } netr_SamInfo3;
+
+ typedef struct {
+ netr_SamBaseInfo base;
+ uint32 sidcount;
+ [size_is(sidcount)] netr_SidAttr *sids;
+ lsa_String forest;
+ lsa_String principle;
+ uint32 unknown4[20];
+ } netr_SamInfo6;
+
+ typedef struct {
+ uint32 pac_size;
+ [size_is(pac_size)] uint8 *pac;
+ lsa_String logon_domain;
+ lsa_String logon_server;
+ lsa_String principal_name;
+ uint32 auth_size;
+ [size_is(auth_size)] uint8 *auth;
+ netr_UserSessionKey user_session_key;
+ uint32 expansionroom[10];
+ lsa_String unknown1;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ } netr_PacInfo;
+
+ typedef [public,switch_type(uint16)] union {
+ [case(2)] netr_SamInfo2 *sam2;
+ [case(3)] netr_SamInfo3 *sam3;
+ [case(4)] netr_PacInfo *pac;
+ [case(5)] netr_PacInfo *pac;
+ [case(6)] netr_SamInfo6 *sam6;
+ } netr_Validation;
+
+ typedef [public, flag(NDR_PAHEX)] struct {
+ uint8 data[8];
+ } netr_Credential;
+
+ typedef [public] struct {
+ netr_Credential cred;
+ time_t timestamp;
+ } netr_Authenticator;
+
+ NTSTATUS netr_LogonSamLogon(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16)] uint16 *computer_name,
+ [in] netr_Authenticator *credential,
+ [in][out] netr_Authenticator *return_authenticator,
+ [in] uint16 logon_level,
+ [in] [switch_is(logon_level)] netr_LogonLevel logon,
+ [in] uint16 validation_level,
+ [out] [switch_is(validation_level)] netr_Validation validation,
+ [out] uint8 authoritative
+ );
+
+
+ /*****************/
+ /* Function 0x03 */
+
+ NTSTATUS netr_LogonSamLogoff(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16)] uint16 *computer_name,
+ [in] netr_Authenticator *credential,
+ [in][out] netr_Authenticator *return_authenticator,
+ [in] uint16 logon_level,
+ [in] [switch_is(logon_level)] netr_LogonLevel logon
+ );
+
+
+
+ /*****************/
+ /* Function 0x04 */
+
+ NTSTATUS netr_ServerReqChallenge(
+ [in,string,charset(UTF16)] uint16 *server_name,
+ [in,string,charset(UTF16)] uint16 computer_name[],
+ [in,out,ref] netr_Credential *credentials
+ );
+
+
+ /*****************/
+ /* Function 0x05 */
+
+ declare enum netr_SchannelType;
+
+ NTSTATUS netr_ServerAuthenticate(
+ [in,string,charset(UTF16)] uint16 *server_name,
+ [in,string,charset(UTF16)] uint16 account_name[],
+ [in] netr_SchannelType secure_channel_type,
+ [in,string,charset(UTF16)] uint16 computer_name[],
+ [in,out,ref] netr_Credential *credentials
+ );
+
+
+ /*****************/
+ /* Function 0x06 */
+
+ NTSTATUS netr_ServerPasswordSet(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16)] uint16 account_name[],
+ [in] netr_SchannelType secure_channel_type,
+ [in] [string,charset(UTF16)] uint16 computer_name[],
+ [in] netr_Authenticator credential,
+ [in] samr_Password new_password,
+ [out] netr_Authenticator return_authenticator
+ );
+
+
+ /*****************/
+ /* Function 0x07 */
+
+ declare enum netr_SamDatabaseID;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *account_name;
+ lsa_String unknown1;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ uint32 unknown5;
+ uint32 unknown6;
+ uint32 unknown7;
+ uint32 unknown8;
+ } netr_DELTA_DELETE_USER;
+
+ typedef struct {
+ uint16 length;
+ [value(length)] uint16 size;
+ uint32 flags;
+ samr_Password pwd;
+ } netr_USER_KEY16;
+
+ typedef struct {
+ uint16 nt_length;
+ uint16 nt_size;
+ uint32 nt_flags;
+ uint16 lm_length;
+ uint16 lm_size;
+ uint32 lm_flags;
+ uint8 nt_history[nt_length];
+ uint8 lm_history[lm_length];
+ } netr_PasswordHistory;
+
+ typedef struct {
+ netr_USER_KEY16 lmpassword;
+ netr_USER_KEY16 ntpassword;
+ netr_PasswordHistory lmhistory;
+ } netr_USER_KEYS2;
+
+ typedef struct {
+ netr_USER_KEYS2 keys2;
+ } netr_USER_KEY_UNION;
+
+ typedef [public] struct {
+ uint32 version;
+ netr_USER_KEY_UNION keys;
+ } netr_USER_KEYS;
+
+ typedef struct {
+ boolean8 SensitiveDataFlag;
+ uint32 DataLength;
+
+ /* netr_USER_KEYS encrypted with the session key */
+ [size_is(DataLength)][flag(NDR_PAHEX)] uint8 *SensitiveData;
+ } netr_USER_PRIVATE_INFO;
+
+ typedef struct {
+ lsa_String account_name;
+ lsa_String full_name;
+ uint32 rid;
+ uint32 primary_gid;
+ lsa_String home_directory;
+ lsa_String home_drive;
+ lsa_String logon_script;
+ lsa_String description;
+ lsa_String workstations;
+ NTTIME last_logon;
+ NTTIME last_logoff;
+ samr_LogonHours logon_hours;
+ uint16 bad_password_count;
+ uint16 logon_count;
+ NTTIME last_password_change;
+ NTTIME acct_expiry;
+ samr_AcctFlags acct_flags;
+ samr_Password lmpassword;
+ samr_Password ntpassword;
+ boolean8 nt_password_present;
+ boolean8 lm_password_present;
+ boolean8 password_expired;
+ lsa_String comment;
+ lsa_String parameters;
+ uint16 country_code;
+ uint16 code_page;
+ netr_USER_PRIVATE_INFO user_private_info;
+ uint32 SecurityInformation;
+ sec_desc_buf sdbuf;
+ lsa_String profile_path;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ uint32 unknown5;
+ uint32 unknown6;
+ uint32 unknown7;
+ uint32 unknown8;
+ } netr_DELTA_USER;
+
+ typedef struct {
+ lsa_String domain_name;
+ lsa_String comment;
+ dlong force_logoff_time;
+ uint16 min_password_length;
+ uint16 password_history_length;
+ /* yes, these are signed. They are in negative 100ns */
+ dlong max_password_age;
+ dlong min_password_age;
+ udlong sequence_num;
+ NTTIME domain_create_time;
+ uint32 SecurityInformation;
+ sec_desc_buf sdbuf;
+ netr_AcctLockStr account_lockout;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ uint32 logon_to_chgpass;
+ uint32 unknown6;
+ uint32 unknown7;
+ uint32 unknown8;
+ } netr_DELTA_DOMAIN;
+
+ typedef struct {
+ lsa_String group_name;
+ uint32 rid;
+ uint32 attributes;
+ lsa_String description;
+ uint32 SecurityInformation;
+ sec_desc_buf sdbuf;
+ lsa_String unknown1;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ uint32 unknown5;
+ uint32 unknown6;
+ uint32 unknown7;
+ uint32 unknown8;
+ } netr_DELTA_GROUP;
+
+ typedef struct {
+ lsa_String OldName;
+ lsa_String NewName;
+ lsa_String unknown1;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ uint32 unknown5;
+ uint32 unknown6;
+ uint32 unknown7;
+ uint32 unknown8;
+ } netr_DELTA_RENAME;
+
+ typedef struct {
+ [size_is(num_rids)] uint32 *rids;
+ [size_is(num_rids)] uint32 *attribs;
+ uint32 num_rids;
+ uint32 unknown1;
+ uint32 unknown2;
+ uint32 unknown3;
+ uint32 unknown4;
+ } netr_DELTA_GROUP_MEMBER;
+
+ typedef struct {
+ lsa_String alias_name;
+ uint32 rid;
+ uint32 SecurityInformation;
+ sec_desc_buf sdbuf;
+ lsa_String description;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ uint32 unknown5;
+ uint32 unknown6;
+ uint32 unknown7;
+ uint32 unknown8;
+ } netr_DELTA_ALIAS;
+
+ typedef struct {
+ lsa_SidArray sids;
+ uint32 unknown1;
+ uint32 unknown2;
+ uint32 unknown3;
+ uint32 unknown4;
+ } netr_DELTA_ALIAS_MEMBER;
+
+ typedef struct {
+ uint32 pagedpoollimit;
+ uint32 nonpagedpoollimit;
+ uint32 minimumworkingsetsize;
+ uint32 maximumworkingsetsize;
+ uint32 pagefilelimit;
+ NTTIME timelimit;
+ } netr_QUOTA_LIMITS;
+
+ typedef struct {
+ uint32 maxlogsize;
+ NTTIME auditretentionperiod;
+ boolean8 auditingmode;
+ uint32 maxauditeventcount;
+ [size_is(maxauditeventcount+1)] uint32 *eventauditoptions;
+ lsa_String primary_domain_name;
+ dom_sid2 *sid;
+ netr_QUOTA_LIMITS quota_limits;
+ udlong sequence_num;
+ NTTIME db_create_time;
+ uint32 SecurityInformation;
+ sec_desc_buf sdbuf;
+ lsa_String unknown1;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ uint32 unknown5;
+ uint32 unknown6;
+ uint32 unknown7;
+ uint32 unknown8;
+ } netr_DELTA_POLICY;
+
+ typedef struct {
+ lsa_String domain_name;
+ uint32 num_controllers;
+ [size_is(num_controllers)] lsa_String *controller_names;
+ uint32 SecurityInformation;
+ sec_desc_buf sdbuf;
+ lsa_String unknown1;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ uint32 posix_offset;
+ uint32 unknown6;
+ uint32 unknown7;
+ uint32 unknown8;
+ } netr_DELTA_TRUSTED_DOMAIN;
+
+ typedef struct {
+ uint16 unknown;
+ } netr_DELTA_DELETE_TRUST;
+
+ typedef struct {
+ uint32 privilege_entries;
+ uint32 privilege_control;
+ [size_is(privilege_entries)] uint32 *privilege_attrib;
+ [size_is(privilege_entries)] lsa_String *privilege_name;
+ netr_QUOTA_LIMITS quotalimits;
+ uint32 system_flags;
+ uint32 SecurityInformation;
+ sec_desc_buf sdbuf;
+ lsa_String unknown1;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ uint32 unknown5;
+ uint32 unknown6;
+ uint32 unknown7;
+ uint32 unknown8;
+ } netr_DELTA_ACCOUNT;
+
+ typedef struct {
+ uint16 unknown;
+ } netr_DELTA_DELETE_ACCOUNT;
+
+ typedef struct {
+ uint16 unknown;
+ } netr_DELTA_DELETE_SECRET;
+
+ typedef struct {
+ uint32 len;
+ uint32 maxlen;
+ [size_is(maxlen)][length_is(len)] uint8 *cipher_data;
+ } netr_CIPHER_VALUE;
+
+ typedef struct {
+ netr_CIPHER_VALUE current_cipher;
+ NTTIME current_cipher_set_time;
+ netr_CIPHER_VALUE old_cipher;
+ NTTIME old_cipher_set_time;
+ uint32 SecurityInformation;
+ sec_desc_buf sdbuf;
+ lsa_String unknown1;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ lsa_String unknown4;
+ uint32 unknown5;
+ uint32 unknown6;
+ uint32 unknown7;
+ uint32 unknown8;
+ } netr_DELTA_SECRET;
+
+ typedef enum {
+ NETR_DELTA_DOMAIN = 1,
+ NETR_DELTA_GROUP = 2,
+ NETR_DELTA_DELETE_GROUP = 3,
+ NETR_DELTA_RENAME_GROUP = 4,
+ NETR_DELTA_USER = 5,
+ NETR_DELTA_DELETE_USER = 6,
+ NETR_DELTA_RENAME_USER = 7,
+ NETR_DELTA_GROUP_MEMBER = 8,
+ NETR_DELTA_ALIAS = 9,
+ NETR_DELTA_DELETE_ALIAS = 10,
+ NETR_DELTA_RENAME_ALIAS = 11,
+ NETR_DELTA_ALIAS_MEMBER = 12,
+ NETR_DELTA_POLICY = 13,
+ NETR_DELTA_TRUSTED_DOMAIN = 14,
+ NETR_DELTA_DELETE_TRUST = 15,
+ NETR_DELTA_ACCOUNT = 16,
+ NETR_DELTA_DELETE_ACCOUNT = 17,
+ NETR_DELTA_SECRET = 18,
+ NETR_DELTA_DELETE_SECRET = 19,
+ NETR_DELTA_DELETE_GROUP2 = 20,
+ NETR_DELTA_DELETE_USER2 = 21,
+ NETR_DELTA_MODIFY_COUNT = 22
+ } netr_DeltaEnum;
+
+ typedef [switch_type(netr_DeltaEnum)] union {
+ [case(NETR_DELTA_DOMAIN)] netr_DELTA_DOMAIN *domain;
+ [case(NETR_DELTA_GROUP)] netr_DELTA_GROUP *group;
+ [case(NETR_DELTA_DELETE_GROUP)] ; /* rid only */
+ [case(NETR_DELTA_RENAME_GROUP)] netr_DELTA_RENAME *rename_group;
+ [case(NETR_DELTA_USER)] netr_DELTA_USER *user;
+ [case(NETR_DELTA_DELETE_USER)] ; /* rid only */
+ [case(NETR_DELTA_RENAME_USER)] netr_DELTA_RENAME *rename_user;
+ [case(NETR_DELTA_GROUP_MEMBER)] netr_DELTA_GROUP_MEMBER *group_member;
+ [case(NETR_DELTA_ALIAS)] netr_DELTA_ALIAS *alias;
+ [case(NETR_DELTA_DELETE_ALIAS)] ; /* rid only */
+ [case(NETR_DELTA_RENAME_ALIAS)] netr_DELTA_RENAME *rename_alias;
+ [case(NETR_DELTA_ALIAS_MEMBER)] netr_DELTA_ALIAS_MEMBER *alias_member;
+ [case(NETR_DELTA_POLICY)] netr_DELTA_POLICY *policy;
+ [case(NETR_DELTA_TRUSTED_DOMAIN)] netr_DELTA_TRUSTED_DOMAIN *trusted_domain;
+ [case(NETR_DELTA_DELETE_TRUST)] netr_DELTA_DELETE_TRUST delete_trust;
+ [case(NETR_DELTA_ACCOUNT)] netr_DELTA_ACCOUNT *account;
+ [case(NETR_DELTA_DELETE_ACCOUNT)] netr_DELTA_DELETE_ACCOUNT delete_account;
+ [case(NETR_DELTA_SECRET)] netr_DELTA_SECRET *secret;
+ [case(NETR_DELTA_DELETE_SECRET)] netr_DELTA_DELETE_SECRET delete_secret;
+ [case(NETR_DELTA_DELETE_GROUP2)] netr_DELTA_DELETE_USER *delete_group;
+ [case(NETR_DELTA_DELETE_USER2)] netr_DELTA_DELETE_USER *delete_user;
+ [case(NETR_DELTA_MODIFY_COUNT)] udlong *modified_count;
+ } netr_DELTA_UNION;
+
+ typedef [switch_type(netr_DeltaEnum)] union {
+ [case(NETR_DELTA_DOMAIN)] uint32 rid;
+ [case(NETR_DELTA_GROUP)] uint32 rid;
+ [case(NETR_DELTA_DELETE_GROUP)] uint32 rid;
+ [case(NETR_DELTA_RENAME_GROUP)] uint32 rid;
+ [case(NETR_DELTA_USER)] uint32 rid;
+ [case(NETR_DELTA_DELETE_USER)] uint32 rid;
+ [case(NETR_DELTA_RENAME_USER)] uint32 rid;
+ [case(NETR_DELTA_GROUP_MEMBER)] uint32 rid;
+ [case(NETR_DELTA_ALIAS)] uint32 rid;
+ [case(NETR_DELTA_DELETE_ALIAS)] uint32 rid;
+ [case(NETR_DELTA_RENAME_ALIAS)] uint32 rid;
+ [case(NETR_DELTA_ALIAS_MEMBER)] uint32 rid;
+ [case(NETR_DELTA_POLICY)] dom_sid2 *sid;
+ [case(NETR_DELTA_TRUSTED_DOMAIN)] dom_sid2 *sid;
+ [case(NETR_DELTA_DELETE_TRUST)] dom_sid2 *sid;
+ [case(NETR_DELTA_ACCOUNT)] dom_sid2 *sid;
+ [case(NETR_DELTA_DELETE_ACCOUNT)] dom_sid2 *sid;
+ [case(NETR_DELTA_SECRET)] [string,charset(UTF16)] uint16 *name;
+ [case(NETR_DELTA_DELETE_SECRET)] [string,charset(UTF16)] uint16 *name;
+ [case(NETR_DELTA_DELETE_GROUP2)] uint32 rid;
+ [case(NETR_DELTA_DELETE_USER2)] uint32 rid;
+ [case(NETR_DELTA_MODIFY_COUNT)] ;
+ } netr_DELTA_ID_UNION;
+
+ typedef struct {
+ netr_DeltaEnum delta_type;
+ [switch_is(delta_type)] netr_DELTA_ID_UNION delta_id_union;
+ [switch_is(delta_type)] netr_DELTA_UNION delta_union;
+ } netr_DELTA_ENUM;
+
+ typedef struct {
+ uint32 num_deltas;
+ [size_is(num_deltas)] netr_DELTA_ENUM *delta_enum;
+ } netr_DELTA_ENUM_ARRAY;
+
+
+ NTSTATUS netr_DatabaseDeltas(
+ [in] [string,charset(UTF16)] uint16 logon_server[],
+ [in] [string,charset(UTF16)] uint16 computername[],
+ [in] netr_Authenticator credential,
+ [in,out] netr_Authenticator return_authenticator,
+ [in] netr_SamDatabaseID database_id,
+ [in,out] udlong sequence_num,
+ [in] uint32 preferredmaximumlength,
+ [out] netr_DELTA_ENUM_ARRAY *delta_enum_array
+ );
+
+
+ /*****************/
+ /* Function 0x08 */
+
+ NTSTATUS netr_DatabaseSync(
+ [in] [string,charset(UTF16)] uint16 logon_server[],
+ [in] [string,charset(UTF16)] uint16 computername[],
+ [in] netr_Authenticator credential,
+ [in,out] netr_Authenticator return_authenticator,
+ [in] netr_SamDatabaseID database_id,
+ [in,out] uint32 sync_context,
+ [in] uint32 preferredmaximumlength,
+ [out] netr_DELTA_ENUM_ARRAY *delta_enum_array
+ );
+
+
+ /*****************/
+ /* Function 0x09 */
+
+ /* w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this call */
+
+ typedef [flag(NDR_PAHEX)] struct {
+ uint8 computer_name[16];
+ uint32 timecreated;
+ uint32 serial_number;
+ } netr_UAS_INFO_0;
+
+ typedef struct {
+ [flag(NDR_REMAINING)] DATA_BLOB blob;
+ } netr_AccountBuffer;
+
+ NTSTATUS netr_AccountDeltas(
+ [in] [string,charset(UTF16)] uint16 *logon_server,
+ [in] [string,charset(UTF16)] uint16 computername[],
+ [in] netr_Authenticator credential,
+ [in,out] netr_Authenticator return_authenticator,
+ [in] netr_UAS_INFO_0 uas,
+ [in] uint32 count,
+ [in] uint32 level,
+ [in] uint32 buffersize,
+ [out,subcontext(4)] netr_AccountBuffer buffer,
+ [out] uint32 count_returned,
+ [out] uint32 total_entries,
+ [out] netr_UAS_INFO_0 recordid
+ );
+
+
+ /*****************/
+ /* Function 0x0A */
+
+ NTSTATUS netr_AccountSync(
+ [in] [string,charset(UTF16)] uint16 *logon_server,
+ [in] [string,charset(UTF16)] uint16 computername[],
+ [in] netr_Authenticator credential,
+ [in,out] netr_Authenticator return_authenticator,
+ [in] uint32 reference,
+ [in] uint32 level,
+ [in] uint32 buffersize,
+ [out,subcontext(4)] netr_AccountBuffer buffer,
+ [out] uint32 count_returned,
+ [out] uint32 total_entries,
+ [out] uint32 next_reference,
+ [in,out] netr_UAS_INFO_0 recordid
+ );
+
+
+ /*****************/
+ /* Function 0x0B */
+
+ NTSTATUS netr_GetDcName(
+ [in] [string,charset(UTF16)] uint16 logon_server[],
+ [in] [string,charset(UTF16)] uint16 *domainname,
+ [out] [string,charset(UTF16)] uint16 *dcname
+ );
+
+ /*****************/
+ /* Function 0x0C */
+
+ typedef struct {
+ uint32 flags;
+ uint32 pdc_connection_status;
+ } netr_NETLOGON_INFO_1;
+
+ typedef struct {
+ uint32 flags;
+ uint32 pdc_connection_status;
+ [string,charset(UTF16)] uint16 trusted_dc_name[];
+ uint32 tc_connection_status;
+ } netr_NETLOGON_INFO_2;
+
+ typedef struct {
+ uint32 flags;
+ uint32 logon_attempts;
+ uint32 unknown1;
+ uint32 unknown2;
+ uint32 unknown3;
+ uint32 unknown4;
+ uint32 unknown5;
+ } netr_NETLOGON_INFO_3;
+
+ typedef union {
+ [case(1)] netr_NETLOGON_INFO_1 *info1;
+ [case(2)] netr_NETLOGON_INFO_2 *info2;
+ [case(3)] netr_NETLOGON_INFO_3 *info3;
+ } netr_CONTROL_QUERY_INFORMATION;
+
+ /* function_code values */
+ typedef [v1_enum] enum {
+ NETLOGON_CONTROL_REDISCOVER = 5,
+ NETLOGON_CONTROL_TC_QUERY = 6,
+ NETLOGON_CONTROL_TRANSPORT_NOTIFY = 7,
+ NETLOGON_CONTROL_SET_DBFLAG = 65534
+ } netr_LogonControlCode;
+
+ WERROR netr_LogonControl(
+ [in] [string,charset(UTF16)] uint16 *logon_server,
+ [in] netr_LogonControlCode function_code,
+ [in] uint32 level,
+ [out,switch_is(level)] netr_CONTROL_QUERY_INFORMATION info
+ );
+
+
+ /*****************/
+ /* Function 0x0D */
+
+ WERROR netr_GetAnyDCName(
+ [in] [string,charset(UTF16)] uint16 *logon_server,
+ [in] [string,charset(UTF16)] uint16 *domainname,
+ [out] [string,charset(UTF16)] uint16 *dcname
+ );
+
+
+ /*****************/
+ /* Function 0x0E */
+
+ typedef union {
+ [case(NETLOGON_CONTROL_REDISCOVER)] [string,charset(UTF16)] uint16 *domain;
+ [case(NETLOGON_CONTROL_TC_QUERY)] [string,charset(UTF16)] uint16 *domain;
+ [case(NETLOGON_CONTROL_TRANSPORT_NOTIFY)] [string,charset(UTF16)] uint16 *domain;
+ [case(NETLOGON_CONTROL_SET_DBFLAG)] uint32 debug_level;
+ } netr_CONTROL_DATA_INFORMATION;
+
+ WERROR netr_LogonControl2(
+ [in] [string,charset(UTF16)] uint16 *logon_server,
+ [in] uint32 function_code,
+ [in] uint32 level,
+ [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION data,
+ [out][switch_is(level)] netr_CONTROL_QUERY_INFORMATION query
+ );
+
+
+ /* If this flag is not set, then the passwords and LM session keys are
+ * encrypted with DES calls. (And the user session key is
+ * unencrypted) */
+ const int NETLOGON_NEG_ARCFOUR = 0x00000004;
+ const int NETLOGON_NEG_128BIT = 0x00004000;
+ const int NETLOGON_NEG_SCHANNEL = 0x40000000;
+
+ /*****************/
+ /* Function 0x0F */
+
+ NTSTATUS netr_ServerAuthenticate2(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16)] uint16 account_name[],
+ [in] netr_SchannelType secure_channel_type,
+ [in] [string,charset(UTF16)] uint16 computer_name[],
+ [in,out,ref] netr_Credential *credentials,
+ [in,out,ref] uint32 *negotiate_flags
+ );
+
+
+ /*****************/
+ /* Function 0x10 */
+
+ NTSTATUS netr_DatabaseSync2(
+ [in] [string,charset(UTF16)] uint16 logon_server[],
+ [in] [string,charset(UTF16)] uint16 computername[],
+ [in] netr_Authenticator credential,
+ [in,out] netr_Authenticator return_authenticator,
+ [in] netr_SamDatabaseID database_id,
+ [in] uint16 restart_state,
+ [in,out] uint32 sync_context,
+ [in] uint32 preferredmaximumlength,
+ [out] netr_DELTA_ENUM_ARRAY *delta_enum_array
+ );
+
+
+ /*****************/
+ /* Function 0x11 */
+
+ /* i'm not at all sure how this call works */
+
+ NTSTATUS netr_DatabaseRedo(
+ [in] [string,charset(UTF16)] uint16 logon_server[],
+ [in] [string,charset(UTF16)] uint16 computername[],
+ [in] netr_Authenticator credential,
+ [in,out] netr_Authenticator return_authenticator,
+ [in][size_is(change_log_entry_size)] uint8 *change_log_entry,
+ [in] uint32 change_log_entry_size,
+ [out] netr_DELTA_ENUM_ARRAY *delta_enum_array
+ );
+
+
+ /*****************/
+ /* Function 0x12 */
+
+ WERROR netr_LogonControl2Ex(
+ [in] [string,charset(UTF16)] uint16 *logon_server,
+ [in] uint32 function_code,
+ [in] uint32 level,
+ [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION data,
+ [out][switch_is(level)] netr_CONTROL_QUERY_INFORMATION query
+ );
+
+ /*****************/
+ /* Function 0x13 */
+ WERROR netr_NETRENUMERATETRUSTEDDOMAINS() ;
+
+ /*****************/
+ /* Function 0x14 */
+ typedef struct {
+ [string,charset(UTF16)] uint16 *dc_unc;
+ [string,charset(UTF16)] uint16 *dc_address;
+ int32 dc_address_type;
+ GUID domain_guid;
+ [string,charset(UTF16)] uint16 *domain_name;
+ [string,charset(UTF16)] uint16 *forest_name;
+ uint32 dc_flags;
+ [string,charset(UTF16)] uint16 *dc_site_name;
+ [string,charset(UTF16)] uint16 *client_site_name;
+ } netr_DsRGetDCNameInfo;
+
+ WERROR netr_DsRGetDCName(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *domain_name,
+ [in] GUID *domain_guid,
+ [in] GUID *site_guid,
+ [in] uint32 flags,
+ [out] netr_DsRGetDCNameInfo *info
+ );
+
+ /*****************/
+ /* Function 0x15 */
+ WERROR netr_NETRLOGONDUMMYROUTINE1();
+
+ /****************/
+ /* Function 0x16 */
+ WERROR netr_NETRLOGONSETSERVICEBITS();
+
+ /****************/
+ /* Function 0x17 */
+ WERROR netr_NETRLOGONGETTRUSTRID();
+
+ /****************/
+ /* Function 0x18 */
+ WERROR netr_NETRLOGONCOMPUTESERVERDIGEST();
+
+ /****************/
+ /* Function 0x19 */
+ WERROR netr_NETRLOGONCOMPUTECLIENTDIGEST();
+
+ /****************/
+ /* Function 0x1a */
+ NTSTATUS netr_ServerAuthenticate3(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16)] uint16 account_name[],
+ [in] netr_SchannelType secure_channel_type,
+ [in] [string,charset(UTF16)] uint16 computer_name[],
+ [in,out,ref] netr_Credential *credentials,
+ [in,out,ref] uint32 *negotiate_flags,
+ [out,ref] uint32 *rid
+ );
+
+ /****************/
+ /* Function 0x1b */
+
+ WERROR netr_DsRGetDCNameEx(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *domain_name,
+ [in] GUID *domain_guid,
+ [in] [string,charset(UTF16)] uint16 *site_name,
+ [in] uint32 flags,
+ [out] netr_DsRGetDCNameInfo *info
+ );
+
+ /****************/
+ /* Function 0x1c */
+ WERROR netr_DsRGetSiteName(
+ [in] [string,charset(UTF16)] uint16 *computer_name,
+ [out] [string,charset(UTF16)] uint16 *site
+ );
+
+ /****************/
+ /* Function 0x1d */
+
+ typedef struct {
+ uint32 length;
+ [size_is(length)] uint8 *data;
+ } netr_Blob;
+
+ typedef [flag(NDR_PAHEX)] struct {
+ uint16 length;
+ uint16 size;
+ [size_is(size/2),length_is(length/2)] uint16 *data;
+ } netr_BinaryString;
+
+ typedef struct {
+ netr_Blob blob;
+ [string,charset(UTF16)] uint16 *workstation_domain;
+ [string,charset(UTF16)] uint16 *workstation_site;
+ [string,charset(UTF16)] uint16 *unknown1;
+ [string,charset(UTF16)] uint16 *unknown2;
+ [string,charset(UTF16)] uint16 *unknown3;
+ [string,charset(UTF16)] uint16 *unknown4;
+ netr_BinaryString blob2;
+ lsa_String product;
+ lsa_String unknown5;
+ lsa_String unknown6;
+ uint32 unknown7[4];
+ } netr_DomainQuery1;
+
+ typedef union {
+ [case(1)] netr_DomainQuery1 *query1;
+ [case(2)] netr_DomainQuery1 *query1;
+ } netr_DomainQuery;
+
+ typedef struct {
+ lsa_String domainname;
+ lsa_String fulldomainname;
+ lsa_String forest;
+ GUID guid;
+ dom_sid2 *sid;
+ netr_BinaryString unknown1[4];
+ uint32 unknown[4];
+ } netr_DomainTrustInfo;
+
+ typedef struct {
+ netr_DomainTrustInfo domaininfo;
+ uint32 num_trusts;
+ [size_is(num_trusts)] netr_DomainTrustInfo *trusts;
+ uint32 unknown[14]; /* room for expansion? */
+ } netr_DomainInfo1;
+
+ typedef union {
+ [case(1)] netr_DomainInfo1 *info1;
+ [case(2)] netr_DomainInfo1 *info1;
+ } netr_DomainInfo;
+
+ NTSTATUS netr_LogonGetDomainInfo(
+ [in] [string,charset(UTF16)] uint16 server_name[],
+ [in] [string,charset(UTF16)] uint16 *computer_name,
+ [in,ref] netr_Authenticator *credential,
+ [in,out,ref] netr_Authenticator *return_authenticator,
+ [in] uint32 level,
+ [in,switch_is(level)] netr_DomainQuery query,
+ [out,switch_is(level)] netr_DomainInfo info
+ );
+
+ typedef [flag(NDR_PAHEX)] struct {
+ uint8 data[512];
+ uint32 length;
+ } netr_CryptPassword;
+
+ /*****************/
+ /* Function 0x1e */
+ NTSTATUS netr_ServerPasswordSet2(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16)] uint16 account_name[],
+ [in] netr_SchannelType secure_channel_type,
+ [in] [string,charset(UTF16)] uint16 computer_name[],
+ [in] netr_Authenticator credential,
+ [in] netr_CryptPassword new_password,
+ [out] netr_Authenticator return_authenticator
+ );
+
+ /****************/
+ /* Function 0x1f */
+ WERROR netr_NETRSERVERPASSWORDGET();
+
+ /****************/
+ /* Function 0x20 */
+ WERROR netr_NETRLOGONSENDTOSAM();
+
+ /****************/
+ /* Function 0x21 */
+ WERROR netr_DSRADDRESSTOSITENAMESW();
+
+ /****************/
+ /* Function 0x22 */
+ WERROR netr_DsRGetDCNameEx2(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *client_account,
+ [in] uint32 mask,
+ [in] [string,charset(UTF16)] uint16 *domain_name,
+ [in] GUID *domain_guid,
+ [in] [string,charset(UTF16)] uint16 *site_name,
+ [in] uint32 flags,
+ [out] netr_DsRGetDCNameInfo *info
+ );
+
+ /****************/
+ /* Function 0x23 */
+ WERROR netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN();
+
+ /****************/
+ /* Function 0x24 */
+ WERROR netr_NETRENUMERATETRUSTEDDOMAINSEX();
+
+ /****************/
+ /* Function 0x25 */
+ WERROR netr_DSRADDRESSTOSITENAMESEXW();
+
+ /****************/
+ /* Function 0x26 */
+ WERROR netr_DSRGETDCSITECOVERAGEW();
+
+ /****************/
+ /* Function 0x27 */
+ NTSTATUS netr_LogonSamLogonEx(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16)] uint16 *computer_name,
+ [in] uint16 logon_level,
+ [in] [switch_is(logon_level)] netr_LogonLevel logon,
+ [in] uint16 validation_level,
+ [out] [switch_is(validation_level)] netr_Validation validation,
+ [out] uint8 authoritative,
+ [in,out] uint32 flags
+ );
+
+ /****************/
+ /* Function 0x28 */
+
+ typedef [bitmap32bit] bitmap {
+ NETR_TRUST_FLAG_IN_FOREST = 0x00000001,
+ NETR_TRUST_FLAG_OUTBOUND = 0x00000002,
+ NETR_TRUST_FLAG_TREEROOT = 0x00000004,
+ NETR_TRUST_FLAG_PRIMARY = 0x00000008,
+ NETR_TRUST_FLAG_NATIVE = 0x00000010,
+ NETR_TRUST_FLAG_INBOUND = 0x00000020
+ } netr_TrustFlags;
+
+ typedef [v1_enum] enum {
+ NETR_TRUST_TYPE_DOWNLEVEL = 1,
+ NETR_TRUST_TYPE_UPLEVEL = 2,
+ NETR_TRUST_TYPE_MIT = 3,
+ NETR_TRUST_TYPE_DCE = 4
+ } netr_TrustType;
+
+ typedef [bitmap32bit] bitmap {
+ NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE = 0x00000001,
+ NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY = 0x00000002,
+ NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN = 0x00000004,
+ NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE = 0x00000008,
+ NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION = 0x00000010,
+ NETR_TRUST_ATTRIBUTE_WITHIN_FOREST = 0x00000020,
+ NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL = 0x00000040
+ } netr_TrustAttributes;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *netbios_name;
+ [string,charset(UTF16)] uint16 *dns_name;
+ netr_TrustFlags trust_flags;
+ uint32 parent_index;
+ netr_TrustType trust_type;
+ netr_TrustAttributes trust_attributes;
+ dom_sid2 *sid;
+ GUID guid;
+ } netr_DomainTrust;
+
+ WERROR netr_DsrEnumerateDomainTrusts(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] netr_TrustFlags trust_flags,
+ [out] uint32 count,
+ [out,size_is(count)] netr_DomainTrust *trusts
+ );
+
+
+ /****************/
+ /* Function 0x29 */
+ WERROR netr_DSRDEREGISTERDNSHOSTRECORDS();
+
+ /****************/
+ /* Function 0x2a */
+ WERROR netr_NETRSERVERTRUSTPASSWORDSGET();
+
+ /****************/
+ /* Function 0x2b */
+ WERROR netr_DSRGETFORESTTRUSTINFORMATION();
+
+ /****************/
+ /* Function 0x2c */
+ WERROR netr_NETRGETFORESTTRUSTINFORMATION();
+
+ /****************/
+ /* Function 0x2d */
+
+ /* this is the ADS varient. I don't yet know what the "flags" are for */
+ NTSTATUS netr_LogonSamLogonWithFlags(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16)] uint16 *computer_name,
+ [in] netr_Authenticator *credential,
+ [in][out] netr_Authenticator *return_authenticator,
+ [in] uint16 logon_level,
+ [in] [switch_is(logon_level)] netr_LogonLevel logon,
+ [in] uint16 validation_level,
+ [out] [switch_is(validation_level)] netr_Validation validation,
+ [out] uint8 authoritative,
+ [in,out] uint32 flags
+ );
+
+ /****************/
+ /* Function 0x2e */
+ WERROR netr_NETRSERVERGETTRUSTINFO();
+}
diff --git a/source3/librpc/idl/ntsvcs.idl b/source3/librpc/idl/ntsvcs.idl
new file mode 100644
index 0000000000..05ba68e727
--- /dev/null
+++ b/source3/librpc/idl/ntsvcs.idl
@@ -0,0 +1,77 @@
+/*
+ plug and play services
+*/
+
+[
+ uuid("8d9f4e40-a03d-11ce-8f69-08003e30051b"),
+ version(1.0),
+ helpstring("Plug and Play services")
+]
+interface ntsvcs
+{
+ void PNP_Disconnect();
+ void PNP_Connect();
+ void PNP_GetVersion();
+ void PNP_GetGlobalState();
+ void PNP_InitDetection();
+ void PNP_ReportLogOn();
+ void PNP_ValidateDeviceInstance();
+ void PNP_GetRootDeviceInstance();
+ void PNP_GetRelatedDeviceInstance();
+ void PNP_EnumerateSubKeys();
+ void PNP_GetDeviceList();
+ void PNP_GetDeviceListSize();
+ void PNP_GetDepth();
+ void PNP_GetDeviceRegProp();
+ void PNP_SetDeviceRegProp();
+ void PNP_GetClassInstance();
+ void PNP_CreateKey();
+ void PNP_DeleteRegistryKey();
+ void PNP_GetClassCount();
+ void PNP_GetClassName();
+ void PNP_DeleteClassKey();
+ void PNP_GetInterfaceDeviceAlias();
+ void PNP_GetInterfaceDeviceList();
+ void PNP_GetInterfaceDeviceListSize();
+ void PNP_RegisterDeviceClassAssociation();
+ void PNP_UnregisterDeviceClassAssociation();
+ void PNP_GetClassRegProp();
+ void PNP_SetClassRegProp();
+ void PNP_CreateDevInst();
+ void PNP_DeviceInstanceAction();
+ void PNP_GetDeviceStatus();
+ void PNP_SetDeviceProblem();
+ void PNP_DisableDevInst();
+ void PNP_UninstallDevInst();
+ void PNP_AddID();
+ void PNP_RegisterDriver();
+ void PNP_QueryRemove();
+ void PNP_RequestDeviceEject();
+ void PNP_IsDockStationPresent();
+ void PNP_RequestEjectPC();
+ void PNP_HwProfFlags();
+ void PNP_GetHwProfInfo();
+ void PNP_AddEmptyLogConf();
+ void PNP_FreeLogConf();
+ void PNP_GetFirstLogConf();
+ void PNP_GetNextLogConf();
+ void PNP_GetLogConfPriority();
+ void PNP_AddResDes();
+ void PNP_FreeResDes();
+ void PNP_GetNextResDes();
+ void PNP_GetResDesData();
+ void PNP_GetResDesDataSize();
+ void PNP_ModifyResDes();
+ void PNP_DetectResourceLimit();
+ void PNP_QueryResConfList();
+ void PNP_SetHwProf();
+ void PNP_QueryArbitratorFreeData();
+ void PNP_QueryArbitratorFreeSize();
+ void PNP_RunDetection();
+ void PNP_RegisterNotification();
+ void PNP_UnregisterNotification();
+ void PNP_GetCustomDevProp();
+ void PNP_GetVersionInternal();
+ void PNP_GetBlockedDriverInfo();
+ void PNP_GetServerSideDeviceInstallFlags();
+}
diff --git a/source3/librpc/idl/samr.idl b/source3/librpc/idl/samr.idl
new file mode 100644
index 0000000000..8ee31f8655
--- /dev/null
+++ b/source3/librpc/idl/samr.idl
@@ -0,0 +1,1235 @@
+#include "idl_types.h"
+
+/*
+ samr interface definition
+*/
+
+/*
+ Thanks to Todd Sabin for some information from his samr.idl in acltools
+*/
+
+[ uuid("12345778-1234-abcd-ef00-0123456789ac"),
+ version(1.0),
+ endpoint("ncacn_np:[\\pipe\\samr]","ncacn_ip_tcp:", "ncalrpc:"),
+ pointer_default(unique),
+ pointer_default_top(unique),
+ depends(misc,lsa,security),
+ keepref
+] interface samr
+{
+ declare bitmap security_secinfo;
+
+ /* account control (acct_flags) bits */
+ typedef [public,bitmap32bit] bitmap {
+ ACB_DISABLED = 0x00000001, /* 1 = User account disabled */
+ ACB_HOMDIRREQ = 0x00000002, /* 1 = Home directory required */
+ ACB_PWNOTREQ = 0x00000004, /* 1 = User password not required */
+ ACB_TEMPDUP = 0x00000008, /* 1 = Temporary duplicate account */
+ ACB_NORMAL = 0x00000010, /* 1 = Normal user account */
+ ACB_MNS = 0x00000020, /* 1 = MNS logon user account */
+ ACB_DOMTRUST = 0x00000040, /* 1 = Interdomain trust account */
+ ACB_WSTRUST = 0x00000080, /* 1 = Workstation trust account */
+ ACB_SVRTRUST = 0x00000100, /* 1 = Server trust account */
+ ACB_PWNOEXP = 0x00000200, /* 1 = User password does not expire */
+ ACB_AUTOLOCK = 0x00000400, /* 1 = Account auto locked */
+ ACB_ENC_TXT_PWD_ALLOWED = 0x00000800, /* 1 = Encryped text password is allowed */
+ ACB_SMARTCARD_REQUIRED = 0x00001000, /* 1 = Smart Card required */
+ ACB_TRUSTED_FOR_DELEGATION = 0x00002000, /* 1 = Trusted for Delegation */
+ ACB_NOT_DELEGATED = 0x00004000, /* 1 = Not delegated */
+ ACB_USE_DES_KEY_ONLY = 0x00008000, /* 1 = Use DES key only */
+ ACB_DONT_REQUIRE_PREAUTH = 0x00010000, /* 1 = Preauth not required */
+ ACB_PW_EXPIRED = 0x00020000, /* 1 = Password Expired */
+ ACB_NO_AUTH_DATA_REQD = 0x00080000 /* 1 = No authorization data required */
+ } samr_AcctFlags;
+
+ /******************/
+ /* Function: 0x00 */
+ NTSTATUS samr_Connect (
+ /* notice the lack of [string] */
+ [in] uint16 *system_name,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *connect_handle
+ );
+
+
+ /******************/
+ /* Function: 0x01 */
+ NTSTATUS samr_Close (
+ [in,out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x02 */
+
+ NTSTATUS samr_SetSecurity (
+ [in,ref] policy_handle *handle,
+ [in] security_secinfo sec_info,
+ [in,ref] sec_desc_buf *sdbuf
+ );
+
+ /******************/
+ /* Function: 0x03 */
+
+ NTSTATUS samr_QuerySecurity (
+ [in,ref] policy_handle *handle,
+ [in] security_secinfo sec_info,
+ [out] sec_desc_buf *sdbuf
+ );
+
+ /******************/
+ /* Function: 0x04 */
+
+ /*
+ shutdown the SAM - once you call this the SAM will be dead
+ */
+ NTSTATUS samr_Shutdown (
+ [in,ref] policy_handle *connect_handle
+ );
+
+ /******************/
+ /* Function: 0x05 */
+ NTSTATUS samr_LookupDomain (
+ [in,ref] policy_handle *connect_handle,
+ [in,ref] lsa_String *domain_name,
+ [out] dom_sid2 *sid
+ );
+
+
+ /******************/
+ /* Function: 0x06 */
+
+ typedef struct {
+ uint32 idx;
+ lsa_String name;
+ } samr_SamEntry;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] samr_SamEntry *entries;
+ } samr_SamArray;
+
+ NTSTATUS samr_EnumDomains (
+ [in,ref] policy_handle *connect_handle,
+ [in,out,ref] uint32 *resume_handle,
+ [in] uint32 buf_size,
+ [out] samr_SamArray *sam,
+ [out] uint32 num_entries
+ );
+
+
+ /************************/
+ /* Function 0x07 */
+ NTSTATUS samr_OpenDomain(
+ [in,ref] policy_handle *connect_handle,
+ [in] uint32 access_mask,
+ [in,ref] dom_sid2 *sid,
+ [out,ref] policy_handle *domain_handle
+ );
+
+ /************************/
+ /* Function 0x08 */
+ /* server roles */
+ typedef [v1_enum] enum {
+ ROLE_STANDALONE = 0,
+ ROLE_DOMAIN_MEMBER = 1,
+ ROLE_DOMAIN_BDC = 2,
+ ROLE_DOMAIN_PDC = 3
+ } samr_Role;
+
+ /* password properties flags */
+ typedef [public,bitmap32bit] bitmap {
+ DOMAIN_PASSWORD_COMPLEX = 0x00000001,
+ DOMAIN_PASSWORD_NO_ANON_CHANGE = 0x00000002,
+ DOMAIN_PASSWORD_NO_CLEAR_CHANGE = 0x00000004,
+ DOMAIN_PASSWORD_LOCKOUT_ADMINS = 0x00000008,
+ DOMAIN_PASSWORD_STORE_CLEARTEXT = 0x00000010,
+ DOMAIN_REFUSE_PASSWORD_CHANGE = 0x00000020
+ } samr_PasswordProperties;
+
+ typedef struct {
+ uint16 min_password_length;
+ uint16 password_history_length;
+ samr_PasswordProperties password_properties;
+ /* yes, these are signed. They are in negative 100ns */
+ dlong max_password_age;
+ dlong min_password_age;
+ } samr_DomInfo1;
+
+ typedef struct {
+ NTTIME force_logoff_time;
+ lsa_String comment;
+ lsa_String domain_name;
+ lsa_String primary; /* PDC name if this is a BDC */
+ udlong sequence_num;
+ uint32 unknown2;
+ samr_Role role;
+ uint32 unknown3;
+ uint32 num_users;
+ uint32 num_groups;
+ uint32 num_aliases;
+ } samr_DomInfo2;
+
+ typedef struct {
+ NTTIME force_logoff_time;
+ } samr_DomInfo3;
+
+ typedef struct {
+ lsa_String comment;
+ } samr_DomInfo4;
+
+ typedef struct {
+ lsa_String domain_name;
+ } samr_DomInfo5;
+
+ typedef struct {
+ lsa_String primary;
+ } samr_DomInfo6;
+
+ typedef struct {
+ samr_Role role;
+ } samr_DomInfo7;
+
+ typedef struct {
+ hyper sequence_num;
+ NTTIME domain_create_time;
+ } samr_DomInfo8;
+
+ typedef struct {
+ uint32 unknown; /* w2k3 returns 1 */
+ } samr_DomInfo9;
+
+ typedef struct {
+ samr_DomInfo2 info2;
+ hyper lockout_duration;
+ hyper lockout_window;
+ uint16 lockout_threshold;
+ } samr_DomInfo11;
+
+ typedef struct {
+ hyper lockout_duration;
+ hyper lockout_window;
+ uint16 lockout_threshold;
+ } samr_DomInfo12;
+
+ typedef struct {
+ hyper sequence_num;
+ NTTIME domain_create_time;
+ uint32 unknown1;
+ uint32 unknown2;
+ } samr_DomInfo13;
+
+ typedef [switch_type(uint16)] union {
+ [case(1)] samr_DomInfo1 info1;
+ [case(2)] samr_DomInfo2 info2;
+ [case(3)] samr_DomInfo3 info3;
+ [case(4)] samr_DomInfo4 info4;
+ [case(5)] samr_DomInfo5 info5;
+ [case(6)] samr_DomInfo6 info6;
+ [case(7)] samr_DomInfo7 info7;
+ [case(8)] samr_DomInfo8 info8;
+ [case(9)] samr_DomInfo9 info9;
+ [case(11)] samr_DomInfo11 info11;
+ [case(12)] samr_DomInfo12 info12;
+ [case(13)] samr_DomInfo13 info13;
+ } samr_DomainInfo;
+
+ NTSTATUS samr_QueryDomainInfo(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint16 level,
+ [out,switch_is(level)] samr_DomainInfo *info
+ );
+
+ /************************/
+ /* Function 0x09 */
+ /*
+ only levels 1, 3, 4, 6, 7, 9, 12 are valid for this
+ call in w2k3
+ */
+ NTSTATUS samr_SetDomainInfo(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint16 level,
+ [in,switch_is(level),ref] samr_DomainInfo *info
+ );
+
+
+ /************************/
+ /* Function 0x0a */
+ NTSTATUS samr_CreateDomainGroup(
+ [in,ref] policy_handle *domain_handle,
+ [in,ref] lsa_String *name,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *group_handle,
+ [out,ref] uint32 *rid
+ );
+
+
+ /************************/
+ /* Function 0x0b */
+ NTSTATUS samr_EnumDomainGroups(
+ [in,ref] policy_handle *domain_handle,
+ [in,out,ref] uint32 *resume_handle,
+ [in] uint32 max_size,
+ [out] samr_SamArray *sam,
+ [out] uint32 num_entries
+ );
+
+ /************************/
+ /* Function 0x0c */
+ NTSTATUS samr_CreateUser(
+ [in,ref] policy_handle *domain_handle,
+ [in,ref] lsa_String *account_name,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *user_handle,
+ [out,ref] uint32 *rid
+ );
+
+ /************************/
+ /* Function 0x0d */
+
+
+ /* w2k3 treats max_size as max_users*54 and sets the
+ resume_handle as the rid of the last user sent
+ */
+ const int SAMR_ENUM_USERS_MULTIPLIER = 54;
+
+ NTSTATUS samr_EnumDomainUsers(
+ [in,ref] policy_handle *domain_handle,
+ [in,out,ref] uint32 *resume_handle,
+ [in] samr_AcctFlags acct_flags,
+ [in] uint32 max_size,
+ [out] samr_SamArray *sam,
+ [out] uint32 num_entries
+ );
+
+ /************************/
+ /* Function 0x0e */
+ NTSTATUS samr_CreateDomAlias(
+ [in,ref] policy_handle *domain_handle,
+ [in,ref] lsa_String *alias_name,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *alias_handle,
+ [out,ref] uint32 *rid
+ );
+
+ /************************/
+ /* Function 0x0f */
+ NTSTATUS samr_EnumDomainAliases(
+ [in,ref] policy_handle *domain_handle,
+ [in,out,ref] uint32 *resume_handle,
+ [in] samr_AcctFlags acct_flags,
+ [out] samr_SamArray *sam,
+ [out] uint32 num_entries
+ );
+
+ /************************/
+ /* Function 0x10 */
+
+ typedef struct {
+ [range(0,1024)] uint32 count;
+ [size_is(count)] uint32 *ids;
+ } samr_Ids;
+
+ NTSTATUS samr_GetAliasMembership(
+ [in,ref] policy_handle *domain_handle,
+ [in,ref] lsa_SidArray *sids,
+ [out,ref] samr_Ids *rids
+ );
+
+ /************************/
+ /* Function 0x11 */
+
+ NTSTATUS samr_LookupNames(
+ [in,ref] policy_handle *domain_handle,
+ [in,range(0,1000)] uint32 num_names,
+ [in,size_is(1000),length_is(num_names)] lsa_String names[],
+ [out] samr_Ids rids,
+ [out] samr_Ids types
+ );
+
+
+ /************************/
+ /* Function 0x12 */
+ NTSTATUS samr_LookupRids(
+ [in,ref] policy_handle *domain_handle,
+ [in,range(0,1000)] uint32 num_rids,
+ [in,size_is(1000),length_is(num_rids)] uint32 rids[],
+ [out] lsa_Strings names,
+ [out] samr_Ids types
+ );
+
+ /************************/
+ /* Function 0x13 */
+ NTSTATUS samr_OpenGroup(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint32 access_mask,
+ [in] uint32 rid,
+ [out,ref] policy_handle *group_handle
+ );
+
+ /* Group attributes */
+ typedef [public,bitmap32bit] bitmap {
+ SE_GROUP_MANDATORY = 0x00000001,
+ SE_GROUP_ENABLED_BY_DEFAULT = 0x00000002,
+ SE_GROUP_ENABLED = 0x00000004,
+ SE_GROUP_OWNER = 0x00000008,
+ SE_GROUP_USE_FOR_DENY_ONLY = 0x00000010,
+ SE_GROUP_RESOURCE = 0x20000000,
+ SE_GROUP_LOGON_ID = 0xC0000000
+ } samr_GroupAttrs;
+
+ /************************/
+ /* Function 0x14 */
+
+ typedef struct {
+ lsa_String name;
+ samr_GroupAttrs attributes;
+ uint32 num_members;
+ lsa_String description;
+ } samr_GroupInfoAll;
+
+ typedef struct {
+ samr_GroupAttrs attributes;
+ } samr_GroupInfoAttributes;
+
+ typedef struct {
+ lsa_String description;
+ } samr_GroupInfoDescription;
+
+ typedef enum {
+ GROUPINFOALL = 1,
+ GROUPINFONAME = 2,
+ GROUPINFOATTRIBUTES = 3,
+ GROUPINFODESCRIPTION = 4,
+ GROUPINFOALL2 = 5
+ } samr_GroupInfoEnum;
+
+ typedef [switch_type(samr_GroupInfoEnum)] union {
+ [case(GROUPINFOALL)] samr_GroupInfoAll all;
+ [case(GROUPINFONAME)] lsa_String name;
+ [case(GROUPINFOATTRIBUTES)] samr_GroupInfoAttributes attributes;
+ [case(GROUPINFODESCRIPTION)] lsa_String description;
+ [case(GROUPINFOALL2)] samr_GroupInfoAll all2;
+ } samr_GroupInfo;
+
+ NTSTATUS samr_QueryGroupInfo(
+ [in,ref] policy_handle *group_handle,
+ [in] samr_GroupInfoEnum level,
+ [out,switch_is(level)] samr_GroupInfo *info
+ );
+
+ /************************/
+ /* Function 0x15 */
+ NTSTATUS samr_SetGroupInfo(
+ [in,ref] policy_handle *group_handle,
+ [in] samr_GroupInfoEnum level,
+ [in,switch_is(level),ref] samr_GroupInfo *info
+ );
+
+ /************************/
+ /* Function 0x16 */
+ NTSTATUS samr_AddGroupMember(
+ [in,ref] policy_handle *group_handle,
+ [in] uint32 rid,
+ [in] uint32 flags
+ );
+
+ /************************/
+ /* Function 0x17 */
+ NTSTATUS samr_DeleteDomainGroup(
+ [in,out,ref] policy_handle *group_handle
+ );
+
+ /************************/
+ /* Function 0x18 */
+ NTSTATUS samr_DeleteGroupMember(
+ [in,ref] policy_handle *group_handle,
+ [in] uint32 rid
+ );
+
+
+ /************************/
+ /* Function 0x19 */
+ typedef struct {
+ uint32 count;
+ [size_is(count)] uint32 *rids;
+ [size_is(count)] uint32 *types;
+ } samr_RidTypeArray;
+
+ NTSTATUS samr_QueryGroupMember(
+ [in,ref] policy_handle *group_handle,
+ [out] samr_RidTypeArray *rids
+ );
+
+
+ /************************/
+ /* Function 0x1a */
+
+ /*
+ win2003 seems to accept any data at all for the two integers
+ below, and doesn't seem to do anything with them that I can
+ see. Weird. I really expected the first integer to be a rid
+ and the second to be the attributes for that rid member.
+ */
+ NTSTATUS samr_SetMemberAttributesOfGroup(
+ [in,ref] policy_handle *group_handle,
+ [in] uint32 unknown1,
+ [in] uint32 unknown2
+ );
+
+
+ /************************/
+ /* Function 0x1b */
+ NTSTATUS samr_OpenAlias (
+ [in,ref] policy_handle *domain_handle,
+ [in] uint32 access_mask,
+ [in] uint32 rid,
+ [out,ref] policy_handle *alias_handle
+ );
+
+
+ /************************/
+ /* Function 0x1c */
+
+ typedef struct {
+ lsa_String name;
+ uint32 num_members;
+ lsa_String description;
+ } samr_AliasInfoAll;
+
+ typedef enum {
+ ALIASINFOALL = 1,
+ ALIASINFONAME = 2,
+ ALIASINFODESCRIPTION = 3
+ } samr_AliasInfoEnum;
+
+ typedef [switch_type(samr_AliasInfoEnum)] union {
+ [case(ALIASINFOALL)] samr_AliasInfoAll all;
+ [case(ALIASINFONAME)] lsa_String name;
+ [case(ALIASINFODESCRIPTION)] lsa_String description;
+ } samr_AliasInfo;
+
+ NTSTATUS samr_QueryAliasInfo(
+ [in,ref] policy_handle *alias_handle,
+ [in] samr_AliasInfoEnum level,
+ [out,switch_is(level)] samr_AliasInfo *info
+ );
+
+ /************************/
+ /* Function 0x1d */
+ NTSTATUS samr_SetAliasInfo(
+ [in,ref] policy_handle *alias_handle,
+ [in] samr_AliasInfoEnum level,
+ [in,switch_is(level),ref] samr_AliasInfo *info
+ );
+
+ /************************/
+ /* Function 0x1e */
+ NTSTATUS samr_DeleteDomAlias(
+ [in,out,ref] policy_handle *alias_handle
+ );
+
+ /************************/
+ /* Function 0x1f */
+ NTSTATUS samr_AddAliasMember(
+ [in,ref] policy_handle *alias_handle,
+ [in,ref] dom_sid2 *sid
+ );
+
+ /************************/
+ /* Function 0x20 */
+ NTSTATUS samr_DeleteAliasMember(
+ [in,ref] policy_handle *alias_handle,
+ [in,ref] dom_sid2 *sid
+ );
+
+ /************************/
+ /* Function 0x21 */
+ NTSTATUS samr_GetMembersInAlias(
+ [in,ref] policy_handle *alias_handle,
+ [out,ref] lsa_SidArray *sids
+ );
+
+ /************************/
+ /* Function 0x22 */
+ NTSTATUS samr_OpenUser(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint32 access_mask,
+ [in] uint32 rid,
+ [out,ref] policy_handle *user_handle
+ );
+
+ /************************/
+ /* Function 0x23 */
+ NTSTATUS samr_DeleteUser(
+ [in,out,ref] policy_handle *user_handle
+ );
+
+ /************************/
+ /* Function 0x24 */
+ typedef struct {
+ lsa_String account_name;
+ lsa_String full_name;
+ uint32 primary_gid;
+ lsa_String description;
+ lsa_String comment;
+ } samr_UserInfo1;
+
+ typedef struct {
+ lsa_String comment;
+ lsa_String unknown; /* settable, but doesn't stick. probably obsolete */
+ uint16 country_code;
+ uint16 code_page;
+ } samr_UserInfo2;
+
+ /* this is also used in samr and netlogon */
+ typedef [public, flag(NDR_PAHEX)] struct {
+ uint16 units_per_week;
+ [size_is(1260), length_is(units_per_week/8)] uint8 *bits;
+ } samr_LogonHours;
+
+ typedef struct {
+ lsa_String account_name;
+ lsa_String full_name;
+ uint32 rid;
+ uint32 primary_gid;
+ lsa_String home_directory;
+ lsa_String home_drive;
+ lsa_String logon_script;
+ lsa_String profile_path;
+ lsa_String workstations;
+ NTTIME last_logon;
+ NTTIME last_logoff;
+ NTTIME last_password_change;
+ NTTIME allow_password_change;
+ NTTIME force_password_change;
+ samr_LogonHours logon_hours;
+ uint16 bad_password_count;
+ uint16 logon_count;
+ samr_AcctFlags acct_flags;
+ } samr_UserInfo3;
+
+ typedef struct {
+ samr_LogonHours logon_hours;
+ } samr_UserInfo4;
+
+ typedef struct {
+ lsa_String account_name;
+ lsa_String full_name;
+ uint32 rid;
+ uint32 primary_gid;
+ lsa_String home_directory;
+ lsa_String home_drive;
+ lsa_String logon_script;
+ lsa_String profile_path;
+ lsa_String description;
+ lsa_String workstations;
+ NTTIME last_logon;
+ NTTIME last_logoff;
+ samr_LogonHours logon_hours;
+ uint16 bad_password_count;
+ uint16 logon_count;
+ NTTIME last_password_change;
+ NTTIME acct_expiry;
+ samr_AcctFlags acct_flags;
+ } samr_UserInfo5;
+
+ typedef struct {
+ lsa_String account_name;
+ lsa_String full_name;
+ } samr_UserInfo6;
+
+ typedef struct {
+ lsa_String account_name;
+ } samr_UserInfo7;
+
+ typedef struct {
+ lsa_String full_name;
+ } samr_UserInfo8;
+
+ typedef struct {
+ uint32 primary_gid;
+ } samr_UserInfo9;
+
+ typedef struct {
+ lsa_String home_directory;
+ lsa_String home_drive;
+ } samr_UserInfo10;
+
+ typedef struct {
+ lsa_String logon_script;
+ } samr_UserInfo11;
+
+ typedef struct {
+ lsa_String profile_path;
+ } samr_UserInfo12;
+
+ typedef struct {
+ lsa_String description;
+ } samr_UserInfo13;
+
+ typedef struct {
+ lsa_String workstations;
+ } samr_UserInfo14;
+
+ typedef struct {
+ samr_AcctFlags acct_flags;
+ } samr_UserInfo16;
+
+ typedef struct {
+ NTTIME acct_expiry;
+ } samr_UserInfo17;
+
+ typedef struct {
+ lsa_String parameters;
+ } samr_UserInfo20;
+
+ /* this defines the bits used for fields_present in info21 */
+ typedef [bitmap32bit] bitmap {
+ SAMR_FIELD_ACCOUNT_NAME = 0x00000001,
+ SAMR_FIELD_FULL_NAME = 0x00000002,
+ SAMR_FIELD_DESCRIPTION = 0x00000010,
+ SAMR_FIELD_COMMENT = 0x00000020,
+ SAMR_FIELD_LOGON_SCRIPT = 0x00000100,
+ SAMR_FIELD_PROFILE_PATH = 0x00000200,
+ SAMR_FIELD_WORKSTATIONS = 0x00000400,
+ SAMR_FIELD_LOGON_HOURS = 0x00002000,
+ SAMR_FIELD_ACCT_FLAGS = 0x00100000,
+ SAMR_FIELD_PARAMETERS = 0x00200000,
+ SAMR_FIELD_COUNTRY_CODE = 0x00400000,
+ SAMR_FIELD_CODE_PAGE = 0x00800000,
+ SAMR_FIELD_PASSWORD = 0x01000000, /* either of these */
+ SAMR_FIELD_PASSWORD2 = 0x02000000 /* two bits seems to work */
+ } samr_FieldsPresent;
+
+ typedef struct {
+ NTTIME last_logon;
+ NTTIME last_logoff;
+ NTTIME last_password_change;
+ NTTIME acct_expiry;
+ NTTIME allow_password_change;
+ NTTIME force_password_change;
+ lsa_String account_name;
+ lsa_String full_name;
+ lsa_String home_directory;
+ lsa_String home_drive;
+ lsa_String logon_script;
+ lsa_String profile_path;
+ lsa_String description;
+ lsa_String workstations;
+ lsa_String comment;
+ lsa_String parameters;
+ lsa_String unknown1;
+ lsa_String unknown2;
+ lsa_String unknown3;
+ uint32 buf_count;
+ [size_is(buf_count)] uint8 *buffer;
+ uint32 rid;
+ uint32 primary_gid;
+ samr_AcctFlags acct_flags;
+ samr_FieldsPresent fields_present;
+ samr_LogonHours logon_hours;
+ uint16 bad_password_count;
+ uint16 logon_count;
+ uint16 country_code;
+ uint16 code_page;
+ uint8 nt_password_set;
+ uint8 lm_password_set;
+ uint8 password_expired;
+ uint8 unknown4;
+ } samr_UserInfo21;
+
+ typedef [public, flag(NDR_PAHEX)] struct {
+ uint8 data[516];
+ } samr_CryptPassword;
+
+ typedef struct {
+ samr_UserInfo21 info;
+ samr_CryptPassword password;
+ } samr_UserInfo23;
+
+ typedef struct {
+ samr_CryptPassword password;
+ uint8 pw_len;
+ } samr_UserInfo24;
+
+ typedef [flag(NDR_PAHEX)] struct {
+ uint8 data[532];
+ } samr_CryptPasswordEx;
+
+ typedef struct {
+ samr_UserInfo21 info;
+ samr_CryptPasswordEx password;
+ } samr_UserInfo25;
+
+ typedef struct {
+ samr_CryptPasswordEx password;
+ uint8 pw_len;
+ } samr_UserInfo26;
+
+ typedef [switch_type(uint16)] union {
+ [case(1)] samr_UserInfo1 info1;
+ [case(2)] samr_UserInfo2 info2;
+ [case(3)] samr_UserInfo3 info3;
+ [case(4)] samr_UserInfo4 info4;
+ [case(5)] samr_UserInfo5 info5;
+ [case(6)] samr_UserInfo6 info6;
+ [case(7)] samr_UserInfo7 info7;
+ [case(8)] samr_UserInfo8 info8;
+ [case(9)] samr_UserInfo9 info9;
+ [case(10)] samr_UserInfo10 info10;
+ [case(11)] samr_UserInfo11 info11;
+ [case(12)] samr_UserInfo12 info12;
+ [case(13)] samr_UserInfo13 info13;
+ [case(14)] samr_UserInfo14 info14;
+ [case(16)] samr_UserInfo16 info16;
+ [case(17)] samr_UserInfo17 info17;
+ [case(20)] samr_UserInfo20 info20;
+ [case(21)] samr_UserInfo21 info21;
+ [case(23)] samr_UserInfo23 info23;
+ [case(24)] samr_UserInfo24 info24;
+ [case(25)] samr_UserInfo25 info25;
+ [case(26)] samr_UserInfo26 info26;
+ } samr_UserInfo;
+
+ NTSTATUS samr_QueryUserInfo(
+ [in,ref] policy_handle *user_handle,
+ [in] uint16 level,
+ [out,switch_is(level)] samr_UserInfo *info
+ );
+
+
+ /************************/
+ /* Function 0x25 */
+ NTSTATUS samr_SetUserInfo(
+ [in,ref] policy_handle *user_handle,
+ [in] uint16 level,
+ [in,ref,switch_is(level)] samr_UserInfo *info
+ );
+
+ /************************/
+ /* Function 0x26 */
+ typedef [public, flag(NDR_PAHEX)] struct {
+ uint8 hash[16];
+ } samr_Password;
+
+ /*
+ this is a password change interface that doesn't give
+ the server the plaintext password. Depricated.
+ */
+ NTSTATUS samr_ChangePasswordUser(
+ [in,ref] policy_handle *user_handle,
+ [in] boolean8 lm_present,
+ [in] samr_Password *old_lm_crypted,
+ [in] samr_Password *new_lm_crypted,
+ [in] boolean8 nt_present,
+ [in] samr_Password *old_nt_crypted,
+ [in] samr_Password *new_nt_crypted,
+ [in] boolean8 cross1_present,
+ [in] samr_Password *nt_cross,
+ [in] boolean8 cross2_present,
+ [in] samr_Password *lm_cross
+ );
+
+ /************************/
+ /* Function 0x27 */
+
+ typedef [public] struct {
+ uint32 rid;
+ samr_GroupAttrs attributes;
+ } samr_RidWithAttribute;
+
+ typedef [public] struct {
+ uint32 count;
+ [size_is(count)] samr_RidWithAttribute *rids;
+ } samr_RidWithAttributeArray;
+
+ NTSTATUS samr_GetGroupsForUser(
+ [in,ref] policy_handle *user_handle,
+ [out] samr_RidWithAttributeArray *rids
+ );
+
+ /************************/
+ /* Function 0x28 */
+
+ typedef struct {
+ uint32 idx;
+ uint32 rid;
+ samr_AcctFlags acct_flags;
+ lsa_String account_name;
+ lsa_String full_name;
+ lsa_String description;
+ } samr_DispEntryGeneral;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] samr_DispEntryGeneral *entries;
+ } samr_DispInfoGeneral;
+
+ typedef struct {
+ uint32 idx;
+ uint32 rid;
+ samr_AcctFlags acct_flags;
+ lsa_String account_name;
+ lsa_String description;
+ } samr_DispEntryFull;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] samr_DispEntryFull *entries;
+ } samr_DispInfoFull;
+
+ typedef struct {
+ uint32 idx;
+ lsa_AsciiString account_name;
+ } samr_DispEntryAscii;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] samr_DispEntryAscii *entries;
+ } samr_DispInfoAscii;
+
+ typedef [switch_type(uint16)] union {
+ [case(1)] samr_DispInfoGeneral info1;/* users */
+ [case(2)] samr_DispInfoFull info2; /* trust accounts? */
+ [case(3)] samr_DispInfoFull info3; /* groups */
+ [case(4)] samr_DispInfoAscii info4; /* users */
+ [case(5)] samr_DispInfoAscii info5; /* groups */
+ } samr_DispInfo;
+
+ NTSTATUS samr_QueryDisplayInfo(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint16 level,
+ [in] uint32 start_idx,
+ [in] uint32 max_entries,
+ [in] uint32 buf_size,
+ [out] uint32 total_size,
+ [out] uint32 returned_size,
+ [out,switch_is(level)] samr_DispInfo info
+ );
+
+
+ /************************/
+ /* Function 0x29 */
+
+ /*
+ this seems to be an alphabetic search function. The returned index
+ is the index for samr_QueryDisplayInfo needed to get names occurring
+ after the specified name. The supplied name does not need to exist
+ in the database (for example you can supply just a first letter for
+ searching starting at that letter)
+
+ The level corresponds to the samr_QueryDisplayInfo level
+ */
+ NTSTATUS samr_GetDisplayEnumerationIndex(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint16 level,
+ [in] lsa_String name,
+ [out] uint32 idx
+ );
+
+
+
+ /************************/
+ /* Function 0x2a */
+
+ /*
+ w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this
+ */
+ NTSTATUS samr_TestPrivateFunctionsDomain(
+ [in,ref] policy_handle *domain_handle
+ );
+
+
+ /************************/
+ /* Function 0x2b */
+
+ /*
+ w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this
+ */
+ NTSTATUS samr_TestPrivateFunctionsUser(
+ [in,ref] policy_handle *user_handle
+ );
+
+
+ /************************/
+ /* Function 0x2c */
+
+ typedef struct {
+ uint16 min_password_length;
+ samr_PasswordProperties password_properties;
+ } samr_PwInfo;
+
+ NTSTATUS samr_GetUserPwInfo(
+ [in,ref] policy_handle *user_handle,
+ [out] samr_PwInfo info
+ );
+
+ /************************/
+ /* Function 0x2d */
+ NTSTATUS samr_RemoveMemberFromForeignDomain(
+ [in,ref] policy_handle *domain_handle,
+ [in,ref] dom_sid2 *sid
+ );
+
+ /************************/
+ /* Function 0x2e */
+
+ /*
+ how is this different from QueryDomainInfo ??
+ */
+ NTSTATUS samr_QueryDomainInfo2(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint16 level,
+ [out,switch_is(level)] samr_DomainInfo *info
+ );
+
+ /************************/
+ /* Function 0x2f */
+
+ /*
+ how is this different from QueryUserInfo ??
+ */
+ NTSTATUS samr_QueryUserInfo2(
+ [in,ref] policy_handle *user_handle,
+ [in] uint16 level,
+ [out,switch_is(level)] samr_UserInfo *info
+ );
+
+ /************************/
+ /* Function 0x30 */
+
+ /*
+ how is this different from QueryDisplayInfo??
+ */
+ NTSTATUS samr_QueryDisplayInfo2(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint16 level,
+ [in] uint32 start_idx,
+ [in] uint32 max_entries,
+ [in] uint32 buf_size,
+ [out] uint32 total_size,
+ [out] uint32 returned_size,
+ [out,switch_is(level)] samr_DispInfo info
+ );
+
+ /************************/
+ /* Function 0x31 */
+
+ /*
+ how is this different from GetDisplayEnumerationIndex ??
+ */
+ NTSTATUS samr_GetDisplayEnumerationIndex2(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint16 level,
+ [in] lsa_String name,
+ [out] uint32 idx
+ );
+
+
+ /************************/
+ /* Function 0x32 */
+ NTSTATUS samr_CreateUser2(
+ [in,ref] policy_handle *domain_handle,
+ [in,ref] lsa_String *account_name,
+ [in] samr_AcctFlags acct_flags,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *user_handle,
+ [out,ref] uint32 *access_granted,
+ [out,ref] uint32 *rid
+ );
+
+
+ /************************/
+ /* Function 0x33 */
+
+ /*
+ another duplicate. There must be a reason ....
+ */
+ NTSTATUS samr_QueryDisplayInfo3(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint16 level,
+ [in] uint32 start_idx,
+ [in] uint32 max_entries,
+ [in] uint32 buf_size,
+ [out] uint32 total_size,
+ [out] uint32 returned_size,
+ [out,switch_is(level)] samr_DispInfo info
+ );
+
+ /************************/
+ /* Function 0x34 */
+ NTSTATUS samr_AddMultipleMembersToAlias(
+ [in,ref] policy_handle *alias_handle,
+ [in,ref] lsa_SidArray *sids
+ );
+
+ /************************/
+ /* Function 0x35 */
+ NTSTATUS samr_RemoveMultipleMembersFromAlias(
+ [in,ref] policy_handle *alias_handle,
+ [in,ref] lsa_SidArray *sids
+ );
+
+ /************************/
+ /* Function 0x36 */
+
+ NTSTATUS samr_OemChangePasswordUser2(
+ [in] lsa_AsciiString *server,
+ [in,ref] lsa_AsciiString *account,
+ [in] samr_CryptPassword *password,
+ [in] samr_Password *hash
+ );
+
+ /************************/
+ /* Function 0x37 */
+ NTSTATUS samr_ChangePasswordUser2(
+ [in] lsa_String *server,
+ [in,ref] lsa_String *account,
+ [in] samr_CryptPassword *nt_password,
+ [in] samr_Password *nt_verifier,
+ [in] boolean8 lm_change,
+ [in] samr_CryptPassword *lm_password,
+ [in] samr_Password *lm_verifier
+ );
+
+ /************************/
+ /* Function 0x38 */
+ NTSTATUS samr_GetDomPwInfo(
+ [in] lsa_String *domain_name,
+ [out] samr_PwInfo info
+ );
+
+ /************************/
+ /* Function 0x39 */
+ NTSTATUS samr_Connect2(
+ [in,string,charset(UTF16)] uint16 *system_name,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *connect_handle
+ );
+
+ /************************/
+ /* Function 0x3a */
+ /*
+ seems to be an exact alias for samr_SetUserInfo()
+ */
+ NTSTATUS samr_SetUserInfo2(
+ [in,ref] policy_handle *user_handle,
+ [in] uint16 level,
+ [in,ref,switch_is(level)] samr_UserInfo *info
+ );
+
+ /************************/
+ /* Function 0x3b */
+ /*
+ this one is mysterious. I have a few guesses, but nothing working yet
+ */
+ NTSTATUS samr_SetBootKeyInformation(
+ [in,ref] policy_handle *connect_handle,
+ [in] uint32 unknown1,
+ [in] uint32 unknown2,
+ [in] uint32 unknown3
+ );
+
+ /************************/
+ /* Function 0x3c */
+ NTSTATUS samr_GetBootKeyInformation(
+ [in,ref] policy_handle *domain_handle,
+ [out] uint32 unknown
+ );
+
+ /************************/
+ /* Function 0x3d */
+ NTSTATUS samr_Connect3(
+ [in,string,charset(UTF16)] uint16 *system_name,
+ /* this unknown value seems to be completely ignored by w2k3 */
+ [in] uint32 unknown,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *connect_handle
+ );
+
+ /************************/
+ /* Function 0x3e */
+ NTSTATUS samr_Connect4(
+ [in,string,charset(UTF16)] uint16 *system_name,
+ [in] uint32 unknown,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *connect_handle
+ );
+
+ /************************/
+ /* Function 0x3f */
+
+ declare enum samr_RejectReason;
+
+ typedef struct {
+ samr_RejectReason reason;
+ uint32 unknown1;
+ uint32 unknown2;
+ } samr_ChangeReject;
+
+ NTSTATUS samr_ChangePasswordUser3(
+ [in] lsa_String *server,
+ [in,ref] lsa_String *account,
+ [in] samr_CryptPassword *nt_password,
+ [in] samr_Password *nt_verifier,
+ [in] boolean8 lm_change,
+ [in] samr_CryptPassword *lm_password,
+ [in] samr_Password *lm_verifier,
+ [in] samr_CryptPassword *password3,
+ [out] samr_DomInfo1 *dominfo,
+ [out] samr_ChangeReject *reject
+ );
+
+ /************************/
+ /* Function 0x40 */
+
+ typedef struct {
+ uint32 unknown1; /* w2k3 gives 3 */
+ uint32 unknown2; /* w2k3 gives 0 */
+ } samr_ConnectInfo1;
+
+ typedef union {
+ [case(1)] samr_ConnectInfo1 info1;
+ } samr_ConnectInfo;
+
+ NTSTATUS samr_Connect5(
+ [in,string,charset(UTF16)] uint16 *system_name,
+ [in] uint32 access_mask,
+ [in,out] uint32 level,
+ [in,out,switch_is(level),ref] samr_ConnectInfo *info,
+ [out,ref] policy_handle *connect_handle
+ );
+
+ /************************/
+ /* Function 0x41 */
+ NTSTATUS samr_RidToSid(
+ [in,ref] policy_handle *domain_handle,
+ [in] uint32 rid,
+ [out] dom_sid2 *sid
+ );
+
+
+ /************************/
+ /* Function 0x42 */
+
+ /*
+ this should set the DSRM password for the server, which is used
+ when booting into Directory Services Recovery Mode on a DC. Win2003
+ gives me NT_STATUS_NOT_SUPPORTED
+ */
+
+ NTSTATUS samr_SetDsrmPassword(
+ [in] lsa_String *name,
+ [in] uint32 unknown,
+ [in] samr_Password *hash
+ );
+
+
+ /************************/
+ /* Function 0x43 */
+ /*
+ I haven't been able to work out the format of this one yet.
+ Seems to start with a switch level for a union?
+ */
+ NTSTATUS samr_ValidatePassword();
+}
diff --git a/source3/librpc/idl/security.idl b/source3/librpc/idl/security.idl
new file mode 100644
index 0000000000..8bf5e6f867
--- /dev/null
+++ b/source3/librpc/idl/security.idl
@@ -0,0 +1,355 @@
+#include "idl_types.h"
+
+/*
+ security IDL structures
+*/
+
+[
+ pointer_default(unique),
+ depends(misc,security)
+]
+interface security
+{
+ /*
+ access masks are divided up like this:
+ 0xabccdddd
+ where
+ a = generic rights bits SEC_GENERIC_
+ b = flags SEC_FLAG_
+ c = standard rights bits SEC_STD_
+ d = object type specific bits SEC_{FILE,DIR,REG,xxx}_
+
+ common combinations of bits are prefixed with SEC_RIGHTS_
+ */
+ const int SEC_MASK_GENERIC = 0xF0000000;
+ const int SEC_MASK_FLAGS = 0x0F000000;
+ const int SEC_MASK_STANDARD = 0x00FF0000;
+ const int SEC_MASK_SPECIFIC = 0x0000FFFF;
+
+ /* generic bits */
+ const int SEC_GENERIC_ALL = 0x10000000;
+ const int SEC_GENERIC_EXECUTE = 0x20000000;
+ const int SEC_GENERIC_WRITE = 0x40000000;
+ const int SEC_GENERIC_READ = 0x80000000;
+
+ /* flag bits */
+ const int SEC_FLAG_SYSTEM_SECURITY = 0x01000000;
+ const int SEC_FLAG_MAXIMUM_ALLOWED = 0x02000000;
+
+ /* standard bits */
+ const int SEC_STD_DELETE = 0x00010000;
+ const int SEC_STD_READ_CONTROL = 0x00020000;
+ const int SEC_STD_WRITE_DAC = 0x00040000;
+ const int SEC_STD_WRITE_OWNER = 0x00080000;
+ const int SEC_STD_SYNCHRONIZE = 0x00100000;
+ const int SEC_STD_REQUIRED = 0x000F0000;
+ const int SEC_STD_ALL = 0x001F0000;
+
+ /* file specific bits */
+ const int SEC_FILE_READ_DATA = 0x00000001;
+ const int SEC_FILE_WRITE_DATA = 0x00000002;
+ const int SEC_FILE_APPEND_DATA = 0x00000004;
+ const int SEC_FILE_READ_EA = 0x00000008;
+ const int SEC_FILE_WRITE_EA = 0x00000010;
+ const int SEC_FILE_EXECUTE = 0x00000020;
+ const int SEC_FILE_READ_ATTRIBUTE = 0x00000080;
+ const int SEC_FILE_WRITE_ATTRIBUTE = 0x00000100;
+ const int SEC_FILE_ALL = 0x000001ff;
+
+ /* directory specific bits */
+ const int SEC_DIR_LIST = 0x00000001;
+ const int SEC_DIR_ADD_FILE = 0x00000002;
+ const int SEC_DIR_ADD_SUBDIR = 0x00000004;
+ const int SEC_DIR_READ_EA = 0x00000008;
+ const int SEC_DIR_WRITE_EA = 0x00000010;
+ const int SEC_DIR_TRAVERSE = 0x00000020;
+ const int SEC_DIR_DELETE_CHILD = 0x00000040;
+ const int SEC_DIR_READ_ATTRIBUTE = 0x00000080;
+ const int SEC_DIR_WRITE_ATTRIBUTE = 0x00000100;
+
+ /* registry entry specific bits */
+ const int SEC_REG_QUERY_VALUE = 0x00000001;
+ const int SEC_REG_SET_VALUE = 0x00000002;
+ const int SEC_REG_CREATE_SUBKEY = 0x00000004;
+ const int SEC_REG_ENUM_SUBKEYS = 0x00000008;
+ const int SEC_REG_NOTIFY = 0x00000010;
+ const int SEC_REG_CREATE_LINK = 0x00000020;
+
+ /* ldap specific access bits */
+ const int SEC_ADS_CREATE_CHILD = 0x00000001;
+ const int SEC_ADS_DELETE_CHILD = 0x00000002;
+ const int SEC_ADS_LIST = 0x00000004;
+ const int SEC_ADS_SELF_WRITE = 0x00000008;
+ const int SEC_ADS_READ_PROP = 0x00000010;
+ const int SEC_ADS_WRITE_PROP = 0x00000020;
+ const int SEC_ADS_DELETE_TREE = 0x00000040;
+ const int SEC_ADS_LIST_OBJECT = 0x00000080;
+ const int SEC_ADS_CONTROL_ACCESS = 0x00000100;
+
+ /* generic->specific mappings for files */
+ const int SEC_RIGHTS_FILE_READ = SEC_STD_READ_CONTROL |
+ SEC_STD_SYNCHRONIZE |
+ SEC_FILE_READ_DATA |
+ SEC_FILE_READ_ATTRIBUTE |
+ SEC_FILE_READ_EA;
+
+ const int SEC_RIGHTS_FILE_WRITE = SEC_STD_READ_CONTROL |
+ SEC_STD_SYNCHRONIZE |
+ SEC_FILE_WRITE_DATA |
+ SEC_FILE_WRITE_ATTRIBUTE |
+ SEC_FILE_WRITE_EA |
+ SEC_FILE_APPEND_DATA;
+
+ const int SEC_RIGHTS_FILE_EXECUTE = SEC_STD_SYNCHRONIZE |
+ SEC_STD_READ_CONTROL |
+ SEC_FILE_READ_ATTRIBUTE |
+ SEC_FILE_EXECUTE;
+
+ const int SEC_RIGHTS_FILE_ALL = SEC_STD_ALL | SEC_FILE_ALL;
+
+ /* generic->specific mappings for directories (same as files) */
+ const int SEC_RIGHTS_DIR_READ = SEC_RIGHTS_FILE_READ;
+ const int SEC_RIGHTS_DIR_WRITE = SEC_RIGHTS_FILE_WRITE;
+ const int SEC_RIGHTS_DIR_EXECUTE = SEC_RIGHTS_FILE_EXECUTE;
+ const int SEC_RIGHTS_DIR_ALL = SEC_RIGHTS_FILE_ALL;
+
+
+ /***************************************************************/
+ /* WELL KNOWN SIDS */
+
+ /* a NULL sid */
+ const string SID_NULL = "S-1-0-0";
+
+ /* the world domain */
+ const string SID_WORLD_DOMAIN = "S-1-1";
+ const string SID_WORLD = "S-1-1-0";
+
+ /* SECURITY_CREATOR_SID_AUTHORITY */
+ const string SID_CREATOR_OWNER_DOMAIN = "S-1-3";
+ const string SID_CREATOR_OWNER = "S-1-3-0";
+ const string SID_CREATOR_GROUP = "S-1-3-1";
+
+ /* SECURITY_NT_AUTHORITY */
+ const string SID_NT_AUTHORITY = "S-1-5";
+ const string SID_NT_DIALUP = "S-1-5-1";
+ const string SID_NT_NETWORK = "S-1-5-2";
+ const string SID_NT_BATCH = "S-1-5-3";
+ const string SID_NT_INTERACTIVE = "S-1-5-4";
+ const string SID_NT_SERVICE = "S-1-5-6";
+ const string SID_NT_ANONYMOUS = "S-1-5-7";
+ const string SID_NT_PROXY = "S-1-5-8";
+ const string SID_NT_ENTERPRISE_DCS = "S-1-5-9";
+ const string SID_NT_SELF = "S-1-5-10";
+ const string SID_NT_AUTHENTICATED_USERS = "S-1-5-11";
+ const string SID_NT_RESTRICTED = "S-1-5-12";
+ const string SID_NT_TERMINAL_SERVER_USERS = "S-1-5-13";
+ const string SID_NT_REMOTE_INTERACTIVE = "S-1-5-14";
+ const string SID_NT_THIS_ORGANISATION = "S-1-5-15";
+ const string SID_NT_SYSTEM = "S-1-5-18";
+ const string SID_NT_LOCAL_SERVICE = "S-1-5-19";
+ const string SID_NT_NETWORK_SERVICE = "S-1-5-20";
+
+ /* SECURITY_BUILTIN_DOMAIN_RID */
+ const string SID_BUILTIN = "S-1-5-32";
+ const string SID_BUILTIN_ADMINISTRATORS = "S-1-5-32-544";
+ const string SID_BUILTIN_USERS = "S-1-5-32-545";
+ const string SID_BUILTIN_GUESTS = "S-1-5-32-546";
+ const string SID_BUILTIN_POWER_USERS = "S-1-5-32-547";
+ const string SID_BUILTIN_ACCOUNT_OPERATORS = "S-1-5-32-548";
+ const string SID_BUILTIN_SERVER_OPERATORS = "S-1-5-32-549";
+ const string SID_BUILTIN_PRINT_OPERATORS = "S-1-5-32-550";
+ const string SID_BUILTIN_BACKUP_OPERATORS = "S-1-5-32-551";
+ const string SID_BUILTIN_REPLICATOR = "S-1-5-32-552";
+ const string SID_BUILTIN_RAS_SERVERS = "S-1-5-32-553";
+ const string SID_BUILTIN_PREW2K = "S-1-5-32-554";
+
+ /* well-known domain RIDs */
+ const int DOMAIN_RID_LOGON = 9;
+ const int DOMAIN_RID_ADMINISTRATOR = 500;
+ const int DOMAIN_RID_GUEST = 501;
+ const int DOMAIN_RID_ADMINS = 512;
+ const int DOMAIN_RID_USERS = 513;
+ const int DOMAIN_RID_DCS = 516;
+ const int DOMAIN_RID_CERT_ADMINS = 517;
+ const int DOMAIN_RID_SCHEMA_ADMINS = 518;
+ const int DOMAIN_RID_ENTERPRISE_ADMINS = 519;
+
+
+ /*
+ privilege IDs. Please keep the IDs below 64. If we get more
+ than 64 then we need to change security_token
+ */
+ typedef enum {
+ SEC_PRIV_SECURITY = 1,
+ SEC_PRIV_BACKUP = 2,
+ SEC_PRIV_RESTORE = 3,
+ SEC_PRIV_SYSTEMTIME = 4,
+ SEC_PRIV_SHUTDOWN = 5,
+ SEC_PRIV_REMOTE_SHUTDOWN = 6,
+ SEC_PRIV_TAKE_OWNERSHIP = 7,
+ SEC_PRIV_DEBUG = 8,
+ SEC_PRIV_SYSTEM_ENVIRONMENT = 9,
+ SEC_PRIV_SYSTEM_PROFILE = 10,
+ SEC_PRIV_PROFILE_SINGLE_PROCESS = 11,
+ SEC_PRIV_INCREASE_BASE_PRIORITY = 12,
+ SEC_PRIV_LOAD_DRIVER = 13,
+ SEC_PRIV_CREATE_PAGEFILE = 14,
+ SEC_PRIV_INCREASE_QUOTA = 15,
+ SEC_PRIV_CHANGE_NOTIFY = 16,
+ SEC_PRIV_UNDOCK = 17,
+ SEC_PRIV_MANAGE_VOLUME = 18,
+ SEC_PRIV_IMPERSONATE = 19,
+ SEC_PRIV_CREATE_GLOBAL = 20,
+ SEC_PRIV_ENABLE_DELEGATION = 21,
+ SEC_PRIV_INTERACTIVE_LOGON = 22,
+ SEC_PRIV_NETWORK_LOGON = 23,
+ SEC_PRIV_REMOTE_INTERACTIVE_LOGON = 24
+ } sec_privilege;
+
+
+ /* a domain SID. Note that unlike Samba3 this contains a pointer,
+ so you can't copy them using assignment */
+ typedef [public,gensize,noprint,noejs,nosize] struct {
+ uint8 sid_rev_num; /**< SID revision number */
+ [range(0,15)] int8 num_auths; /**< Number of sub-authorities */
+ uint8 id_auth[6]; /**< Identifier Authority */
+ uint32 sub_auths[num_auths];
+ } dom_sid;
+
+ typedef [bitmap8bit] bitmap {
+ SEC_ACE_FLAG_OBJECT_INHERIT = 0x01,
+ SEC_ACE_FLAG_CONTAINER_INHERIT = 0x02,
+ SEC_ACE_FLAG_NO_PROPAGATE_INHERIT = 0x04,
+ SEC_ACE_FLAG_INHERIT_ONLY = 0x08,
+ SEC_ACE_FLAG_INHERITED_ACE = 0x10,
+ SEC_ACE_FLAG_VALID_INHERIT = 0x0f,
+ SEC_ACE_FLAG_SUCCESSFUL_ACCESS = 0x40,
+ SEC_ACE_FLAG_FAILED_ACCESS = 0x80
+ } security_ace_flags;
+
+ typedef [enum8bit] enum {
+ SEC_ACE_TYPE_ACCESS_ALLOWED = 0,
+ SEC_ACE_TYPE_ACCESS_DENIED = 1,
+ SEC_ACE_TYPE_SYSTEM_AUDIT = 2,
+ SEC_ACE_TYPE_SYSTEM_ALARM = 3,
+ SEC_ACE_TYPE_ALLOWED_COMPOUND = 4,
+ SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT = 5,
+ SEC_ACE_TYPE_ACCESS_DENIED_OBJECT = 6,
+ SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT = 7,
+ SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT = 8
+ } security_ace_type;
+
+ typedef bitmap {
+ SEC_ACE_OBJECT_TYPE_PRESENT = 0x00000001,
+ SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT = 0x00000002
+ } security_ace_object_flags;
+
+ typedef [nodiscriminant] union {
+ /* this is the 'schemaIDGUID' attribute of the attribute object in the schema naming context */
+ [case(SEC_ACE_OBJECT_TYPE_PRESENT)] GUID type;
+ [default];
+ } security_ace_object_type;
+
+ typedef [nodiscriminant] union {
+ /* this is the 'schemaIDGUID' attribute of the objectclass object in the schema naming context
+ * (of the parent container)
+ */
+ [case(SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] GUID inherited_type;
+ [default];
+ } security_ace_object_inherited_type;
+
+ typedef struct {
+ security_ace_object_flags flags;
+ [switch_is(flags & SEC_ACE_OBJECT_TYPE_PRESENT)] security_ace_object_type type;
+ [switch_is(flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] security_ace_object_inherited_type inherited_type;
+ } security_ace_object;
+
+ typedef [nodiscriminant] union {
+ [case(SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT)] security_ace_object object;
+ [case(SEC_ACE_TYPE_ACCESS_DENIED_OBJECT)] security_ace_object object;
+ [case(SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT)] security_ace_object object;
+ [case(SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT)] security_ace_object object;
+ [default];
+ } security_ace_object_ctr;
+
+ typedef [public,gensize,nosize] struct {
+ security_ace_type type; /* SEC_ACE_TYPE_* */
+ security_ace_flags flags; /* SEC_ACE_FLAG_* */
+ [value(ndr_size_security_ace(r,ndr->flags))] uint16 size;
+ uint32 access_mask;
+ [switch_is(type)] security_ace_object_ctr object;
+ dom_sid trustee;
+ } security_ace;
+
+ typedef enum {
+ SECURITY_ACL_REVISION_NT4 = 2,
+ SECURITY_ACL_REVISION_ADS = 4
+ } security_acl_revision;
+
+ const uint NT4_ACL_REVISION = SECURITY_ACL_REVISION_NT4;
+
+ typedef [public,gensize,nosize] struct {
+ security_acl_revision revision;
+ [value(ndr_size_security_acl(r,ndr->flags))] uint16 size;
+ [range(0,1000)] uint32 num_aces;
+ security_ace aces[num_aces];
+ } security_acl;
+
+ /* default revision for new ACLs */
+ typedef [enum8bit] enum {
+ SECURITY_DESCRIPTOR_REVISION_1 = 1
+ } security_descriptor_revision;
+
+ const int SD_REVISION = SECURITY_DESCRIPTOR_REVISION_1;
+
+ /* security_descriptor->type bits */
+ typedef [bitmap16bit] bitmap {
+ SEC_DESC_OWNER_DEFAULTED = 0x0001,
+ SEC_DESC_GROUP_DEFAULTED = 0x0002,
+ SEC_DESC_DACL_PRESENT = 0x0004,
+ SEC_DESC_DACL_DEFAULTED = 0x0008,
+ SEC_DESC_SACL_PRESENT = 0x0010,
+ SEC_DESC_SACL_DEFAULTED = 0x0020,
+ SEC_DESC_DACL_TRUSTED = 0x0040,
+ SEC_DESC_SERVER_SECURITY = 0x0080,
+ SEC_DESC_DACL_AUTO_INHERIT_REQ = 0x0100,
+ SEC_DESC_SACL_AUTO_INHERIT_REQ = 0x0200,
+ SEC_DESC_DACL_AUTO_INHERITED = 0x0400,
+ SEC_DESC_SACL_AUTO_INHERITED = 0x0800,
+ SEC_DESC_DACL_PROTECTED = 0x1000,
+ SEC_DESC_SACL_PROTECTED = 0x2000,
+ SEC_DESC_RM_CONTROL_VALID = 0x4000,
+ SEC_DESC_SELF_RELATIVE = 0x8000
+ } security_descriptor_type;
+
+ typedef [gensize,nosize,public,flag(NDR_LITTLE_ENDIAN)] struct {
+ security_descriptor_revision revision;
+ security_descriptor_type type; /* SEC_DESC_xxxx flags */
+ [relative] dom_sid *owner_sid;
+ [relative] dom_sid *group_sid;
+ [relative] security_acl *sacl; /* system ACL */
+ [relative] security_acl *dacl; /* user (discretionary) ACL */
+ } security_descriptor;
+
+ typedef [public] struct {
+ [range(0,0x40000),value(ndr_size_security_descriptor(sd,ndr->flags))] uint32 sd_size;
+ [subcontext(4)] security_descriptor *sd;
+ } sec_desc_buf;
+
+ typedef [public] struct {
+ dom_sid *user_sid;
+ dom_sid *group_sid;
+ uint32 num_sids;
+ [size_is(num_sids)] dom_sid *sids[*];
+ udlong privilege_mask;
+ } security_token;
+
+ /* bits that determine which parts of a security descriptor
+ are being queried/set */
+ typedef [public,bitmap32bit] bitmap {
+ SECINFO_OWNER = 0x00000001,
+ SECINFO_GROUP = 0x00000002,
+ SECINFO_DACL = 0x00000004,
+ SECINFO_SACL = 0x00000008
+ } security_secinfo;
+}
diff --git a/source3/librpc/idl/spoolss.idl b/source3/librpc/idl/spoolss.idl
new file mode 100644
index 0000000000..02e6ff3f37
--- /dev/null
+++ b/source3/librpc/idl/spoolss.idl
@@ -0,0 +1,1417 @@
+#include "idl_types.h"
+
+/*
+ spoolss interface definitions
+*/
+
+[ uuid("12345678-1234-abcd-ef00-0123456789ab"),
+ version(1.0),
+ endpoint("ncacn_np:[\\pipe\\spoolss]"),
+ pointer_default(unique),
+ pointer_default_top(unique),
+ helpstring("Spooler SubSystem"),
+ depends(security),
+ helper("librpc/ndr/ndr_spoolss_buf.h"),
+ keepref
+] interface spoolss
+{
+ typedef struct {
+ uint16 year;
+ uint16 month;
+ uint16 day_of_week;
+ uint16 day;
+ uint16 hour;
+ uint16 minute;
+ uint16 second;
+ uint16 millisecond;
+ } spoolss_Time;
+
+ typedef struct {
+ [relative] nstring *printername;
+ [relative] nstring *servername;
+ uint32 cjobs;
+ uint32 total_jobs;
+ uint32 total_bytes;
+ spoolss_Time time;
+ uint32 global_counter;
+ uint32 total_pages;
+ uint32 version;
+ uint32 unknown10;
+ uint32 unknown11;
+ uint32 unknown12;
+ uint32 session_counter;
+ uint32 unknown14;
+ uint32 printer_errors;
+ uint32 unknown16;
+ uint32 unknown17;
+ uint32 unknown18;
+ uint32 unknown19;
+ uint32 change_id;
+ uint32 unknown21;
+ uint32 status;
+ uint32 unknown23;
+ uint32 c_setprinter;
+ uint16 unknown25;
+ uint16 unknown26;
+ uint32 unknown27;
+ uint32 unknown28;
+ uint32 unknown29;
+ } spoolss_PrinterInfo0;
+
+ typedef [public,gensize] struct {
+ string32 devicename;
+ uint16 specversion;
+ uint16 driverversion;
+ uint16 size;
+ [value(r->driverextra_data.length)] uint16 __driverextra_length;
+ uint32 fields;
+ uint16 orientation;
+ uint16 papersize;
+ uint16 paperlength;
+ uint16 paperwidth;
+ uint16 scale;
+ uint16 copies;
+ uint16 defaultsource;
+ uint16 printquality;
+ uint16 color;
+ uint16 duplex;
+ uint16 yresolution;
+ uint16 ttoption;
+ uint16 collate;
+ string32 formname;
+ uint16 logpixels;
+ uint32 bitsperpel;
+ uint32 pelswidth;
+ uint32 pelsheight;
+ uint32 displayflags;
+ uint32 displayfrequency;
+ uint32 icmmethod;
+ uint32 icmintent;
+ uint32 mediatype;
+ uint32 dithertype;
+ uint32 reserved1;
+ uint32 reserved2;
+ uint32 panningwidth;
+ uint32 panningheight;
+ [subcontext_size(__driverextra_length),subcontext(0),flag(NDR_REMAINING)] DATA_BLOB driverextra_data;
+ } spoolss_DeviceMode;
+
+ typedef [public] bitmap {
+ PRINTER_ENUM_DEFAULT = 0x00000001,
+ PRINTER_ENUM_LOCAL = 0x00000002,
+ PRINTER_ENUM_CONNECTIONS = 0x00000004,
+ PRINTER_ENUM_FAVORITE = 0x00000004,
+ PRINTER_ENUM_NAME = 0x00000008,
+ PRINTER_ENUM_REMOTE = 0x00000010,
+ PRINTER_ENUM_SHARED = 0x00000020,
+ PRINTER_ENUM_NETWORK = 0x00000040,
+ PRINTER_ENUM_EXPAND = 0x00004000,
+ PRINTER_ENUM_CONTAINER = 0x00008000,
+ PRINTER_ENUM_ICON1 = 0x00010000,
+ PRINTER_ENUM_ICON2 = 0x00020000,
+ PRINTER_ENUM_ICON3 = 0x00040000,
+ PRINTER_ENUM_ICON4 = 0x00080000,
+ PRINTER_ENUM_ICON5 = 0x00100000,
+ PRINTER_ENUM_ICON6 = 0x00200000,
+ PRINTER_ENUM_ICON7 = 0x00400000,
+ PRINTER_ENUM_ICON8 = 0x00800000,
+ PRINTER_ENUM_HIDE = 0x01000000
+ } spoolss_EnumPrinterFlags;
+
+ typedef struct {
+ spoolss_EnumPrinterFlags flags;
+ [relative] nstring *name;
+ [relative] nstring *description;
+ [relative] nstring *comment;
+ } spoolss_PrinterInfo1;
+
+ typedef bitmap {
+ PRINTER_ATTRIBUTE_QUEUED = 0x00000001,
+ PRINTER_ATTRIBUTE_DIRECT = 0x00000002,
+ PRINTER_ATTRIBUTE_DEFAULT = 0x00000004,
+ PRINTER_ATTRIBUTE_SHARED = 0x00000008,
+ PRINTER_ATTRIBUTE_NETWORK = 0x00000010,
+ PRINTER_ATTRIBUTE_HIDDEN = 0x00000020,
+ PRINTER_ATTRIBUTE_LOCAL = 0x00000040,
+ PRINTER_ATTRIBUTE_ENABLE_DEVQ = 0x00000080,
+ PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS = 0x00000100,
+ PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST = 0x00000200,
+ PRINTER_ATTRIBUTE_WORK_OFFLINE = 0x00000400,
+ PRINTER_ATTRIBUTE_ENABLE_BIDI = 0x00000800,
+ PRINTER_ATTRIBUTE_RAW_ONLY = 0x00001000,
+ PRINTER_ATTRIBUTE_PUBLISHED = 0x00002000,
+ PRINTER_ATTRIBUTE_FAX = 0x00004000,
+ PRINTER_ATTRIBUTE_TS = 0x00008000
+ } spoolss_PrinterAttributes;
+
+ typedef bitmap {
+ PRINTER_STATUS_PAUSED = 0x00000001,
+ PRINTER_STATUS_ERROR = 0x00000002,
+ PRINTER_STATUS_PENDING_DELETION = 0x00000004,
+ PRINTER_STATUS_PAPER_JAM = 0x00000008,
+ PRINTER_STATUS_PAPER_OUT = 0x00000010,
+ PRINTER_STATUS_MANUAL_FEED = 0x00000020,
+ PRINTER_STATUS_PAPER_PROBLEM = 0x00000040,
+ PRINTER_STATUS_OFFLINE = 0x00000080,
+ PRINTER_STATUS_IO_ACTIVE = 0x00000100,
+ PRINTER_STATUS_BUSY = 0x00000200,
+ PRINTER_STATUS_PRINTING = 0x00000400,
+ PRINTER_STATUS_OUTPUT_BIN_FULL = 0x00000800,
+ PRINTER_STATUS_NOT_AVAILABLE = 0x00001000,
+ PRINTER_STATUS_WAITING = 0x00002000,
+ PRINTER_STATUS_PROCESSING = 0x00004000,
+ PRINTER_STATUS_INITIALIZING = 0x00008000,
+ PRINTER_STATUS_WARMING_UP = 0x00010000,
+ PRINTER_STATUS_TONER_LOW = 0x00020000,
+ PRINTER_STATUS_NO_TONER = 0x00040000,
+ PRINTER_STATUS_PAGE_PUNT = 0x00080000,
+ PRINTER_STATUS_USER_INTERVENTION= 0x00100000,
+ PRINTER_STATUS_OUT_OF_MEMORY = 0x00200000,
+ PRINTER_STATUS_DOOR_OPEN = 0x00400000,
+ PRINTER_STATUS_SERVER_UNKNOWN = 0x00800000,
+ PRINTER_STATUS_POWER_SAVE = 0x01000000
+ } spoolss_PrinterStatus;
+
+ typedef struct {
+ [relative] nstring *servername;
+ [relative] nstring *printername;
+ [relative] nstring *sharename;
+ [relative] nstring *portname;
+ [relative] nstring *drivername;
+ [relative] nstring *comment;
+ [relative] nstring *location;
+ [relative,subcontext(0)] spoolss_DeviceMode *devmode;
+ [relative] nstring *sepfile;
+ [relative] nstring *printprocessor;
+ [relative] nstring *datatype;
+ [relative] nstring *parameters;
+ [relative,subcontext(0)] security_descriptor *secdesc;
+ spoolss_PrinterAttributes attributes;
+ uint32 priority;
+ uint32 defaultpriority;
+ uint32 starttime;
+ uint32 untiltime;
+ spoolss_PrinterStatus status;
+ uint32 cjobs;
+ uint32 averageppm;
+ } spoolss_PrinterInfo2;
+
+ typedef struct {
+ [relative,subcontext(0)] security_descriptor *secdesc;
+ } spoolss_PrinterInfo3;
+
+ typedef struct {
+ [relative] nstring *printername;
+ [relative] nstring *servername;
+ spoolss_PrinterAttributes attributes;
+ } spoolss_PrinterInfo4;
+
+ typedef struct {
+ [relative] nstring *printername;
+ [relative] nstring *portname;
+ spoolss_PrinterAttributes attributes;
+ uint32 device_not_selected_timeout;
+ uint32 transmission_retry_timeout;
+ } spoolss_PrinterInfo5;
+
+ typedef struct {
+ spoolss_PrinterStatus status;
+ } spoolss_PrinterInfo6;
+
+ typedef bitmap {
+ DSPRINT_PUBLISH = 0x00000001,
+ DSPRINT_UPDATE = 0x00000002,
+ DSPRINT_UNPUBLISH = 0x00000004,
+ DSPRINT_REPUBLISH = 0x00000008,
+ DSPRINT_PENDING = 0x80000000
+ } spoolss_DsPrintAction;
+
+ typedef struct {
+ [relative] nstring *guid; /* text form of printer guid */
+ spoolss_DsPrintAction action;
+ } spoolss_PrinterInfo7;
+
+ typedef struct {
+ [relative,subcontext(0)] spoolss_DeviceMode *devmode;
+ } spoolss_DeviceModeInfo;
+
+ typedef [nodiscriminant,relative_base,public] union {
+ [case(0)] spoolss_PrinterInfo0 info0;
+ [case(1)] spoolss_PrinterInfo1 info1;
+ [case(2)] spoolss_PrinterInfo2 info2;
+ [case(3)] spoolss_PrinterInfo3 info3;
+ [case(4)] spoolss_PrinterInfo4 info4;
+ [case(5)] spoolss_PrinterInfo5 info5;
+ [case(6)] spoolss_PrinterInfo6 info6;
+ [case(7)] spoolss_PrinterInfo7 info7;
+ [case(8)] spoolss_DeviceModeInfo info8;
+ [case(9)] spoolss_DeviceModeInfo info9;
+ [default];
+ } spoolss_PrinterInfo;
+
+ /******************/
+ /* Function: 0x00 */
+ /* we are using this as internal parsing code */
+ [public,noopnum,noprint] WERROR _spoolss_EnumPrinters(
+ [in] spoolss_EnumPrinterFlags flags,
+ [in] [string,charset(UTF16)] uint16 *server,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out] DATA_BLOB *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+ [public,noopnum,noprint] void __spoolss_EnumPrinters(
+ [in] uint32 level,
+ [in] uint32 count,
+ [out,switch_is(level)] spoolss_PrinterInfo info[count]
+ );
+ [nopull,nopush] WERROR spoolss_EnumPrinters(
+ [in] spoolss_EnumPrinterFlags flags,
+ [in] [string,charset(UTF16)] uint16 *server,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ /* what we have here is a subcontext containing an array of no discriminant unions
+ * and the array has no size in front
+ */
+ [out,switch_is(level),size_is(count)] spoolss_PrinterInfo *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+
+ /******************/
+ /* Function: 0x01 */
+ typedef struct {
+ [value(_ndr_size_spoolss_DeviceMode(devmode, ndr->flags))] uint32 _ndr_size;
+ [subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode;
+ } spoolss_DevmodeContainer;
+
+ WERROR spoolss_OpenPrinter(
+ [in] [string,charset(UTF16)] uint16 *printername,
+ [in] [string,charset(UTF16)] uint16 *datatype,
+ [in] spoolss_DevmodeContainer devmode_ctr,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x02 */
+ typedef struct {
+ uint32 job_id;
+ [relative] nstring *printer_name;
+ [relative] nstring *server_name;
+ [relative] nstring *user_name;
+ [relative] nstring *document_name;
+ [relative] nstring *data_type;
+ [relative] nstring *text_status;
+ uint32 status;
+ uint32 priority;
+ uint32 position;
+ uint32 total_pages;
+ uint32 pages_printed;
+ spoolss_Time time;
+ } spoolss_JobInfo1;
+
+ typedef [nodiscriminant,relative_base,public] union {
+ [case(1)] spoolss_JobInfo1 info1;
+ [case(2)]; /* TODO */
+ [case(3)]; /* TODO */
+ [default];
+ } spoolss_JobInfo;
+
+ typedef struct {
+ uint32 level;
+ [switch_is(level)] spoolss_JobInfo info;
+ } spoolss_JobInfoContainer;
+
+ typedef [v1_enum] enum {
+ SPOOLSS_JOB_CONTROL_PAUSE = 1,
+ SPOOLSS_JOB_CONTROL_RESUME = 2,
+ SPOOLSS_JOB_CONTROL_CANCEL = 3,
+ SPOOLSS_JOB_CONTROL_RESTART = 4,
+ SPOOLSS_JOB_CONTROL_DELETE = 5,
+ SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER = 6,
+ SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED = 7
+ } spoolss_JobControl;
+
+ WERROR spoolss_SetJob(
+ [in,ref] policy_handle *handle,
+ [in] uint32 job_id,
+ [in] spoolss_JobInfoContainer *ctr,
+ [in] spoolss_JobControl command
+ );
+
+ /******************/
+ /* Function: 0x03 */
+ WERROR spoolss_GetJob(
+ [in,ref] policy_handle *handle,
+ [in] uint32 job_id,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info,
+ [out] uint32 needed
+ );
+
+ /******************/
+ /* Function: 0x04 */
+ [public,noopnum,noprint] WERROR _spoolss_EnumJobs(
+ [in,ref] policy_handle *handle,
+ [in] uint32 firstjob,
+ [in] uint32 numjobs,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out] DATA_BLOB *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+ [public,noopnum,noprint] void __spoolss_EnumJobs(
+ [in] uint32 level,
+ [in] uint32 count,
+ [out,switch_is(level)] spoolss_JobInfo info[count]
+ );
+ [nopull,nopush] WERROR spoolss_EnumJobs(
+ [in,ref] policy_handle *handle,
+ [in] uint32 firstjob,
+ [in] uint32 numjobs,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out,switch_is(level),size_is(count)] spoolss_JobInfo *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+
+ /******************/
+ /* Function: 0x05 */
+ WERROR spoolss_AddPrinter(
+ /* This function is not implemented in Samba 3 as no
+ clients have been observed using it. */
+ );
+
+ /******************/
+ /* Function: 0x06 */
+ WERROR spoolss_DeletePrinter(
+ );
+
+ /******************/
+ /* Function: 0x07 */
+ typedef [v1_enum] enum {
+ SPOOLSS_PRINTER_CONTROL_UNPAUSE = 0,
+ SPOOLSS_PRINTER_CONTROL_PAUSE = 1,
+ SPOOLSS_PRINTER_CONTROL_RESUME = 2,
+ SPOOLSS_PRINTER_CONTROL_PURGE = 3,
+ SPOOLSS_PRINTER_CONTROL_SET_STATUS = 4
+ } spoolss_PrinterControl;
+
+ typedef [switch_type(uint32)] union {
+ [case(0)] spoolss_PrinterInfo0 *info0;
+ [case(1)] spoolss_PrinterInfo1 *info1;
+ [case(2)] spoolss_PrinterInfo2 *info2;
+ [case(3)] spoolss_PrinterInfo3 *info3;
+ [case(4)] spoolss_PrinterInfo4 *info4;
+ [case(5)] spoolss_PrinterInfo5 *info5;
+ [case(6)] spoolss_PrinterInfo6 *info6;
+ [case(7)] spoolss_PrinterInfo7 *info7;
+ [case(8)] spoolss_DeviceModeInfo *info8;
+ [case(9)] spoolss_DeviceModeInfo *info9;
+ [default];
+ } spoolss_SetPrinterInfo;
+
+ WERROR spoolss_SetPrinter(
+ [in,ref] policy_handle *handle,
+ [in] uint32 level,
+ [in,switch_is(level)] spoolss_SetPrinterInfo info,
+ [in] spoolss_DevmodeContainer devmode_ctr,
+ [in] sec_desc_buf secdesc_ctr,
+ [in] spoolss_PrinterControl command
+ );
+
+ /******************/
+ /* Function: 0x08 */
+ WERROR spoolss_GetPrinter(
+ [in,ref] policy_handle *handle,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info,
+ [out] uint32 needed
+ );
+
+ /******************/
+ /* Function: 0x09 */
+ WERROR spoolss_AddPrinterDriver(
+ );
+
+ typedef struct {
+ [relative] nstring *driver_name;
+ } spoolss_DriverInfo1;
+
+ typedef [v1_enum] enum {
+ SPOOLSS_DRIVER_VERSION_9X = 0,
+ SPOOLSS_DRIVER_VERSION_NT35 = 1,
+ SPOOLSS_DRIVER_VERSION_NT4 = 2,
+ SPOOLSS_DRIVER_VERSION_200X = 3
+ } spoolss_DriverOSVersion;
+
+ typedef struct {
+ spoolss_DriverOSVersion version;
+ [relative] nstring *driver_name;
+ [relative] nstring *architecture;
+ [relative] nstring *driver_path;
+ [relative] nstring *data_file;
+ [relative] nstring *config_file;
+ } spoolss_DriverInfo2;
+
+ typedef struct {
+ spoolss_DriverOSVersion version;
+ [relative] nstring *driver_name;
+ [relative] nstring *architecture;
+ [relative] nstring *driver_path;
+ [relative] nstring *data_file;
+ [relative] nstring *config_file;
+ [relative] nstring *help_file;
+ [relative] nstring_array *dependent_files;
+ [relative] nstring *monitor_name;
+ [relative] nstring *default_datatype;
+ } spoolss_DriverInfo3;
+
+ typedef struct {
+ spoolss_DriverOSVersion version;
+ [relative] nstring *driver_name;
+ [relative] nstring *architecture;
+ [relative] nstring *driver_path;
+ [relative] nstring *data_file;
+ [relative] nstring *config_file;
+ [relative] nstring *help_file;
+ [relative] nstring_array *dependent_files;
+ [relative] nstring *monitor_name;
+ [relative] nstring *default_datatype;
+ [relative] nstring_array *previous_names;
+ } spoolss_DriverInfo4;
+
+ typedef struct {
+ spoolss_DriverOSVersion version;
+ [relative] nstring *driver_name;
+ [relative] nstring *architecture;
+ [relative] nstring *driver_path;
+ [relative] nstring *data_file;
+ [relative] nstring *config_file;
+ uint32 driver_attributes;
+ uint32 config_version;
+ uint32 driver_version;
+ } spoolss_DriverInfo5;
+
+ typedef struct {
+ spoolss_DriverOSVersion version;
+ [relative] nstring *driver_name;
+ [relative] nstring *architecture;
+ [relative] nstring *driver_path;
+ [relative] nstring *data_file;
+ [relative] nstring *config_file;
+ [relative] nstring *help_file;
+ [relative] nstring_array *dependent_files;
+ [relative] nstring *monitor_name;
+ [relative] nstring *default_datatype;
+ [relative] nstring_array *previous_names;
+ NTTIME driver_data;
+ hyper driver_version;
+ [relative] nstring *manufacturer_name;
+ [relative] nstring *manufacturer_url;
+ [relative] nstring *hardware_id;
+ [relative] nstring *provider;
+ } spoolss_DriverInfo6;
+
+ typedef [nodiscriminant,relative_base,public] union {
+ [case(1)] spoolss_DriverInfo1 info1;
+ [case(2)] spoolss_DriverInfo2 info2;
+ [case(3)] spoolss_DriverInfo3 info3;
+ [case(4)] spoolss_DriverInfo4 info4;
+ [case(5)] spoolss_DriverInfo5 info5;
+ [case(6)] spoolss_DriverInfo6 info6;
+ [default];
+ } spoolss_DriverInfo;
+
+ /******************/
+ /* Function: 0x0a */
+ [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDrivers(
+ [in] [string,charset(UTF16)] uint16 *server,
+ [in] [string,charset(UTF16)] uint16 *environment,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out] DATA_BLOB *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+ [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers(
+ [in] uint32 level,
+ [in] uint32 count,
+ [out,switch_is(level)] spoolss_DriverInfo info[count]
+ );
+ [nopull,nopush] WERROR spoolss_EnumPrinterDrivers(
+ [in] [string,charset(UTF16)] uint16 *server,
+ [in] [string,charset(UTF16)] uint16 *environment,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out,switch_is(level),size_is(count)] spoolss_DriverInfo *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+
+ /******************/
+ /* Function: 0x0b */
+ WERROR spoolss_GetPrinterDriver(
+ );
+
+ /******************/
+ /* Function: 0x0c */
+ typedef struct {
+ nstring directory_name;
+ } spoolss_DriverDirectoryInfo1;
+
+ /* NOTE: it's seems that w2k3 completly ignores the level
+ in its server code
+ */
+ typedef [nodiscriminant,relative_base,gensize,public] union {
+ [case(1)] spoolss_DriverDirectoryInfo1 info1;
+ [default] spoolss_DriverDirectoryInfo1 info1;
+ } spoolss_DriverDirectoryInfo;
+
+ WERROR spoolss_GetPrinterDriverDirectory(
+ [in] [string,charset(UTF16)] uint16 *server,
+ [in] [string,charset(UTF16)] uint16 *environment,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
+ [out] uint32 needed
+ );
+
+ /******************/
+ /* Function: 0x0d */
+ WERROR spoolss_DeletePrinterDriver(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 *server,
+ [in] [string,charset(UTF16)] uint16 architecture[],
+ [in] [string,charset(UTF16)] uint16 driver[]
+ );
+
+ /******************/
+ /* Function: 0x0e */
+ WERROR spoolss_AddPrintProcessor(
+ );
+
+ /******************/
+ /* Function: 0x0f */
+ typedef struct {
+ [relative] nstring *print_processor_name;
+ } spoolss_PrintProcessorInfo1;
+
+ typedef [nodiscriminant,relative_base,public] union {
+ [case(1)] spoolss_PrintProcessorInfo1 info1;
+ [default];
+ } spoolss_PrintProcessorInfo;
+
+ [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessors(
+ [in] [string,charset(UTF16)] uint16 *servername,
+ [in] [string,charset(UTF16)] uint16 *environment,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out] DATA_BLOB *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+ [public,noopnum,noprint] void __spoolss_EnumPrintProcessors(
+ [in] uint32 level,
+ [in] uint32 count,
+ [out,switch_is(level)] spoolss_PrintProcessorInfo info[count]
+ );
+ [nopull,nopush] WERROR spoolss_EnumPrintProcessors(
+ [in] [string,charset(UTF16)] uint16 *servername,
+ [in] [string,charset(UTF16)] uint16 *environment,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out,switch_is(level),size_is(count)] spoolss_PrintProcessorInfo *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+
+ /******************/
+ /* Function: 0x10 */
+ WERROR spoolss_GetPrintProcessorDirectory(
+ );
+
+ /******************/
+ /* Function: 0x11 */
+ typedef struct {
+ [string,charset(UTF16)] uint16 *document_name;
+ [string,charset(UTF16)] uint16 *output_file;
+ [string,charset(UTF16)] uint16 *datatype;
+ } spoolss_DocumentInfo1;
+
+ typedef [switch_type(uint32)] union {
+ [case(1)] spoolss_DocumentInfo1 *info1;
+ [case(2)]; /* TODO */
+ [case(3)]; /* TODO */
+ [default];
+ } spoolss_DocumentInfo;
+
+ WERROR spoolss_StartDocPrinter(
+ [in,ref] policy_handle *handle,
+ [in] uint32 level,
+ [in,switch_is(level)] spoolss_DocumentInfo info,
+ [out] uint32 job_id
+ );
+
+ /******************/
+ /* Function: 0x12 */
+ WERROR spoolss_StartPagePrinter(
+ [in,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x13 */
+ WERROR spoolss_WritePrinter(
+ [in,ref] policy_handle *handle,
+ [in] DATA_BLOB data,
+ [in,value(r->in.data.length)] uint32 _data_size,
+ [out] uint32 num_written
+ );
+
+ /******************/
+ /* Function: 0x14 */
+ WERROR spoolss_EndPagePrinter(
+ [in,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x15 */
+ WERROR spoolss_AbortPrinter(
+ [in,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x16 */
+ WERROR spoolss_ReadPrinter(
+ [in,ref] policy_handle *handle,
+ [in] uint32 data_size,
+ [out] DATA_BLOB data,
+ [out,value(r->out.data.length)] uint32 _data_size
+ );
+
+ /******************/
+ /* Function: 0x17 */
+ WERROR spoolss_EndDocPrinter(
+ [in,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x18 */
+ WERROR spoolss_AddJob(
+ );
+
+ /******************/
+ /* Function: 0x19 */
+ WERROR spoolss_ScheduleJob(
+ );
+
+ /******************/
+ /* Function: 0x1a */
+ const string SPOOLSS_ARCHITECTURE_NT_X86 = "Windows NT x86";
+
+ typedef [public,gensize] struct {
+ [value(ndr_size_spoolss_OSVersion(r,ndr->flags))] uint32 _ndr_size;
+ uint32 major;
+ uint32 minor;
+ uint32 build;
+ [value(2)] uint32 unknown;
+ [subcontext(0),subcontext_size(256)] nstring extra_string;
+ } spoolss_OSVersion;
+
+ typedef [public,gensize] struct {
+ [value(ndr_size_spoolss_OSVersionEx(r,ndr->flags))] uint32 _ndr_size;
+ uint32 major;
+ uint32 minor;
+ uint32 build;
+ [value(2)] uint32 unknown1;
+ [subcontext(0),subcontext_size(256)] nstring extra_string;
+ uint32 unknown2;/* service pack number? I saw 0 from w2k3 and 1 from winxp sp1*/
+ uint32 unknown3;/* hmm? w2k3: 131346(0x20112) winxp sp1: 503382272 0x1E010100 */
+ } spoolss_OSVersionEx;
+
+ typedef [v1_enum] enum {
+ SPOOLSS_PRINTER_DATA_TYPE_NULL = 0,
+ SPOOLSS_PRINTER_DATA_TYPE_STRING = 1,
+ SPOOLSS_PRINTER_DATA_TYPE_BINARY = 3,
+ SPOOLSS_PRINTER_DATA_TYPE_UINT32 = 4,
+ SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY = 7
+ } spoolss_PrinterDataType;
+
+ typedef [nodiscriminant,public,gensize] union {
+ [case(SPOOLSS_PRINTER_DATA_TYPE_NULL)];
+ [case(SPOOLSS_PRINTER_DATA_TYPE_STRING)] nstring string;
+ [case(SPOOLSS_PRINTER_DATA_TYPE_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary;
+ [case(SPOOLSS_PRINTER_DATA_TYPE_UINT32)] uint32 value;
+ [case(SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY)] nstring_array string_array;
+ [default,flag(NDR_REMAINING)] DATA_BLOB data;
+ } spoolss_PrinterData;
+
+ [noopnum,noprint,public] WERROR _spoolss_GetPrinterData(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 value_name[],
+ [in] uint32 offered,
+ [out] spoolss_PrinterDataType type,
+ [out] DATA_BLOB data,
+ [out] uint32 needed
+ );
+ [noopnum,noprint,public] void __spoolss_GetPrinterData(
+ [in] spoolss_PrinterDataType type,
+ [out,switch_is(type)] spoolss_PrinterData data
+ );
+ [nopull,nopush] WERROR spoolss_GetPrinterData(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 value_name[],
+ [in] uint32 offered,
+ [out] spoolss_PrinterDataType type,
+ [out,subcontext(4),subcontext_size(offered),switch_is(type)] spoolss_PrinterData data,
+ [out] uint32 needed
+ );
+
+ /******************/
+ /* Function: 0x1b */
+ [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 value_name[],
+ [in] spoolss_PrinterDataType type,
+ [in] DATA_BLOB data,
+ [in] uint32 _offered
+ );
+ [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData(
+ [in] spoolss_PrinterDataType type,
+ [out,switch_is(type)] spoolss_PrinterData data
+ );
+ [nopush] WERROR spoolss_SetPrinterData(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 value_name[],
+ [in] spoolss_PrinterDataType type,
+ [in,subcontext(4),switch_is(type)] spoolss_PrinterData data,
+ [in,value(ndr_size_spoolss_PrinterData(&data,type,flags))] uint32 _offered
+ );
+
+ /******************/
+ /* Function: 0x1c */
+ WERROR spoolss_WaitForPrinterChange(
+ );
+
+ /******************/
+ /* Function: 0x1d */
+ WERROR spoolss_ClosePrinter(
+ [in,out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x1e */
+ typedef [v1_enum] enum {
+ SPOOLSS_FORM_USER = 0,
+ SPOOLSS_FORM_BUILTIN = 1,
+ SPOOLSS_FORM_PRINTER = 2
+ } spoolss_FormFlags;
+
+ typedef struct {
+ uint32 width;
+ uint32 height;
+ } spoolss_FormSize;
+
+ typedef struct {
+ uint32 left;
+ uint32 top;
+ uint32 right;
+ uint32 bottom;
+ } spoolss_FormArea;
+
+ typedef struct {
+ spoolss_FormFlags flags;
+ [relative] nstring *form_name;
+ spoolss_FormSize size;
+ spoolss_FormArea area;
+ } spoolss_FormInfo1;
+
+ typedef [nodiscriminant,relative_base,public,gensize] union {
+ [case(1)] spoolss_FormInfo1 info1;
+ [default];
+ } spoolss_FormInfo;
+
+ typedef struct {
+ spoolss_FormFlags flags;
+ [string,charset(UTF16)] uint16 *form_name;
+ spoolss_FormSize size;
+ spoolss_FormArea area;
+ } spoolss_AddFormInfo1;
+
+ typedef [switch_type(uint32)] union {
+ [case(1)] spoolss_AddFormInfo1 *info1;
+ } spoolss_AddFormInfo;
+
+ WERROR spoolss_AddForm(
+ [in,ref] policy_handle *handle,
+ [in] uint32 level,
+ [in,switch_is(level)] spoolss_AddFormInfo info
+ );
+
+ /******************/
+ /* Function: 0x1f */
+ WERROR spoolss_DeleteForm(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 form_name[]
+ );
+
+ /******************/
+ /* Function: 0x20 */
+ WERROR spoolss_GetForm(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 form_name[],
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
+ [out] uint32 needed
+ );
+
+ /******************/
+ /* Function: 0x21 */
+ WERROR spoolss_SetForm(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 form_name[],
+ [in] uint32 level,
+ [in,switch_is(level)] spoolss_AddFormInfo info
+ );
+
+ /******************/
+ /* Function: 0x22 */
+ [public,noopnum,noprint] WERROR _spoolss_EnumForms(
+ [in,ref] policy_handle *handle,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out] DATA_BLOB *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+ [public,noopnum,noprint] void __spoolss_EnumForms(
+ [in] uint32 level,
+ [in] uint32 count,
+ [out,switch_is(level)] spoolss_FormInfo info[count]
+ );
+ [nopull,nopush] WERROR spoolss_EnumForms(
+ [in,ref] policy_handle *handle,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out,switch_is(level),size_is(count)] spoolss_FormInfo *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+
+ typedef struct {
+ [relative] nstring *port_name;
+ } spoolss_PortInfo1;
+
+ typedef bitmap {
+ SPOOLSS_PORT_TYPE_WRITE = 0x00000001,
+ SPOOLSS_PORT_TYPE_READ = 0x00000002,
+ SPOOLSS_PORT_TYPE_REDIRECTED = 0x00000004,
+ SPOOLSS_PORT_TYPE_NET_ATTACHED = 0x00000008
+ } spoolss_PortType;
+
+ typedef struct {
+ [relative] nstring *port_name;
+ [relative] nstring *monitor_name;
+ [relative] nstring *description;
+ spoolss_PortType port_type;
+ uint32 reserved;
+ } spoolss_PortInfo2;
+
+ typedef [nodiscriminant,relative_base,public] union {
+ [case(1)] spoolss_PortInfo1 info1;
+ [case(2)] spoolss_PortInfo2 info2;
+ [case(3)]; /* TODO */
+ [default];
+ } spoolss_PortInfo;
+
+ /******************/
+ /* Function: 0x23 */
+ [public,noopnum,noprint] WERROR _spoolss_EnumPorts(
+ [in] [string,charset(UTF16)] uint16 *servername,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out] DATA_BLOB *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+ [public,noopnum,noprint] void __spoolss_EnumPorts(
+ [in] uint32 level,
+ [in] uint32 count,
+ [out,switch_is(level)] spoolss_PortInfo info[count]
+ );
+ [nopull,nopush] WERROR spoolss_EnumPorts(
+ [in] [string,charset(UTF16)] uint16 *servername,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out,switch_is(level),size_is(count)] spoolss_PortInfo *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+
+ /******************/
+ /* Function: 0x24 */
+ typedef struct {
+ [relative] nstring *monitor_name;
+ } spoolss_MonitorInfo1;
+
+ typedef struct {
+ [relative] nstring *monitor_name;
+ [relative] nstring *environment;
+ [relative] nstring *dll_name;
+ } spoolss_MonitorInfo2;
+
+ typedef [nodiscriminant,relative_base,public] union {
+ [case(1)] spoolss_MonitorInfo1 info1;
+ [case(2)] spoolss_MonitorInfo2 info2;
+ [default];
+ } spoolss_MonitorInfo;
+
+ [public,noopnum,noprint] WERROR _spoolss_EnumMonitors(
+ [in] [string,charset(UTF16)] uint16 *servername,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out] DATA_BLOB *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+ [public,noopnum,noprint] void __spoolss_EnumMonitors(
+ [in] uint32 level,
+ [in] uint32 count,
+ [out,switch_is(level)] spoolss_MonitorInfo info[count]
+ );
+ [nopull,nopush] WERROR spoolss_EnumMonitors(
+ [in] [string,charset(UTF16)] uint16 *servername,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [out,switch_is(level),size_is(count)] spoolss_MonitorInfo *info,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+
+ /******************/
+ /* Function: 0x25 */
+ WERROR spoolss_AddPort(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] uint32 unknown,
+ [in] [string,charset(UTF16)] uint16 monitor_name[]
+ );
+
+ /******************/
+ /* Function: 0x26 */
+ WERROR spoolss_ConfigurePort(
+ );
+
+ /******************/
+ /* Function: 0x27 */
+ WERROR spoolss_DeletePort(
+ );
+
+ /******************/
+ /* Function: 0x28 */
+ WERROR spoolss_CreatePrinterIC(
+ );
+
+ /******************/
+ /* Function: 0x29 */
+ WERROR spoolss_PlayGDIScriptOnPrinterIC(
+ );
+
+ /******************/
+ /* Function: 0x2a */
+ WERROR spoolss_DeletePrinterIC(
+ );
+
+ /******************/
+ /* Function: 0x2b */
+ WERROR spoolss_AddPrinterConnection(
+ );
+
+ /******************/
+ /* Function: 0x2c */
+ WERROR spoolss_DeletePrinterConnection(
+ );
+
+ /******************/
+ /* Function: 0x2d */
+ WERROR spoolss_PrinterMessageBox(
+ /* Marked as obsolete in MSDN. "Not necessary and has
+ no effect". */
+ );
+
+ /******************/
+ /* Function: 0x2e */
+ WERROR spoolss_AddMonitor(
+ );
+
+ /******************/
+ /* Function: 0x2f */
+ WERROR spoolss_DeleteMonitor(
+ );
+
+ /******************/
+ /* Function: 0x30 */
+ WERROR spoolss_DeletePrintProcessor(
+ );
+
+ /******************/
+ /* Function: 0x31 */
+ WERROR spoolss_AddPrintProvidor(
+ );
+
+ /******************/
+ /* Function: 0x32 */
+ WERROR spoolss_DeletePrintProvidor(
+ );
+
+ /******************/
+ /* Function: 0x33 */
+ WERROR spoolss_EnumPrintProcDataTypes(
+ );
+
+ /******************/
+ /* Function: 0x34 */
+ WERROR spoolss_ResetPrinter(
+ );
+
+ /******************/
+ /* Function: 0x35 */
+ WERROR spoolss_GetPrinterDriver2(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 *architecture,
+ [in] uint32 level,
+ [in] DATA_BLOB *buffer,
+ [in] uint32 offered,
+ [in] uint32 client_major_version,
+ [in] uint32 client_minor_version,
+ [out] DATA_BLOB *info,
+ [out] uint32 needed,
+ [out] uint32 server_major_version,
+ [out] uint32 server_minor_version
+ );
+
+ /******************/
+ /* Function: 0x36 */
+ WERROR spoolss_FindFirstPrinterChangeNotification(
+ );
+
+ /******************/
+ /* Function: 0x37 */
+ WERROR spoolss_FindNextPrinterChangeNotification(
+ );
+
+ /******************/
+ /* Function: 0x38 */
+ WERROR spoolss_FindClosePrinterNotify(
+ );
+
+ /******************/
+ /* Function: 0x39 */
+ WERROR spoolss_RouterFindFirstPrinterChangeNotificationOld(
+ );
+
+ /******************/
+ /* Function: 0x3a */
+ WERROR spoolss_ReplyOpenPrinter(
+ );
+
+ /******************/
+ /* Function: 0x3b */
+ WERROR spoolss_RouterReplyPrinter(
+ );
+
+ /******************/
+ /* Function: 0x3c */
+ WERROR spoolss_ReplyClosePrinter(
+ );
+
+ /******************/
+ /* Function: 0x3d */
+ WERROR spoolss_AddPortEx(
+ );
+
+ /******************/
+ /* Function: 0x3e */
+ WERROR spoolss_RouterFindFirstPrinterChangeNotification(
+ );
+
+ /******************/
+ /* Function: 0x3f */
+ WERROR spoolss_SpoolerInit(
+ );
+
+ /******************/
+ /* Function: 0x40 */
+ WERROR spoolss_ResetPrinterEx(
+ );
+
+ /******************/
+ /* Function: 0x41 */
+ typedef [flag(NDR_PAHEX)] struct {
+ uint16 u1;
+ uint16 u2;
+ uint32 u3;
+ uint32 u4;
+ uint32 count;
+ [size_is(count)] uint16 *array;
+ } spoolss_RemoteFindFirstPrinterChangeNotifyEx_t2;
+
+ typedef struct {
+ uint32 u1;
+ uint32 u2;
+ uint32 count;
+ [size_is(count)] spoolss_RemoteFindFirstPrinterChangeNotifyEx_t2 *t2;
+ } spoolss_RemoteFindFirstPrinterChangeNotifyEx_t1;
+
+ WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
+ [in,ref] policy_handle *handle,
+ [in] uint32 u1,
+ [in] uint32 u2,
+ [in] [string,charset(UTF16)] uint16 *str,
+ [in] uint32 u3,
+ [in] spoolss_RemoteFindFirstPrinterChangeNotifyEx_t1 *t1
+ );
+
+ /******************/
+ /* Function: 0x42 */
+ WERROR spoolss_RouterRefreshPrinterChangeNotification(
+ );
+
+ /******************/
+ /* Function: 0x43 */
+ WERROR spoolss_RemoteFindNextPrinterChangeNotifyEx(
+ );
+
+ /******************/
+ /* Function: 0x44 */
+ WERROR spoolss_44(
+ );
+
+ typedef struct {
+ uint32 size;
+ [string,charset(UTF16)] uint16 *client;
+ [string,charset(UTF16)] uint16 *user;
+ uint32 build;
+ uint32 major;
+ uint32 minor;
+ uint32 processor;
+ } spoolss_UserLevel1;
+
+ typedef union {
+ [case(1)] spoolss_UserLevel1 *level1;
+ } spoolss_UserLevel;
+
+ /******************/
+ /* Function: 0x45 */
+ WERROR spoolss_OpenPrinterEx(
+ [in] [string,charset(UTF16)] uint16 *printername,
+ [in] [string,charset(UTF16)] uint16 *datatype,
+ [in] spoolss_DevmodeContainer devmode_ctr,
+ [in] uint32 access_mask,
+ [in] uint32 level,
+ [in,switch_is(level)] spoolss_UserLevel userlevel,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x46 */
+ WERROR spoolss_AddPrinterEx(
+ [in] [string,charset(UTF16)] uint16 *server,
+ [in] uint32 level,
+ [in,switch_is(level)] spoolss_PrinterInfo *info,
+ [in] spoolss_DevmodeContainer devmode_ctr,
+ [in] security_descriptor *secdesc,
+ [in] uint32 ulevel,
+ [in,switch_is(ulevel)] spoolss_UserLevel userlevel
+ );
+
+ /******************/
+ /* Function: 0x47 */
+ WERROR spoolss_47(
+ );
+
+ /******************/
+ /* Function: 0x48 */
+ WERROR spoolss_EnumPrinterData(
+ [in,ref] policy_handle *handle,
+ [in] uint32 enum_index,
+ [in] uint32 value_offered,
+ [out] lstring value_name,
+ [out] uint32 value_needed,
+ [out] uint32 printerdata_type,
+ [out] DATA_BLOB buffer,
+ [in,out,ref] uint32 *data_size
+ );
+
+ /******************/
+ /* Function: 0x49 */
+ WERROR spoolss_DeletePrinterData(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 value_name[]
+ );
+
+ /******************/
+ /* Function: 0x4a */
+ WERROR spoolss_4a(
+ );
+
+ /******************/
+ /* Function: 0x4b */
+ WERROR spoolss_4b(
+ );
+
+ /******************/
+ /* Function: 0x4c */
+ WERROR spoolss_4c(
+ );
+
+ /******************/
+ /* Function: 0x4d */
+ WERROR spoolss_SetPrinterDataEx(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 key_name[],
+ [in] [string,charset(UTF16)] uint16 value_name[],
+ [in] uint32 type,
+ [in] DATA_BLOB buffer,
+ [in] uint32 offered
+ );
+
+ /******************/
+ /* Function: 0x4e */
+ WERROR spoolss_GetPrinterDataEx(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 key_name[],
+ [in] [string,charset(UTF16)] uint16 value_name[],
+ [in] uint32 offered,
+ [out] uint32 type,
+ [out] DATA_BLOB buffer,
+ [out] uint32 needed
+ );
+
+ /******************/
+ /* Function: 0x4f */
+ WERROR spoolss_EnumPrinterDataEx(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 key_name[],
+ [in] uint32 offered,
+ [out] DATA_BLOB buffer,
+ [out] uint32 needed,
+ [out] uint32 count
+ );
+
+ /******************/
+ /* Function: 0x50 */
+ WERROR spoolss_EnumPrinterKey(
+ );
+
+ /******************/
+ /* Function: 0x51 */
+ WERROR spoolss_DeletePrinterDataEx(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 key_name[],
+ [in] [string,charset(UTF16)] uint16 value_name[]
+ );
+
+ /******************/
+ /* Function: 0x52 */
+ WERROR spoolss_DeletePrinterKey(
+ );
+
+ /******************/
+ /* Function: 0x53 */
+ WERROR spoolss_53(
+ );
+
+ /******************/
+ /* Function: 0x54 */
+ WERROR spoolss_DeletePrinterDriverEx(
+ );
+
+ /******************/
+ /* Function: 0x55 */
+ WERROR spoolss_55(
+ );
+
+ /******************/
+ /* Function: 0x56 */
+ WERROR spoolss_56(
+ );
+
+ /******************/
+ /* Function: 0x57 */
+ WERROR spoolss_57(
+ );
+
+ /******************/
+ /* Function: 0x58 */
+ WERROR spoolss_XcvData(
+ [in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 function_name[],
+ [in] DATA_BLOB in_data,
+ [in,value(r->in.in_data.length)] uint32 _in_data_length,
+ [in] uint32 offered,
+ [in] uint32 unknown1,
+ [out] DATA_BLOB out_data,
+ [out] uint32 needed,
+ [out] uint32 unknown2
+ );
+
+ /******************/
+ /* Function: 0x59 */
+ WERROR spoolss_AddPrinterDriverEx(
+ );
+
+ /******************/
+ /* Function: 0x5a */
+ WERROR spoolss_5a(
+ );
+
+ /******************/
+ /* Function: 0x5b */
+ WERROR spoolss_5b(
+ );
+
+ /******************/
+ /* Function: 0x5c */
+ WERROR spoolss_5c(
+ );
+
+ /******************/
+ /* Function: 0x5d */
+ WERROR spoolss_5d(
+ );
+
+ /******************/
+ /* Function: 0x5e */
+ WERROR spoolss_5e(
+ );
+
+ /******************/
+ /* Function: 0x5f */
+ WERROR spoolss_5f(
+ );
+}
diff --git a/source3/librpc/idl/srvsvc.idl b/source3/librpc/idl/srvsvc.idl
new file mode 100644
index 0000000000..4f1f70c6e8
--- /dev/null
+++ b/source3/librpc/idl/srvsvc.idl
@@ -0,0 +1,1504 @@
+#include "idl_types.h"
+
+/*
+ srvsvc interface definitions
+*/
+
+[ uuid("4b324fc8-1670-01d3-1278-5a47bf6ee188"),
+ version(3.0),
+ endpoint("ncacn_np:[\\pipe\\srvsvc]", "ncacn_ip_tcp:", "ncalrpc:"),
+ pointer_default(unique),
+ pointer_default_top(unique),
+ helpstring("Server Service"),
+ depends(security,svcctl),
+ keepref
+] interface srvsvc
+{
+ declare bitmap svcctl_ServerType;
+ declare bitmap security_secinfo;
+
+/**************************/
+/* srvsvc_NetCharDev */
+/**************************/
+ typedef struct {
+ [string,charset(UTF16)] uint16 *device;
+ } srvsvc_NetCharDevInfo0;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetCharDevInfo0 *array;
+ } srvsvc_NetCharDevCtr0;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *device;
+ uint32 status;
+ [string,charset(UTF16)] uint16 *user;
+ uint32 time;
+ } srvsvc_NetCharDevInfo1;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetCharDevInfo1 *array;
+ } srvsvc_NetCharDevCtr1;
+
+ typedef union {
+ [case(0)] srvsvc_NetCharDevInfo0 *info0;
+ [case(1)] srvsvc_NetCharDevInfo1 *info1;
+ [default] ;
+ } srvsvc_NetCharDevInfo;
+
+ typedef union {
+ [case(0)] srvsvc_NetCharDevCtr0 *ctr0;
+ [case(1)] srvsvc_NetCharDevCtr1 *ctr1;
+ [default] ;
+ } srvsvc_NetCharDevCtr;
+
+ /******************/
+ /* Function: 0x00 */
+ WERROR srvsvc_NetCharDevEnum(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in,out] uint32 level,
+ [in,out,switch_is(level)] srvsvc_NetCharDevCtr ctr,
+ [in] uint32 max_buffer,
+ [out] uint32 totalentries,
+ [in,out] uint32 *resume_handle
+ );
+
+ /******************/
+ /* Function: 0x01 */
+ WERROR srvsvc_NetCharDevGetInfo(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 device_name[],
+ [in] uint32 level,
+ [out,switch_is(level)] srvsvc_NetCharDevInfo info
+ );
+
+ /******************/
+ /* Function: 0x02 */
+ WERROR srvsvc_NetCharDevControl(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 device_name[],
+ [in] uint32 opcode
+ );
+
+/**************************/
+/* srvsvc_NetCharDevQ */
+/**************************/
+ typedef struct {
+ [string,charset(UTF16)] uint16 *device;
+ } srvsvc_NetCharDevQInfo0;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetCharDevQInfo0 *array;
+ } srvsvc_NetCharDevQCtr0;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *device;
+ uint32 priority;
+ [string,charset(UTF16)] uint16 *devices;
+ uint32 users;
+ uint32 num_ahead;
+ } srvsvc_NetCharDevQInfo1;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetCharDevQInfo1 *array;
+ } srvsvc_NetCharDevQCtr1;
+
+ typedef union {
+ [case(0)] srvsvc_NetCharDevQInfo0 *info0;
+ [case(1)] srvsvc_NetCharDevQInfo1 *info1;
+ [default] ;
+ } srvsvc_NetCharDevQInfo;
+
+ typedef union {
+ [case(0)] srvsvc_NetCharDevQCtr0 *ctr0;
+ [case(1)] srvsvc_NetCharDevQCtr1 *ctr1;
+ [default] ;
+ } srvsvc_NetCharDevQCtr;
+
+ /******************/
+ /* Function: 0x03 */
+ WERROR srvsvc_NetCharDevQEnum(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *user,
+ [in,out] uint32 level,
+ [in,out,switch_is(level)] srvsvc_NetCharDevQCtr ctr,
+ [in] uint32 max_buffer,
+ [out] uint32 totalentries,
+ [in,out] uint32 *resume_handle
+ );
+
+ /******************/
+ /* Function: 0x04 */
+ WERROR srvsvc_NetCharDevQGetInfo(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 queue_name[],
+ [in] [string,charset(UTF16)] uint16 user[],
+ [in] uint32 level,
+ [out,switch_is(level)] srvsvc_NetCharDevQInfo info
+ );
+
+ /******************/
+ /* Function: 0x05 */
+ WERROR srvsvc_NetCharDevQSetInfo(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 queue_name[],
+ [in] uint32 level,
+ [in,switch_is(level)] srvsvc_NetCharDevQInfo info,
+ [in,out] uint32 *parm_error
+ );
+
+ /******************/
+ /* Function: 0x06 */
+ WERROR srvsvc_NetCharDevQPurge(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 queue_name[]
+ );
+
+ /******************/
+ /* Function: 0x07 */
+ WERROR srvsvc_NetCharDevQPurgeSelf(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 queue_name[],
+ [in] [string,charset(UTF16)] uint16 computer_name[]
+ );
+
+/**************************/
+/* srvsvc_NetConn */
+/**************************/
+ typedef struct {
+ uint32 conn_id;
+ } srvsvc_NetConnInfo0;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetConnInfo0 *array;
+ } srvsvc_NetConnCtr0;
+
+ typedef struct {
+ uint32 conn_id;
+ uint32 conn_type;
+ uint32 num_open;
+ uint32 num_users;
+ uint32 conn_time;
+ [string,charset(UTF16)] uint16 *user;
+ [string,charset(UTF16)] uint16 *share;
+ } srvsvc_NetConnInfo1;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetConnInfo1 *array;
+ } srvsvc_NetConnCtr1;
+
+ typedef union {
+ [case(0)] srvsvc_NetConnCtr0 *ctr0;
+ [case(1)] srvsvc_NetConnCtr1 *ctr1;
+ [default] ;
+ } srvsvc_NetConnCtr;
+
+ /******************/
+ /* Function: 0x08 */
+ WERROR srvsvc_NetConnEnum(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *path,
+ [in,out] uint32 level,
+ [in,out,switch_is(level)] srvsvc_NetConnCtr ctr,
+ [in] uint32 max_buffer,
+ [out] uint32 totalentries,
+ [in,out] uint32 *resume_handle
+ );
+
+/**************************/
+/* srvsvc_NetFile */
+/**************************/
+ typedef struct {
+ uint32 fid;
+ } srvsvc_NetFileInfo2;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetFileInfo2 *array;
+ } srvsvc_NetFileCtr2;
+
+ typedef struct {
+ uint32 fid;
+ uint32 permissions;
+ uint32 num_locks;
+ [string,charset(UTF16)] uint16 *path;
+ [string,charset(UTF16)] uint16 *user;
+ } srvsvc_NetFileInfo3;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetFileInfo3 *array;
+ } srvsvc_NetFileCtr3;
+
+ typedef union {
+ [case(2)] srvsvc_NetFileInfo2 *info2;
+ [case(3)] srvsvc_NetFileInfo3 *info3;
+ [default] ;
+ } srvsvc_NetFileInfo;
+
+ typedef union {
+ [case(2)] srvsvc_NetFileCtr2 *ctr2;
+ [case(3)] srvsvc_NetFileCtr3 *ctr3;
+ [default] ;
+ } srvsvc_NetFileCtr;
+
+ /******************/
+ /* Function: 0x09 */
+ WERROR srvsvc_NetFileEnum(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *path,
+ [in] [string,charset(UTF16)] uint16 *user,
+ [in,out] uint32 level,
+ [in,out,switch_is(level)] srvsvc_NetFileCtr ctr,
+ [in] uint32 max_buffer,
+ [out] uint32 totalentries,
+ [in,out] uint32 *resume_handle
+ );
+
+ /******************/
+ /* Function: 0x0a */
+ WERROR srvsvc_NetFileGetInfo(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] uint32 fid,
+ [in] uint32 level,
+ [out,switch_is(level)] srvsvc_NetFileInfo info
+ );
+
+ /******************/
+ /* Function: 0x0b */
+ WERROR srvsvc_NetFileClose(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] uint32 fid
+ );
+
+/**************************/
+/* srvsvc_NetSess */
+/**************************/
+ typedef struct {
+ [string,charset(UTF16)] uint16 *client;
+ } srvsvc_NetSessInfo0;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetSessInfo0 *array;
+ } srvsvc_NetSessCtr0;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *client;
+ [string,charset(UTF16)] uint16 *user;
+ uint32 num_open;
+ uint32 time;
+ uint32 idle_time;
+ uint32 user_flags;
+ } srvsvc_NetSessInfo1;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetSessInfo1 *array;
+ } srvsvc_NetSessCtr1;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *client;
+ [string,charset(UTF16)] uint16 *user;
+ uint32 num_open;
+ uint32 time;
+ uint32 idle_time;
+ uint32 user_flags;
+ [string,charset(UTF16)] uint16 *client_type;
+ } srvsvc_NetSessInfo2;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetSessInfo2 *array;
+ } srvsvc_NetSessCtr2;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *client;
+ [string,charset(UTF16)] uint16 *user;
+ uint32 time;
+ uint32 idle_time;
+ } srvsvc_NetSessInfo10;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetSessInfo10 *array;
+ } srvsvc_NetSessCtr10;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *client;
+ [string,charset(UTF16)] uint16 *user;
+ uint32 num_open;
+ uint32 time;
+ uint32 idle_time;
+ uint32 user_flags;
+ [string,charset(UTF16)] uint16 *client_type;
+ [string,charset(UTF16)] uint16 *transport;
+ } srvsvc_NetSessInfo502;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetSessInfo502 *array;
+ } srvsvc_NetSessCtr502;
+
+ typedef union {
+ [case(0)] srvsvc_NetSessCtr0 *ctr0;
+ [case(1)] srvsvc_NetSessCtr1 *ctr1;
+ [case(2)] srvsvc_NetSessCtr2 *ctr2;
+ [case(10)] srvsvc_NetSessCtr10 *ctr10;
+ [case(502)] srvsvc_NetSessCtr502 *ctr502;
+ [default] ;
+ } srvsvc_NetSessCtr;
+
+ /******************/
+ /* Function: 0x0c */
+ WERROR srvsvc_NetSessEnum(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *client,
+ [in] [string,charset(UTF16)] uint16 *user,
+ [in,out] uint32 level,
+ [in,out,switch_is(level)] srvsvc_NetSessCtr ctr,
+ [in] uint32 max_buffer,
+ [out] uint32 totalentries,
+ [in,out] uint32 *resume_handle
+ );
+
+ /******************/
+ /* Function: 0x0d */
+ WERROR srvsvc_NetSessDel(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *client,
+ [in] [string,charset(UTF16)] uint16 *user
+ );
+
+/**************************/
+/* srvsvc_NetShare */
+/**************************/
+
+ /* share types */
+ const uint32 STYPE_TEMPORARY = 0x40000000; /* share is a temporary one */
+ const uint32 STYPE_HIDDEN = 0x80000000; /* share is a hidden one */
+
+ typedef [v1_enum, flag(NDR_PAHEX)] enum {
+ STYPE_DISKTREE = 0,
+ STYPE_DISKTREE_TEMPORARY = STYPE_DISKTREE|STYPE_TEMPORARY,
+ STYPE_DISKTREE_HIDDEN = STYPE_DISKTREE|STYPE_HIDDEN,
+ STYPE_PRINTQ = 1,
+ STYPE_PRINTQ_TEMPORARY = STYPE_PRINTQ|STYPE_TEMPORARY,
+ STYPE_PRINTQ_HIDDEN = STYPE_PRINTQ|STYPE_HIDDEN,
+ STYPE_DEVICE = 2, /* Serial device */
+ STYPE_DEVICE_TEMPORARY = STYPE_DEVICE|STYPE_TEMPORARY,
+ STYPE_DEVICE_HIDDEN = STYPE_DEVICE|STYPE_HIDDEN,
+ STYPE_IPC = 3, /* Interprocess communication (IPC) */
+ STYPE_IPC_TEMPORARY = STYPE_IPC|STYPE_TEMPORARY,
+ STYPE_IPC_HIDDEN = STYPE_IPC|STYPE_HIDDEN
+ } srvsvc_ShareType;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *name;
+ } srvsvc_NetShareInfo0;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetShareInfo0 *array;
+ } srvsvc_NetShareCtr0;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *name;
+ srvsvc_ShareType type;
+ [string,charset(UTF16)] uint16 *comment;
+ } srvsvc_NetShareInfo1;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetShareInfo1 *array;
+ } srvsvc_NetShareCtr1;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *name;
+ srvsvc_ShareType type;
+ [string,charset(UTF16)] uint16 *comment;
+ uint32 permissions;
+ uint32 max_users;
+ uint32 current_users;
+ [string,charset(UTF16)] uint16 *path;
+ [string,charset(UTF16)] uint16 *password;
+ } srvsvc_NetShareInfo2;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetShareInfo2 *array;
+ } srvsvc_NetShareCtr2;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *name;
+ srvsvc_ShareType type;
+ [string,charset(UTF16)] uint16 *comment;
+ uint32 csc_policy;
+ } srvsvc_NetShareInfo501;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetShareInfo501 *array;
+ } srvsvc_NetShareCtr501;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *name;
+ srvsvc_ShareType type;
+ [string,charset(UTF16)] uint16 *comment;
+ uint32 permissions;
+ int32 max_users;
+ uint32 current_users;
+ [string,charset(UTF16)] uint16 *path;
+ [string,charset(UTF16)] uint16 *password;
+ /* maybe here is a struct sec_desc_buf following */
+ uint32 unknown;
+ [subcontext(4)] security_descriptor *sd;
+ } srvsvc_NetShareInfo502;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetShareInfo502 *array;
+ } srvsvc_NetShareCtr502;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *comment;
+ } srvsvc_NetShareInfo1004;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetShareInfo1004 *array;
+ } srvsvc_NetShareCtr1004;
+
+ typedef struct {
+ uint32 dfs_flags;
+ } srvsvc_NetShareInfo1005;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetShareInfo1005 *array;
+ } srvsvc_NetShareCtr1005;
+
+ typedef struct {
+ int32 max_users;
+ } srvsvc_NetShareInfo1006;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetShareInfo1006 *array;
+ } srvsvc_NetShareCtr1006;
+
+ typedef struct {
+ uint32 flags;
+ [string,charset(UTF16)] uint16 *alternate_directory_name;
+ } srvsvc_NetShareInfo1007;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetShareInfo1007 *array;
+ } srvsvc_NetShareCtr1007;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] sec_desc_buf *array;
+ } srvsvc_NetShareCtr1501;
+
+ typedef union {
+ [case(0)] srvsvc_NetShareInfo0 *info0;
+ [case(1)] srvsvc_NetShareInfo1 *info1;
+ [case(2)] srvsvc_NetShareInfo2 *info2;
+ [case(501)] srvsvc_NetShareInfo501 *info501;
+ [case(502)] srvsvc_NetShareInfo502 *info502;
+ [case(1004)] srvsvc_NetShareInfo1004 *info1004;
+ [case(1005)] srvsvc_NetShareInfo1005 *info1005;
+ [case(1006)] srvsvc_NetShareInfo1006 *info1006;
+ [case(1007)] srvsvc_NetShareInfo1007 *info1007;
+ [case(1501)] sec_desc_buf *info1501;
+ [default] ;
+ } srvsvc_NetShareInfo;
+
+ typedef union {
+ [case(0)] srvsvc_NetShareCtr0 *ctr0;
+ [case(1)] srvsvc_NetShareCtr1 *ctr1;
+ [case(2)] srvsvc_NetShareCtr2 *ctr2;
+ [case(501)] srvsvc_NetShareCtr501 *ctr501;
+ [case(502)] srvsvc_NetShareCtr502 *ctr502;
+ [case(1004)] srvsvc_NetShareCtr1004 *ctr1004;
+ [case(1005)] srvsvc_NetShareCtr1005 *ctr1005;
+ [case(1006)] srvsvc_NetShareCtr1006 *ctr1006;
+ [case(1007)] srvsvc_NetShareCtr1007 *ctr1007;
+ [case(1501)] srvsvc_NetShareCtr1501 *ctr1501;
+ [default] ;
+ } srvsvc_NetShareCtr;
+
+ /******************/
+ /* Function: 0x0e */
+ WERROR srvsvc_NetShareAdd(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] uint32 level,
+ [in,switch_is(level)] srvsvc_NetShareInfo info,
+ [in,out] uint32 *parm_error
+ );
+
+ /******************/
+ /* Function: 0x0f */
+ WERROR srvsvc_NetShareEnumAll (
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in,out] uint32 level,
+ [in,out,switch_is(level)] srvsvc_NetShareCtr ctr,
+ [in] uint32 max_buffer,
+ [out] uint32 totalentries,
+ [in,out] uint32 *resume_handle
+ );
+
+ /******************/
+ /* Function: 0x10 */
+ WERROR srvsvc_NetShareGetInfo(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 share_name[],
+ [in] uint32 level,
+ [out,switch_is(level)] srvsvc_NetShareInfo info
+ );
+
+ /******************/
+ /* Function: 0x11 */
+ WERROR srvsvc_NetShareSetInfo(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 share_name[],
+ [in] uint32 level,
+ [in,switch_is(level)] srvsvc_NetShareInfo info,
+ [in,out] uint32 *parm_error
+ );
+
+ /******************/
+ /* Function: 0x12 */
+ WERROR srvsvc_NetShareDel(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 share_name[],
+ [in] uint32 reserved
+ );
+
+ /******************/
+ /* Function: 0x13 */
+ WERROR srvsvc_NetShareDelSticky(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 share_name[],
+ [in] uint32 reserved
+ );
+
+ /******************/
+ /* Function: 0x14 */
+ WERROR srvsvc_NetShareCheck(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 device_name[],
+ [out] srvsvc_ShareType type
+ );
+
+/**************************/
+/* srvsvc_NetSrv */
+/**************************/
+ typedef [public,v1_enum] enum {
+ PLATFORM_ID_DOS = 300,
+ PLATFORM_ID_OS2 = 400,
+ PLATFORM_ID_NT = 500,
+ PLATFORM_ID_OSF = 600,
+ PLATFORM_ID_VMS = 700
+ } srvsvc_PlatformId;
+
+ typedef struct {
+ srvsvc_PlatformId platform_id;
+ [string,charset(UTF16)] uint16 *server_name;
+ } srvsvc_NetSrvInfo100;
+
+ typedef struct {
+ srvsvc_PlatformId platform_id;
+ [string,charset(UTF16)] uint16 *server_name;
+ uint32 version_major;
+ uint32 version_minor;
+ svcctl_ServerType server_type;
+ [string,charset(UTF16)] uint16 *comment;
+ } srvsvc_NetSrvInfo101;
+
+ typedef struct {
+ srvsvc_PlatformId platform_id;
+ [string,charset(UTF16)] uint16 *server_name;
+ uint32 version_major;
+ uint32 version_minor;
+ svcctl_ServerType server_type;
+ [string,charset(UTF16)] uint16 *comment;
+ uint32 users;
+ uint32 disc;
+ uint32 hidden;
+ uint32 announce;
+ uint32 anndelta;
+ uint32 licenses;
+ [string,charset(UTF16)] uint16 *userpath;
+ } srvsvc_NetSrvInfo102;
+
+ typedef struct {
+ uint32 ulist_mtime;
+ uint32 glist_mtime;
+ uint32 alist_mtime;
+ [string,charset(UTF16)] uint16 *alerts;
+ uint32 security;
+ uint32 numadmin;
+ uint32 lanmask;
+ [string,charset(UTF16)] uint16 *guestaccount;
+ uint32 chdevs;
+ uint32 chdevqs;
+ uint32 chdevjobs;
+ uint32 connections;
+ uint32 shares;
+ uint32 openfiles;
+ uint32 sessopen;
+ uint32 sesssvc;
+ uint32 sessreqs;
+ uint32 opensearch;
+ uint32 activelocks;
+ uint32 sizereqbufs;
+ uint32 numbigbufs;
+ uint32 numfiletasks;
+ uint32 alertsched;
+ uint32 erroralert;
+ uint32 logonalert;
+ uint32 accessalert;
+ uint32 diskalert;
+ uint32 netioalert;
+ uint32 maxaudits;
+ [string,charset(UTF16)] uint16 *srvheuristics;
+ } srvsvc_NetSrvInfo402;
+
+ typedef struct {
+ uint32 ulist_mtime;
+ uint32 glist_mtime;
+ uint32 alist_mtime;
+ [string,charset(UTF16)] uint16 *alerts;
+ uint32 security;
+ uint32 numadmin;
+ uint32 lanmask;
+ [string,charset(UTF16)] uint16 *guestaccount;
+ uint32 chdevs;
+ uint32 chdevqs;
+ uint32 chdevjobs;
+ uint32 connections;
+ uint32 shares;
+ uint32 openfiles;
+ uint32 sessopen;
+ uint32 sesssvc;
+ uint32 sessreqs;
+ uint32 opensearch;
+ uint32 activelocks;
+ uint32 sizereqbufs;
+ uint32 numbigbufs;
+ uint32 numfiletasks;
+ uint32 alertsched;
+ uint32 eroralert;
+ uint32 logonalert;
+ uint32 accessalert;
+ uint32 diskalert;
+ uint32 netioalert;
+ uint32 maxaudits;
+ [string,charset(UTF16)] uint16 *srvheuristics;
+ uint32 auditedevents;
+ uint32 auditprofile;
+ [string,charset(UTF16)] uint16 *autopath;
+ } srvsvc_NetSrvInfo403;
+
+ typedef struct {
+ uint32 sessopen;
+ uint32 sesssvc;
+ uint32 opensearch;
+ uint32 sizereqbufs;
+ uint32 initworkitems;
+ uint32 maxworkitems;
+ uint32 rawworkitems;
+ uint32 irpstacksize;
+ uint32 maxrawbuflen;
+ uint32 sessusers;
+ uint32 sessconns;
+ uint32 maxpagedmemoryusage;
+ uint32 maxnonpagedmemoryusage;
+ uint32 enablesoftcompat;
+ uint32 enableforcedlogoff;
+ uint32 timesource;
+ uint32 acceptdownlevelapis;
+ uint32 lmannounce;
+ } srvsvc_NetSrvInfo502;
+
+ typedef struct{
+ uint32 sessopen;
+ uint32 sesssvc;
+ uint32 opensearch;
+ uint32 sizereqbufs;
+ uint32 initworkitems;
+ uint32 maxworkitems;
+ uint32 rawworkitems;
+ uint32 irpstacksize;
+ uint32 maxrawbuflen;
+ uint32 sessusers;
+ uint32 sessconns;
+ uint32 maxpagedmemoryusage;
+ uint32 maxnonpagedmemoryusage;
+ uint32 enablesoftcompat;
+ uint32 enableforcedlogoff;
+ uint32 timesource;
+ uint32 acceptdownlevelapis;
+ uint32 lmannounce;
+ [string,charset(UTF16)] uint16 *domain;
+ uint32 maxcopyreadlen;
+ uint32 maxcopywritelen;
+ uint32 minkeepsearch;
+ uint32 maxkeepsearch;
+ uint32 minkeepcomplsearch;
+ uint32 maxkeepcomplsearch;
+ uint32 threadcountadd;
+ uint32 numlockthreads;
+ uint32 scavtimeout;
+ uint32 minrcvqueue;
+ uint32 minfreeworkitems;
+ uint32 xactmemsize;
+ uint32 threadpriority;
+ uint32 maxmpxct;
+ uint32 oplockbreakwait;
+ uint32 oplockbreakresponsewait;
+ uint32 enableoplocks;
+ uint32 enableoplockforceclose;
+ uint32 enablefcbopens;
+ uint32 enableraw;
+ uint32 enablesharednetdrives;
+ uint32 minfreeconnections;
+ uint32 maxfreeconnections;
+ } srvsvc_NetSrvInfo503;
+
+ typedef struct{
+ uint32 sessopen;
+ uint32 sesssvc;
+ uint32 opensearch;
+ uint32 sizereqbufs;
+ uint32 initworkitems;
+ uint32 maxworkitems;
+ uint32 rawworkitems;
+ uint32 irpstacksize;
+ uint32 maxrawbuflen;
+ uint32 sessusers;
+ uint32 sessconns;
+ uint32 maxpagedmemoryusage;
+ uint32 maxnonpagedmemoryusage;
+ uint32 enablesoftcompat;
+ uint32 enableforcedlogoff;
+ uint32 timesource;
+ uint32 acceptdownlevelapis;
+ uint32 lmannounce;
+ [string,charset(UTF16)] uint16 *domain;
+ uint32 maxcopyreadlen;
+ uint32 maxcopywritelen;
+ uint32 minkeepsearch;
+ uint32 minkeepcomplsearch;
+ uint32 maxkeepcomplsearch;
+ uint32 threadcountadd;
+ uint32 numlockthreads;
+ uint32 scavtimeout;
+ uint32 minrcvqueue;
+ uint32 minfreeworkitems;
+ uint32 xactmemsize;
+ uint32 threadpriority;
+ uint32 maxmpxct;
+ uint32 oplockbreakwait;
+ uint32 oplockbreakresponsewait;
+ uint32 enableoplocks;
+ uint32 enableoplockforceclose;
+ uint32 enablefcbopens;
+ uint32 enableraw;
+ uint32 enablesharednetdrives;
+ uint32 minfreeconnections;
+ uint32 maxfreeconnections;
+ uint32 initsesstable;
+ uint32 initconntable;
+ uint32 initfiletable;
+ uint32 initsearchtable;
+ uint32 alertsched;
+ uint32 errortreshold;
+ uint32 networkerrortreshold;
+ uint32 diskspacetreshold;
+ uint32 reserved;
+ uint32 maxlinkdelay;
+ uint32 minlinkthroughput;
+ uint32 linkinfovalidtime;
+ uint32 scavqosinfoupdatetime;
+ uint32 maxworkitemidletime;
+ } srvsvc_NetSrvInfo599;
+
+ typedef struct{
+ [string,charset(UTF16)] uint16 *comment;
+ } srvsvc_NetSrvInfo1005;
+
+ typedef struct{
+ uint32 disc;
+ } srvsvc_NetSrvInfo1010;
+
+ typedef struct{
+ uint32 hidden;
+ } srvsvc_NetSrvInfo1016;
+
+ typedef struct{
+ uint32 announce;
+ } srvsvc_NetSrvInfo1017;
+
+ typedef struct{
+ uint32 anndelta;
+ } srvsvc_NetSrvInfo1018;
+
+ typedef struct{
+ uint32 users;
+ } srvsvc_NetSrvInfo1107;
+
+ typedef struct{
+ uint32 sessopens;
+ } srvsvc_NetSrvInfo1501;
+
+ typedef struct{
+ uint32 sessvcs;
+ } srvsvc_NetSrvInfo1502;
+
+ typedef struct{
+ uint32 opensearch;
+ } srvsvc_NetSrvInfo1503;
+
+ typedef struct{
+ uint32 maxworkitems;
+ } srvsvc_NetSrvInfo1506;
+
+ typedef struct{
+ uint32 maxrawbuflen;
+ } srvsvc_NetSrvInfo1509;
+
+ typedef struct{
+ uint32 sessusers;
+ } srvsvc_NetSrvInfo1510;
+
+ typedef struct{
+ uint32 sesscons;
+ } srvsvc_NetSrvInfo1511;
+
+ typedef struct{
+ uint32 maxnonpagedmemoryusage;
+ } srvsvc_NetSrvInfo1512;
+
+ typedef struct{
+ uint32 maxpagedmemoryusage;
+ } srvsvc_NetSrvInfo1513;
+
+ typedef struct{
+ uint32 enablesoftcompat;
+ } srvsvc_NetSrvInfo1514;
+
+ typedef struct{
+ uint32 enableforcedlogoff;
+ } srvsvc_NetSrvInfo1515;
+
+ typedef struct{
+ uint32 timesource;
+ } srvsvc_NetSrvInfo1516;
+
+ typedef struct{
+ uint32 lmannounce;
+ } srvsvc_NetSrvInfo1518;
+
+ typedef struct{
+ uint32 maxcopyreadlen;
+ } srvsvc_NetSrvInfo1520;
+
+ typedef struct{
+ uint32 maxcopywritelen;
+ } srvsvc_NetSrvInfo1521;
+
+ typedef struct{
+ uint32 minkeepsearch;
+ } srvsvc_NetSrvInfo1522;
+
+ typedef struct{
+ uint32 maxkeepsearch;
+ } srvsvc_NetSrvInfo1523;
+
+ typedef struct{
+ uint32 minkeepcomplsearch;
+ } srvsvc_NetSrvInfo1524;
+
+ typedef struct{
+ uint32 maxkeepcomplsearch;
+ } srvsvc_NetSrvInfo1525;
+
+ typedef struct{
+ uint32 scavtimeout;
+ } srvsvc_NetSrvInfo1528;
+
+ typedef struct{
+ uint32 minrcvqueue;
+ } srvsvc_NetSrvInfo1529;
+
+ typedef struct{
+ uint32 minfreeworkitems;
+ } srvsvc_NetSrvInfo1530;
+
+ typedef struct{
+ uint32 maxmpxct;
+ } srvsvc_NetSrvInfo1533;
+
+ typedef struct{
+ uint32 oplockbreakwait;
+ } srvsvc_NetSrvInfo1534;
+
+ typedef struct{
+ uint32 oplockbreakresponsewait;
+ } srvsvc_NetSrvInfo1535;
+
+ typedef struct{
+ uint32 enableoplocks;
+ } srvsvc_NetSrvInfo1536;
+
+ typedef struct{
+ uint32 enableoplockforceclose;
+ } srvsvc_NetSrvInfo1537;
+
+ typedef struct{
+ uint32 enablefcbopens;
+ } srvsvc_NetSrvInfo1538;
+
+ typedef struct{
+ uint32 enableraw;
+ } srvsvc_NetSrvInfo1539;
+
+ typedef struct{
+ uint32 enablesharednetdrives;
+ } srvsvc_NetSrvInfo1540;
+
+ typedef struct{
+ uint32 minfreeconnections;
+ } srvsvc_NetSrvInfo1541;
+
+ typedef struct{
+ uint32 maxfreeconnections;
+ } srvsvc_NetSrvInfo1542;
+
+ typedef struct{
+ uint32 initsesstable;
+ } srvsvc_NetSrvInfo1543;
+
+ typedef struct{
+ uint32 initconntable;
+ } srvsvc_NetSrvInfo1544;
+
+ typedef struct{
+ uint32 initfiletable;
+ } srvsvc_NetSrvInfo1545;
+
+ typedef struct{
+ uint32 initsearchtable;
+ } srvsvc_NetSrvInfo1546;
+
+ typedef struct{
+ uint32 alertsched;
+ } srvsvc_NetSrvInfo1547;
+
+ typedef struct{
+ uint32 errortreshold;
+ } srvsvc_NetSrvInfo1548;
+
+ typedef struct{
+ uint32 networkerrortreshold;
+ } srvsvc_NetSrvInfo1549;
+
+ typedef struct{
+ uint32 diskspacetreshold;
+ } srvsvc_NetSrvInfo1550;
+
+ typedef struct{
+ uint32 maxlinkdelay;
+ } srvsvc_NetSrvInfo1552;
+
+ typedef struct{
+ uint32 minlinkthroughput;
+ } srvsvc_NetSrvInfo1553;
+
+ typedef struct{
+ uint32 linkinfovalidtime;
+ } srvsvc_NetSrvInfo1554;
+
+ typedef struct{
+ uint32 scavqosinfoupdatetime;
+ } srvsvc_NetSrvInfo1555;
+
+ typedef struct{
+ uint32 maxworkitemidletime;
+ } srvsvc_NetSrvInfo1556;
+
+
+ typedef union{
+ [case(100)] srvsvc_NetSrvInfo100 *info100;
+ [case(101)] srvsvc_NetSrvInfo101 *info101;
+ [case(102)] srvsvc_NetSrvInfo102 *info102;
+ [case(402)] srvsvc_NetSrvInfo402 *info402;
+ [case(403)] srvsvc_NetSrvInfo403 *info403;
+ [case(502)] srvsvc_NetSrvInfo502 *info502;
+ [case(503)] srvsvc_NetSrvInfo503 *info503;
+ [case(599)] srvsvc_NetSrvInfo599 *info599;
+ [case(1005)] srvsvc_NetSrvInfo1005 *info1005;
+ [case(1010)] srvsvc_NetSrvInfo1010 *info1010;
+ [case(1016)] srvsvc_NetSrvInfo1016 *info1016;
+ [case(1017)] srvsvc_NetSrvInfo1017 *info1017;
+ [case(1018)] srvsvc_NetSrvInfo1018 *info1018;
+ [case(1107)] srvsvc_NetSrvInfo1107 *info1107;
+ [case(1501)] srvsvc_NetSrvInfo1501 *info1501;
+ [case(1502)] srvsvc_NetSrvInfo1502 *info1502;
+ [case(1503)] srvsvc_NetSrvInfo1503 *info1503;
+ [case(1506)] srvsvc_NetSrvInfo1506 *info1506;
+ [case(1509)] srvsvc_NetSrvInfo1509 *info1509;
+ [case(1510)] srvsvc_NetSrvInfo1510 *info1510;
+ [case(1511)] srvsvc_NetSrvInfo1511 *info1511;
+ [case(1512)] srvsvc_NetSrvInfo1512 *info1512;
+ [case(1513)] srvsvc_NetSrvInfo1513 *info1513;
+ [case(1514)] srvsvc_NetSrvInfo1514 *info1514;
+ [case(1515)] srvsvc_NetSrvInfo1515 *info1515;
+ [case(1516)] srvsvc_NetSrvInfo1516 *info1516;
+ [case(1518)] srvsvc_NetSrvInfo1518 *info1518;
+ [case(1520)] srvsvc_NetSrvInfo1520 *info1520;
+ [case(1521)] srvsvc_NetSrvInfo1521 *info1521;
+ [case(1522)] srvsvc_NetSrvInfo1522 *info1522;
+ [case(1523)] srvsvc_NetSrvInfo1523 *info1523;
+ [case(1524)] srvsvc_NetSrvInfo1524 *info1524;
+ [case(1525)] srvsvc_NetSrvInfo1525 *info1525;
+ [case(1528)] srvsvc_NetSrvInfo1528 *info1528;
+ [case(1529)] srvsvc_NetSrvInfo1529 *info1529;
+ [case(1530)] srvsvc_NetSrvInfo1530 *info1530;
+ [case(1533)] srvsvc_NetSrvInfo1533 *info1533;
+ [case(1534)] srvsvc_NetSrvInfo1534 *info1534;
+ [case(1535)] srvsvc_NetSrvInfo1535 *info1535;
+ [case(1536)] srvsvc_NetSrvInfo1536 *info1536;
+ [case(1537)] srvsvc_NetSrvInfo1537 *info1537;
+ [case(1538)] srvsvc_NetSrvInfo1538 *info1538;
+ [case(1539)] srvsvc_NetSrvInfo1539 *info1539;
+ [case(1540)] srvsvc_NetSrvInfo1540 *info1540;
+ [case(1541)] srvsvc_NetSrvInfo1541 *info1541;
+ [case(1542)] srvsvc_NetSrvInfo1542 *info1542;
+ [case(1543)] srvsvc_NetSrvInfo1543 *info1543;
+ [case(1544)] srvsvc_NetSrvInfo1544 *info1544;
+ [case(1545)] srvsvc_NetSrvInfo1545 *info1545;
+ [case(1546)] srvsvc_NetSrvInfo1546 *info1546;
+ [case(1547)] srvsvc_NetSrvInfo1547 *info1547;
+ [case(1548)] srvsvc_NetSrvInfo1548 *info1548;
+ [case(1549)] srvsvc_NetSrvInfo1549 *info1549;
+ [case(1550)] srvsvc_NetSrvInfo1550 *info1550;
+ [case(1552)] srvsvc_NetSrvInfo1552 *info1552;
+ [case(1553)] srvsvc_NetSrvInfo1553 *info1553;
+ [case(1554)] srvsvc_NetSrvInfo1554 *info1554;
+ [case(1555)] srvsvc_NetSrvInfo1555 *info1555;
+ [case(1556)] srvsvc_NetSrvInfo1556 *info1556;
+ [default];
+ } srvsvc_NetSrvInfo;
+
+ /******************/
+ /* Function: 0x15 */
+ WERROR srvsvc_NetSrvGetInfo(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] uint32 level,
+ [out,switch_is(level)] srvsvc_NetSrvInfo info
+ );
+
+ /******************/
+ /* Function: 0x16 */
+ WERROR srvsvc_NetSrvSetInfo(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] uint32 level,
+ [in,switch_is(level)] srvsvc_NetSrvInfo info,
+ [in,out] uint32 *parm_error
+ );
+
+/**************************/
+/* srvsvc_NetDisk */
+/**************************/
+ typedef struct {
+ [flag(STR_LEN4)] string disk;
+ } srvsvc_NetDiskInfo0;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count), length_is(count)] srvsvc_NetDiskInfo0 *disks;
+ } srvsvc_NetDiskInfo;
+
+ /******************/
+ /* Function: 0x17 */
+ WERROR srvsvc_NetDiskEnum(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] uint32 level,
+ [in,out] srvsvc_NetDiskInfo info,
+ [in] uint32 maxlen,
+ [out] uint32 totalentries,
+ [in,out] uint32 *resume_handle
+ );
+
+/**************************/
+/* srvsvc_NetStatistics */
+/**************************/
+ typedef struct {
+ uint32 start;
+ uint32 fopens;
+ uint32 devopens;
+ uint32 jobsqueued;
+ uint32 sopens;
+ uint32 stimeouts;
+ uint32 serrorout;
+ uint32 pwerrors;
+ uint32 permerrors;
+ uint32 syserrors;
+ uint32 bytessent_low;
+ uint32 bytessent_high;
+ uint32 bytesrcvd_low;
+ uint32 bytesrcvd_high;
+ uint32 avresponse;
+ uint32 reqbufneed;
+ uint32 bigbufneed;
+ } srvsvc_Statistics;
+
+ /******************/
+ /* Function: 0x18 */
+ WERROR srvsvc_NetServerStatisticsGet(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *service,
+ [in] uint32 level,
+ [in] uint32 options,
+ [out] srvsvc_Statistics stat
+ );
+
+/**************************/
+/* srvsvc_NetTransport */
+/**************************/
+ typedef struct {
+ uint32 vcs;
+ [string,charset(UTF16)] uint16 *name;
+ [size_is(addr_len)] uint8 *addr;
+ uint32 addr_len;
+ [string,charset(UTF16)] uint16 *net_addr;
+ } srvsvc_NetTransportInfo0;
+
+ /******************/
+ /* Function: 0x19 */
+ WERROR srvsvc_NetTransportAdd(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] uint32 level,
+ [in,switch_is(level)] srvsvc_NetTransportInfo info
+ );
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetTransportInfo0 *array;
+ } srvsvc_NetTransportCtr0;
+
+ typedef struct {
+ uint32 vcs;
+ [string,charset(UTF16)] uint16 *name;
+ [size_is(addr_len)] uint8 *addr;
+ uint32 addr_len;
+ [string,charset(UTF16)] uint16 *net_addr;
+ [string,charset(UTF16)] uint16 *domain;
+ } srvsvc_NetTransportInfo1;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetTransportInfo1 *array;
+ } srvsvc_NetTransportCtr1;
+
+ typedef struct {
+ uint32 vcs;
+ [string,charset(UTF16)] uint16 *name;
+ [size_is(addr_len)] uint8 *addr;
+ uint32 addr_len;
+ [string,charset(UTF16)] uint16 *net_addr;
+ [string,charset(UTF16)] uint16 *domain;
+ uint32 unknown;
+ } srvsvc_NetTransportInfo2;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetTransportInfo2 *array;
+ } srvsvc_NetTransportCtr2;
+
+ typedef struct {
+ uint32 vcs;
+ [string,charset(UTF16)] uint16 *name;
+ [size_is(addr_len)] uint8 *addr;
+ uint32 addr_len;
+ [string,charset(UTF16)] uint16 *net_addr;
+ [string,charset(UTF16)] uint16 *domain;
+ uint32 unknown1;
+ uint32 unknown2;
+ uint8 unknown3[256];
+ } srvsvc_NetTransportInfo3;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] srvsvc_NetTransportInfo3 *array;
+ } srvsvc_NetTransportCtr3;
+
+ typedef union {
+ [case(0)] srvsvc_NetTransportCtr0 *ctr0;
+ [case(1)] srvsvc_NetTransportCtr1 *ctr1;
+ [case(2)] srvsvc_NetTransportCtr2 *ctr2;
+ [case(3)] srvsvc_NetTransportCtr3 *ctr3;
+ [default];
+ } srvsvc_NetTransportCtr;
+
+ /******************/
+ /* Function: 0x1a */
+ WERROR srvsvc_NetTransportEnum(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in,out] uint32 level,
+ [in,out,switch_is(level)] srvsvc_NetTransportCtr transports,
+ [in] uint32 max_buffer,
+ [out] uint32 totalentries,
+ [in,out] uint32 *resume_handle
+ );
+
+ /******************/
+ /* Function: 0x1b */
+ WERROR srvsvc_NetTransportDel(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] uint32 unknown,
+ [in] srvsvc_NetTransportInfo0 transport
+ );
+
+/**************************/
+/* srvsvc_NetRemoteTOD */
+/**************************/
+ typedef struct {
+ uint32 elapsed; /* time(NULL) */
+ uint32 msecs; /* milliseconds till system reboot (uptime) */
+ uint32 hours;
+ uint32 mins;
+ uint32 secs;
+ uint32 hunds;
+ int32 timezone; /* in minutes */
+ uint32 tinterval; /* clock tick interval in 0.0001 second units; 310 on windows */
+ uint32 day;
+ uint32 month;
+ uint32 year;
+ uint32 weekday;
+ } srvsvc_NetRemoteTODInfo;
+
+ /******************/
+ /* Function: 0x1c */
+ WERROR srvsvc_NetRemoteTOD(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [out] srvsvc_NetRemoteTODInfo *info
+ );
+
+/**************************/
+/* srvsvc_NetServiceBits */
+/**************************/
+ /******************/
+ /* Function: 0x1d */
+ WERROR srvsvc_NetSetServiceBits(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *transport,
+ [in] uint32 servicebits,
+ [in] uint32 updateimmediately
+ );
+
+/**************************/
+/* srvsvc_NetPath */
+/**************************/
+ /******************/
+ /* Function: 0x1e */
+ WERROR srvsvc_NetPathType(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 path[],
+ [in] uint32 pathflags,
+ [out] uint32 pathtype
+ );
+
+ /******************/
+ /* Function: 0x1f */
+ WERROR srvsvc_NetPathCanonicalize(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 path[],
+ [out] [size_is(maxbuf)] uint8 can_path[],
+ [in] uint32 maxbuf,
+ [in] [string,charset(UTF16)] uint16 prefix[],
+ [in,out] uint32 pathtype,
+ [in] uint32 pathflags
+ );
+
+ /******************/
+ /* Function: 0x20 */
+ WERROR srvsvc_NetPathCompare(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 path1[],
+ [in] [string,charset(UTF16)] uint16 path2[],
+ [in] uint32 pathtype,
+ [in] uint32 pathflags
+ );
+
+/**************************/
+/* srvsvc_NetName */
+/**************************/
+ /******************/
+ /* Function: 0x21 */
+ WERROR srvsvc_NetNameValidate(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 name[],
+ [in] uint32 name_type,
+ [in] uint32 flags
+ );
+
+ /******************/
+ /* Function: 0x22 */
+ WERROR srvsvc_NETRPRNAMECANONICALIZE(
+ );
+
+ /******************/
+ /* Function: 0x23 */
+ WERROR srvsvc_NetPRNameCompare(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 name1[],
+ [in] [string,charset(UTF16)] uint16 name2[],
+ [in] uint32 name_type,
+ [in] uint32 flags
+ );
+
+/**************************/
+/* srvsvc_NetShare ... */
+/**************************/
+ /******************/
+ /* Function: 0x24 */
+ /* Note, there must be some way to return entries read vs
+ total entries ... */
+ WERROR srvsvc_NetShareEnum(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in,out] uint32 level,
+ [in,out,switch_is(level)] srvsvc_NetShareCtr ctr,
+ [in] uint32 max_buffer,
+ [out] uint32 totalentries,
+ [in,out] uint32 *resume_handle
+ );
+
+ /******************/
+ /* Function: 0x25 */
+ WERROR srvsvc_NetShareDelStart(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 share[],
+ [in] uint32 reserved,
+ [out] policy_handle *hnd
+ );
+
+ /******************/
+ /* Function: 0x26 */
+ WERROR srvsvc_NetShareDelCommit(
+ [in, out] policy_handle *hnd
+ );
+
+ /******************/
+ /* Function: 0x27 */
+ WERROR srvsvc_NetGetFileSecurity(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *share,
+ [in] [string,charset(UTF16)] uint16 file[],
+ [in] security_secinfo securityinformation,
+ [out] sec_desc_buf *sd_buf
+ );
+
+ /******************/
+ /* Function: 0x28 */
+ WERROR srvsvc_NetSetFileSecurity(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *share,
+ [in] [string,charset(UTF16)] uint16 file[],
+ [in] security_secinfo securityinformation,
+ [in] sec_desc_buf sd_buf
+ );
+
+
+
+ typedef [switch_type(uint32)] union {
+ [case(0)] srvsvc_NetTransportInfo0 info0;
+ [case(1)] srvsvc_NetTransportInfo1 info1;
+ [case(2)] srvsvc_NetTransportInfo2 info2;
+ [case(3)] srvsvc_NetTransportInfo3 info3;
+ } srvsvc_NetTransportInfo;
+
+ /******************/
+ /* Function: 0x29 */
+ WERROR srvsvc_NetServerTransportAddEx(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] uint32 level,
+ [in,switch_is(level)] srvsvc_NetTransportInfo info
+ );
+
+ /******************/
+ /* Function: 0x2a */
+ WERROR srvsvc_NetServerSetServiceBitsEx(
+ [in] [string,charset(UTF16)] uint16 *server_unc,
+ [in] [string,charset(UTF16)] uint16 *emulated_server_unc,
+ [in] [string,charset(UTF16)] uint16 *transport,
+ [in] uint32 servicebitsofinterest,
+ [in] uint32 servicebits,
+ [in] uint32 updateimmediately
+ );
+
+ /******************/
+ /* Function: 0x2b */
+ WERROR srvsvc_NETRDFSGETVERSION(
+ );
+
+ /******************/
+ /* Function: 0x2c */
+ WERROR srvsvc_NETRDFSCREATELOCALPARTITION(
+ );
+
+ /******************/
+ /* Function: 0x2d */
+ WERROR srvsvc_NETRDFSDELETELOCALPARTITION(
+ );
+
+ /******************/
+ /* Function: 0x2e */
+ WERROR srvsvc_NETRDFSSETLOCALVOLUMESTATE(
+ );
+
+ /******************/
+ /* Function: 0x2f */
+ WERROR srvsvc_NETRDFSSETSERVERINFO(
+ );
+
+ /******************/
+ /* Function: 0x30 */
+ WERROR srvsvc_NETRDFSCREATEEXITPOINT(
+ );
+
+ /******************/
+ /* Function: 0x31 */
+ WERROR srvsvc_NETRDFSDELETEEXITPOINT(
+ );
+
+ /******************/
+ /* Function: 0x32 */
+ WERROR srvsvc_NETRDFSMODIFYPREFIX(
+ );
+
+ /******************/
+ /* Function: 0x33 */
+ WERROR srvsvc_NETRDFSFIXLOCALVOLUME(
+ );
+
+ /******************/
+ /* Function: 0x34 */
+ WERROR srvsvc_NETRDFSMANAGERREPORTSITEINFO(
+ );
+
+ /******************/
+ /* Function: 0x35 */
+ WERROR srvsvc_NETRSERVERTRANSPORTDELEX(
+ );
+}
diff --git a/source3/librpc/idl/svcctl.idl b/source3/librpc/idl/svcctl.idl
new file mode 100644
index 0000000000..97460217f5
--- /dev/null
+++ b/source3/librpc/idl/svcctl.idl
@@ -0,0 +1,446 @@
+#include "idl_types.h"
+
+/*
+ svcctl interface definitions
+*/
+
+[ uuid("367abb81-9844-35f1-ad32-98f038001003"),
+ version(2.0),
+ pointer_default(unique),
+ pointer_default_top(unique),
+ endpoint("ncacn_np:[\\pipe\\svcctl]", "ncalrpc:"),
+ helpstring("Service Control"),
+ keepref
+] interface svcctl
+{
+ typedef struct {
+ uint32 is_locked;
+ [string,charset(UTF16)] uint16 *lock_owner;
+ uint32 lock_duration;
+ } SERVICE_LOCK_STATUS;
+
+ typedef struct {
+ uint32 type;
+ uint32 state;
+ uint32 controls_accepted;
+ uint32 win32_exit_code;
+ uint32 service_exit_code;
+ uint32 check_point;
+ uint32 wait_hint;
+ } SERVICE_STATUS;
+
+ typedef struct {
+ [relative] astring *service_name;
+ [relative] astring *display_name;
+ SERVICE_STATUS status;
+ } ENUM_SERVICE_STATUS;
+
+ const int SERVICE_TYPE_KERNEL_DRIVER = 0x01;
+ const int SERVICE_TYPE_FS_DRIVER = 0x02;
+ const int SERVICE_TYPE_ADAPTER = 0x04;
+ const int SERVICE_TYPE_RECOGNIZER_DRIVER = 0x08;
+ const int SERVICE_TYPE_DRIVER=SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER;
+ const int SERVICE_TYPE_WIN32_OWN_PROCESS = 0x10;
+ const int SERVICE_TYPE_WIN32_SHARE_PROCESS = 0x20;
+ const int SERVICE_TYPE_WIN32=SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS;
+
+ const int SERVICE_STATE_ACTIVE = 0x01;
+ const int SERVICE_STATE_INACTIVE = 0x02;
+ const int SERVICE_STATE_ALL = 0x03;
+
+ typedef [public,bitmap32bit] bitmap {
+ SV_TYPE_WORKSTATION = 0x00000001,
+ SV_TYPE_SERVER = 0x00000002,
+ SV_TYPE_SQLSERVER = 0x00000004,
+ SV_TYPE_DOMAIN_CTRL = 0x00000008,
+ SV_TYPE_DOMAIN_BAKCTRL = 0x00000010,
+ SV_TYPE_TIME_SOURCE = 0x00000020,
+ SV_TYPE_AFP = 0x00000040,
+ SV_TYPE_NOVELL = 0x00000080,
+
+ SV_TYPE_DOMAIN_MEMBER = 0x00000100,
+ SV_TYPE_PRINTQ_SERVER = 0x00000200,
+ SV_TYPE_DIALIN_SERVER = 0x00000400,
+ SV_TYPE_SERVER_UNIX = 0x00000800,
+ SV_TYPE_NT = 0x00001000,
+ SV_TYPE_WFW = 0x00002000,
+ SV_TYPE_SERVER_MFPN = 0x00004000,
+ SV_TYPE_SERVER_NT = 0x00008000,
+ SV_TYPE_POTENTIAL_BROWSER = 0x00010000,
+ SV_TYPE_BACKUP_BROWSER = 0x00020000,
+ SV_TYPE_MASTER_BROWSER = 0x00040000,
+ SV_TYPE_DOMAIN_MASTER = 0x00080000,
+ SV_TYPE_SERVER_OSF = 0x00100000,
+ SV_TYPE_SERVER_VMS = 0x00200000,
+ SV_TYPE_WIN95_PLUS = 0x00400000,
+ SV_TYPE_DFS_SERVER = 0x00800000,
+ SV_TYPE_ALTERNATE_XPORT = 0x20000000,
+ SV_TYPE_LOCAL_LIST_ONLY = 0x40000000,
+ SV_TYPE_DOMAIN_ENUM = 0x80000000
+ } svcctl_ServerType;
+
+ const uint32 SV_TYPE_ALL = 0xFFFFFFFF;
+
+ /*****************/
+ /* Function 0x00 */
+ WERROR svcctl_CloseServiceHandle(
+ [in,out,ref] policy_handle *handle
+ );
+
+ /*****************/
+ /* Function 0x01 */
+
+ typedef enum {
+ FIXME=1
+ } SERVICE_CONTROL;
+
+ WERROR svcctl_ControlService(
+ [in,ref] policy_handle *handle,
+ [in] uint32 control,
+ [out,ref] SERVICE_STATUS *status
+ );
+
+ /*****************/
+ /* Function 0x02 */
+ WERROR svcctl_DeleteService([in,ref] policy_handle *handle);
+
+ /*****************/
+ /* Function 0x03 */
+
+ WERROR svcctl_LockServiceDatabase(
+ [in,ref] policy_handle *handle,
+ [out] policy_handle lock
+ );
+
+ /*****************/
+ /* Function 0x04 */
+ WERROR svcctl_QueryServiceObjectSecurity();
+
+ /*****************/
+ /* Function 0x05 */
+ WERROR svcctl_SetServiceObjectSecurity();
+
+ /*****************/
+ /* Function 0x06 */
+ WERROR svcctl_QueryServiceStatus(
+ [in,ref] policy_handle *handle,
+ [out,ref] SERVICE_STATUS *status);
+
+ /*****************/
+ /* Function 0x07 */
+ WERROR svcctl_SetServiceStatus();
+
+ /*****************/
+ /* Function 0x08 */
+ WERROR svcctl_UnlockServiceDatabase(
+ [in,out,ref] policy_handle *lock
+ );
+
+ /*****************/
+ /* Function 0x09 */
+ WERROR svcctl_NotifyBootConfigStatus();
+
+ /*****************/
+ /* Function 0x0a */
+ WERROR svcctl_SCSetServiceBitsW(
+ [in,ref] policy_handle *handle,
+ [in] uint32 bits,
+ [in] boolean32 bitson,
+ [in] boolean32 immediate);
+
+ /*****************/
+ /* Function 0x0b */
+ WERROR svcctl_ChangeServiceConfigW([in,ref] policy_handle *handle,
+ [in] uint32 type,
+ [in] uint32 start,
+ [in] uint32 error,
+ [in] [string,charset(UTF16)] uint16 *binary_path,
+ [in] [string,charset(UTF16)] uint16 *load_order_group,
+ [out] uint32 tag_id,
+ [in] [string,charset(UTF16)] uint16 *dependencies,
+ [in] [string,charset(UTF16)] uint16 *service_start_name,
+ [in] [string,charset(UTF16)] uint16 *password,
+ [in] [string,charset(UTF16)] uint16 *display_name);
+
+ /*****************/
+ /* Function 0x0c */
+ WERROR svcctl_CreateServiceW([in,ref] policy_handle *scmanager_handle,
+ [in] [string,charset(UTF16)] uint16 ServiceName[],
+ [in] [string,charset(UTF16)] uint16 *DisplayName,
+ [in] uint32 desired_access,
+ [in] uint32 type,
+ [in] uint32 start_type,
+ [in] uint32 error_control,
+ [in] [string,charset(UTF16)] uint16 binary_path[],
+ [in] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
+ [in,out] uint32 *TagId,
+ [in,size_is(dependencies_size)] uint8 *dependencies,
+ [in] uint32 dependencies_size,
+ [in] [string,charset(UTF16)] uint16 *service_start_name,
+ [in,size_is(password_size)] uint8 *password,
+ [in] uint32 password_size,
+ [out,ref] policy_handle *handle);
+
+ /*****************/
+ /* Function 0x0d */
+ WERROR svcctl_EnumDependentServicesW([in,ref] policy_handle *service,
+ [in] uint32 state,
+ [out] ENUM_SERVICE_STATUS *status,
+ [in] uint32 buf_size,
+ [out] uint32 bytes_needed,
+ [out] uint32 services_returned);
+
+ /*****************/
+ /* Function 0x0e */
+ WERROR svcctl_EnumServicesStatusW(
+ [in,ref] policy_handle *handle,
+ [in] uint32 type,
+ [in] uint32 state,
+ [in] uint32 buf_size,
+ [out,size_is(buf_size)] uint8 service[*],
+ [out] uint32 bytes_needed,
+ [out] uint32 services_returned,
+ [in,out] uint32 *resume_handle
+ );
+ /*****************/
+ /* Function 0x0f */
+ WERROR svcctl_OpenSCManagerW(
+ [in] [string,charset(UTF16)] uint16 *MachineName,
+ [in] [string,charset(UTF16)] uint16 *DatabaseName,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *handle);
+
+ /*****************/
+ /* Function 0x10 */
+ WERROR svcctl_OpenServiceW([in,ref] policy_handle *scmanager_handle,
+ [in] [string,charset(UTF16)] uint16 ServiceName[],
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *handle);
+
+ /*****************/
+ /* Function 0x11 */
+ WERROR svcctl_QueryServiceConfigW([in,ref] policy_handle *handle,
+ [out] uint8 query[buf_size], /*QUERY_SERVICE_CONFIG */
+ [in] uint32 buf_size,
+ [out] uint32 bytes_needed
+ );
+
+ /*****************/
+ /* Function 0x12 */
+ WERROR svcctl_QueryServiceLockStatusW(
+ [in,ref] policy_handle *handle,
+ [in] uint32 buf_size,
+ [out,ref] SERVICE_LOCK_STATUS *status,
+ [out,ref] uint32 *required_buf_size
+ );
+
+ /*****************/
+ /* Function 0x13 */
+ WERROR svcctl_StartServiceW(
+ [in,ref] policy_handle *handle,
+ [in] uint32 NumArgs,
+ [in,length_is(NumArgs)] [string,charset(UTF16)] uint16 *Arguments);
+
+ /*****************/
+ /* Function 0x14 */
+ WERROR svcctl_GetServiceDisplayNameW([in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 *service_name,
+ [out] [string,charset(UTF16)] uint16 *display_name,
+ [in,out] uint32 *display_name_length);
+ /*****************/
+ /* Function 0x15 */
+ WERROR svcctl_GetServiceKeyNameW([in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 *service_name,
+ [out] [string,charset(UTF16)] uint16 *key_name,
+ [in,out] uint32 *display_name_length);
+ /*****************/
+ /* Function 0x16 */
+ WERROR svcctl_SCSetServiceBitsA(
+ [in,ref] policy_handle *handle,
+ [in] uint32 bits,
+ [in] boolean32 bitson,
+ [in] boolean32 immediate);
+
+ /*****************/
+ /* Function 0x17 */
+ WERROR svcctl_ChangeServiceConfigA([in,ref] policy_handle *handle,
+ [in] uint32 type,
+ [in] uint32 start,
+ [in] uint32 error,
+ [in] [string,charset(UTF16)] uint16 *binary_path,
+ [in] [string,charset(UTF16)] uint16 *load_order_group,
+ [out] uint32 tag_id,
+ [in] [string,charset(UTF16)] uint16 *dependencies,
+ [in] [string,charset(UTF16)] uint16 *service_start_name,
+ [in] [string,charset(UTF16)] uint16 *password,
+ [in] [string,charset(UTF16)] uint16 *display_name);
+
+ /*****************/
+ /* Function 0x18 */
+ WERROR svcctl_CreateServiceA([in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 *ServiceName,
+ [in] [string,charset(UTF16)] uint16 *DisplayName,
+ [in] uint32 desired_access,
+ [in] uint32 type,
+ [in] uint32 start_type,
+ [in] uint32 error_control,
+ [in] [string,charset(UTF16)] uint16 *binary_path,
+ [in] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
+ [out] uint32 *TagId,
+ [in] [string,charset(UTF16)] uint16 *dependencies,
+ [in] [string,charset(UTF16)] uint16 *service_start_name,
+ [in] [string,charset(UTF16)] uint16 *password);
+
+ /*****************/
+ /* Function 0x19 */
+ WERROR svcctl_EnumDependentServicesA([in,ref] policy_handle *service,
+ [in] uint32 state,
+ [out] ENUM_SERVICE_STATUS *status,
+ [in] uint32 buf_size,
+ [out] uint32 bytes_needed,
+ [out] uint32 services_returned);
+
+ /*****************/
+ /* Function 0x1a */
+ WERROR svcctl_EnumServicesStatusA(
+ [in,ref] policy_handle *handle,
+ [in] uint32 type,
+ [in] uint32 state,
+ [in] uint32 buf_size,
+ [out,size_is(buf_size)] uint8 service[*],
+ [out] uint32 bytes_needed,
+ [out] uint32 services_returned,
+ [in,out] uint32 *resume_handle
+ );
+
+ /*****************/
+ /* Function 0x1b */
+ WERROR svcctl_OpenSCManagerA(
+ [in] [string,charset(UTF16)] uint16 *MachineName,
+ [in] [string,charset(UTF16)] uint16 *DatabaseName,
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *handle);
+
+ /*****************/
+ /* Function 0x1c */
+ WERROR svcctl_OpenServiceA([in,ref] policy_handle *scmanager_handle,
+ [in] [string,charset(UTF16)] uint16 *ServiceName,
+ [in] uint32 access_mask);
+
+ /*****************/
+ /* Function 0x1d */
+ WERROR svcctl_QueryServiceConfigA([in,ref] policy_handle *handle,
+ [out] uint8 query[buf_size], /*QUERYU_SERVICE_CONFIG */
+ [in] uint32 buf_size,
+ [out] uint32 bytes_needed
+ );
+
+ /*****************/
+ /* Function 0x1e */
+ WERROR svcctl_QueryServiceLockStatusA(
+ [in,ref] policy_handle *handle,
+ [in] uint32 buf_size,
+ [out,ref] SERVICE_LOCK_STATUS *status,
+ [out,ref] uint32 *required_buf_size
+ );
+
+ /*****************/
+ /* Function 0x1f */
+ WERROR svcctl_StartServiceA(
+ [in,ref] policy_handle *handle,
+ [in] uint32 NumArgs,
+ [in,length_is(NumArgs)] [string,charset(UTF16)] uint16 *Arguments);
+
+ /*****************/
+ /* Function 0x20 */
+ WERROR svcctl_GetServiceDisplayNameA([in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 *service_name,
+ [out] [string,charset(UTF16)] uint16 *display_name,
+ [in,out] uint32 *display_name_length);
+ /*****************/
+ /* Function 0x21 */
+ WERROR svcctl_GetServiceKeyNameA([in,ref] policy_handle *handle,
+ [in] [string,charset(UTF16)] uint16 *service_name,
+ [out] [string,charset(UTF16)] uint16 *key_name,
+ [in,out] uint32 *display_name_length);
+
+ /*****************/
+ /* Function 0x22 */
+ WERROR svcctl_GetCurrentGroupeStateW();
+
+ /*****************/
+ /* Function 0x23 */
+ WERROR svcctl_EnumServiceGroupW();
+
+ /*****************/
+ /* Function 0x24 */
+ WERROR svcctl_ChangeServiceConfig2A([in,ref] policy_handle *handle,
+ [in] uint32 info_level,
+ [in] uint8 *info
+ );
+
+ /*****************/
+ /* Function 0x25 */
+ WERROR svcctl_ChangeServiceConfig2W([in,ref] policy_handle *handle,
+ [in] uint32 info_level,
+ [in] uint8 *info);
+
+ /*****************/
+ /* Function 0x26 */
+ WERROR svcctl_QueryServiceConfig2A(
+ [in,ref] policy_handle *handle,
+ [in] uint32 info_level,
+ [out] uint8 buffer[buf_size],
+ [in] uint32 buf_size,
+ [out] uint32 bytes_needed);
+
+ /*****************/
+ /* Function 0x27 */
+ WERROR svcctl_QueryServiceConfig2W(
+ [in,ref] policy_handle *handle,
+ [in] uint32 info_level,
+ [out] uint8 buffer[buf_size],
+ [in] uint32 buf_size,
+ [out] uint32 bytes_needed);
+
+ /*****************/
+ /* Function 0x28 */
+ WERROR svcctl_QueryServiceStatusEx(
+ [in,ref] policy_handle *handle,
+ [in] uint32 info_level,
+ [out] uint8 buffer[buf_size],
+ [in] uint32 buf_size,
+ [out] uint32 bytes_needed);
+
+ /*****************/
+ /* Function 0x29 */
+ WERROR EnumServicesStatusExA(
+ [in,ref] policy_handle *scmanager,
+ [in] uint32 info_level,
+ [in] uint32 type,
+ [in] uint32 state,
+ [out] uint8 services[buf_size],
+ [in] uint32 buf_size,
+ [out] uint32 bytes_needed,
+ [out] uint32 service_returned,
+ [in,out] uint32 *resume_handle,
+ [out] [string,charset(UTF16)] uint16 *group_name);
+
+ /*****************/
+ /* Function 0x2a */
+ WERROR EnumServicesStatusExW(
+ [in,ref] policy_handle *scmanager,
+ [in] uint32 info_level,
+ [in] uint32 type,
+ [in] uint32 state,
+ [out] uint8 services[buf_size],
+ [in] uint32 buf_size,
+ [out] uint32 bytes_needed,
+ [out] uint32 service_returned,
+ [in,out] uint32 *resume_handle,
+ [out] [string,charset(UTF16)] uint16 *group_name);
+
+ /*****************/
+ /* Function 0x2b */
+ WERROR svcctl_SCSendTSMessage();
+}
diff --git a/source3/librpc/idl/unixinfo.idl b/source3/librpc/idl/unixinfo.idl
new file mode 100644
index 0000000000..086cfc7486
--- /dev/null
+++ b/source3/librpc/idl/unixinfo.idl
@@ -0,0 +1,56 @@
+#include "idl_types.h"
+/*
+ Unixinfo interface definition
+*/
+
+[ uuid("9c54e310-a955-4885-bd31-78787147dfa6"),
+ version(0.0),
+ endpoint("ncacn_np:[\\pipe\\unixinfo]", "ncacn_ip_tcp:", "ncalrpc:"),
+ pointer_default(unique),
+ helpstring("Unixinfo specific stuff"),
+ depends(security),
+ keepref
+] interface unixinfo
+{
+ /******************/
+ /* Function: 0x00 */
+ NTSTATUS unixinfo_SidToUid (
+ [in] dom_sid sid,
+ [out,ref] hyper *uid
+ );
+
+ /******************/
+ /* Function: 0x01 */
+ NTSTATUS unixinfo_UidToSid (
+ [in] hyper uid,
+ [out,unique] dom_sid *sid
+ );
+
+ /******************/
+ /* Function: 0x02 */
+ NTSTATUS unixinfo_SidToGid (
+ [in] dom_sid sid,
+ [out,ref] hyper *gid
+ );
+
+ /******************/
+ /* Function: 0x03 */
+ NTSTATUS unixinfo_GidToSid (
+ [in] hyper gid,
+ [out,unique] dom_sid *sid
+ );
+
+ typedef struct {
+ NTSTATUS status;
+ utf8string homedir;
+ utf8string shell;
+ } unixinfo_GetPWUidInfo;
+
+ /******************/
+ /* Function: 0x04 */
+ NTSTATUS unixinfo_GetPWUid (
+ [in,out,ref,range(0,1023)] uint32 *count,
+ [in,size_is(*count)] hyper uids[],
+ [out,size_is(*count)] unixinfo_GetPWUidInfo infos[*]
+ );
+}
diff --git a/source3/librpc/idl/winreg.idl b/source3/librpc/idl/winreg.idl
new file mode 100644
index 0000000000..04521304e7
--- /dev/null
+++ b/source3/librpc/idl/winreg.idl
@@ -0,0 +1,365 @@
+/*
+ winreg interface definition
+*/
+
+[
+ uuid("338cd001-2244-31f1-aaaa-900038001003"),
+ version(1.0),
+ endpoint("ncacn_np:[\\pipe\\winreg]","ncacn_ip_tcp:","ncalrpc:"),
+ pointer_default(unique),
+ pointer_default_top(unique),
+ helpstring("Remote Registry Service"),
+ depends(lsa,initshutdown,security),
+ keepref
+] interface winreg
+{
+ declare bitmap security_secinfo;
+
+ typedef [bitmap32bit] bitmap {
+ } winreg_AccessMask;
+
+ typedef [v1_enum] enum {
+ REG_NONE = 0,
+ REG_SZ = 1,
+ REG_EXPAND_SZ = 2,
+ REG_BINARY = 3,
+ REG_DWORD = 4,
+ REG_DWORD_BIG_ENDIAN = 5,
+ REG_LINK = 6,
+ REG_MULTI_SZ = 7,
+ REG_RESOURCE_LIST = 8,
+ REG_FULL_RESOURCE_DESCRIPTOR = 9,
+ REG_RESOURCE_REQUIREMENTS_LIST = 10,
+ REG_QWORD = 11
+ } winreg_Type;
+
+ typedef [public,noejs] struct {
+ [value(strlen_m_term(name)*2)] uint16 name_len;
+ [value(strlen_m_term(name)*2)] uint16 name_size;
+ [string,charset(UTF16)] uint16 *name;
+ } winreg_String;
+
+ /******************/
+ /* Function: 0x00 */
+ WERROR winreg_OpenHKCR(
+ [in] uint16 *system_name,
+ [in] winreg_AccessMask access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x01 */
+ WERROR winreg_OpenHKCU(
+ [in] uint16 *system_name,
+ [in] winreg_AccessMask access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x02 */
+ WERROR winreg_OpenHKLM(
+ [in] uint16 *system_name,
+ [in] winreg_AccessMask access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x03 */
+ WERROR winreg_OpenHKPD(
+ [in] uint16 *system_name,
+ [in] winreg_AccessMask access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x04 */
+ WERROR winreg_OpenHKU(
+ [in] uint16 *system_name,
+ [in] winreg_AccessMask access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x05 */
+ WERROR winreg_CloseKey(
+ [in,out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x06 */
+
+ typedef struct {
+ [size_is(size),length_is(len)] uint8 *data;
+ uint32 size;
+ uint32 len;
+ } KeySecurityData;
+
+ typedef struct {
+ uint32 length;
+ KeySecurityData sd;
+ boolean8 inherit;
+ } winreg_SecBuf;
+
+ typedef [v1_enum] enum {
+ REG_ACTION_NONE = 0, /* used by caller */
+ REG_CREATED_NEW_KEY = 1,
+ REG_OPENED_EXISTING_KEY = 2
+ } winreg_CreateAction;
+
+ WERROR winreg_CreateKey(
+ [in,ref] policy_handle *handle,
+ [in] winreg_String name,
+ [in] winreg_String keyclass,
+ [in] uint32 options,
+ [in] winreg_AccessMask access_mask,
+ [in,unique] winreg_SecBuf *secdesc,
+ [out,ref] policy_handle *new_handle,
+ [in,out,unique] winreg_CreateAction *action_taken
+ );
+
+ /******************/
+ /* Function: 0x07 */
+ WERROR winreg_DeleteKey(
+ [in,ref] policy_handle *handle,
+ [in] winreg_String key
+ );
+
+ /******************/
+ /* Function: 0x08 */
+ WERROR winreg_DeleteValue(
+ [in,ref] policy_handle *handle,
+ [in] winreg_String value
+ );
+
+ typedef struct {
+ [value(strlen_m_term(name)*2)] uint16 length;
+ /* size cannot be auto-set by value() as it is the
+ amount of space the server is allowed to use for this
+ string in the reply, not its current size */
+ uint16 size;
+ [size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name;
+ } winreg_StringBuf;
+
+ WERROR winreg_EnumKey(
+ [in,ref] policy_handle *handle,
+ [in] uint32 enum_index,
+ [in,out,ref] winreg_StringBuf *name,
+ [in,out,unique] winreg_StringBuf *keyclass,
+ [in,out,unique] NTTIME *last_changed_time
+ );
+
+ /******************/
+ /* Function: 0x0a */
+
+ WERROR winreg_EnumValue(
+ [in,ref] policy_handle *handle,
+ [in] uint32 enum_index,
+ [in,out,ref] winreg_StringBuf *name,
+ [in,out,unique] winreg_Type *type,
+ [in,out,unique,size_is(*size),length_is(*length)] uint8 *value,
+ [in,out,unique] uint32 *size,
+ [in,out,unique] uint32 *length
+ );
+
+ /******************/
+ /* Function: 0x0b */
+ WERROR winreg_FlushKey(
+ [in,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x0c */
+ WERROR winreg_GetKeySecurity(
+ [in,ref] policy_handle *handle,
+ [in] security_secinfo sec_info,
+ [in,out,ref] KeySecurityData *sd
+ );
+
+ /******************/
+ /* Function: 0x0d */
+ WERROR winreg_LoadKey(
+ [in,ref] policy_handle *handle,
+ [in] winreg_String *keyname,
+ [in] winreg_String *filename
+ );
+
+ /******************/
+ /* Function: 0x0e */
+ WERROR winreg_NotifyChangeKeyValue(
+ [in,ref] policy_handle *handle,
+ [in] uint8 watch_subtree,
+ [in] uint32 notify_filter,
+ [in] uint32 unknown,
+ [in] winreg_String string1,
+ [in] winreg_String string2,
+ [in] uint32 unknown2
+ );
+
+ /******************/
+ /* Function: 0x0f */
+ WERROR winreg_OpenKey(
+ [in,ref] policy_handle *parent_handle,
+ [in] winreg_String keyname,
+ [in] uint32 unknown,
+ [in] winreg_AccessMask access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x10 */
+ WERROR winreg_QueryInfoKey(
+ [in,ref] policy_handle *handle,
+ [in] winreg_String class_in,
+ [out] winreg_String *class_out,
+ [out,ref] uint32 *num_subkeys,
+ [out,ref] uint32 *max_subkeylen,
+ [out,ref] uint32 *max_subkeysize,
+ [out,ref] uint32 *num_values,
+ [out,ref] uint32 *max_valnamelen,
+ [out,ref] uint32 *max_valbufsize,
+ [out,ref] uint32 *secdescsize,
+ [out,ref] NTTIME *last_changed_time
+ );
+
+ /******************/
+ /* Function: 0x11 */
+ WERROR winreg_QueryValue(
+ [in,ref] policy_handle *handle,
+ [in] winreg_String value_name,
+ [in,out] winreg_Type *type,
+ [in,out,size_is(*size),length_is(*length)] uint8 *data,
+ [in,out] uint32 *size,
+ [in,out] uint32 *length
+ );
+
+ /******************/
+ /* Function: 0x12 */
+ WERROR winreg_ReplaceKey(
+ );
+
+ /******************/
+ /* Function: 0x13 */
+ WERROR winreg_RestoreKey(
+ );
+
+ /******************/
+ /* Function: 0x14 */
+ WERROR winreg_SaveKey(
+ );
+
+ /******************/
+ /* Function: 0x15 */
+ WERROR winreg_SetKeySecurity(
+ [in,ref] policy_handle *handle,
+ [in] winreg_AccessMask access_mask,
+ [in,out,ref] KeySecurityData *sd
+ );
+
+ /******************/
+ /* Function: 0x16 */
+ WERROR winreg_SetValue(
+ [in,ref] policy_handle *handle,
+ [in] winreg_String name,
+ [in] winreg_Type type,
+ [in,size_is(size),ref] uint8 *data,
+ [in] uint32 size
+ );
+
+ /******************/
+ /* Function: 0x17 */
+ WERROR winreg_UnLoadKey(
+ );
+
+ /******************/
+ /* Function: 0x18 */
+ WERROR winreg_InitiateSystemShutdown(
+ [in] uint16 *hostname,
+ [in] initshutdown_String *message,
+ [in] uint32 timeout,
+ [in] uint8 force_apps,
+ [in] uint8 reboot
+ );
+
+ /******************/
+ /* Function: 0x19 */
+ WERROR winreg_AbortSystemShutdown(
+ [in] uint16 *server
+ );
+
+ /******************/
+ /* Function: 0x1a */
+ WERROR winreg_GetVersion(
+ [in,ref] policy_handle *handle,
+ [out,ref] uint32 *version
+ );
+
+ /******************/
+ /* Function: 0x1b */
+ WERROR winreg_OpenHKCC(
+ [in] uint16 *system_name,
+ [in] winreg_AccessMask access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x1c */
+ WERROR winreg_OpenHKDD(
+ [in] uint16 *system_name,
+ [in] winreg_AccessMask access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ typedef struct {
+ winreg_String *name;
+ winreg_Type type;
+ uint32 offset;
+ uint32 length;
+ } QueryMultipleValue;
+
+ /******************/
+ /* Function: 0x1d */
+ WERROR winreg_QueryMultipleValues(
+ [in,ref] policy_handle *key_handle,
+ [in,out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values,
+ [in] uint32 num_values,
+ [in,out,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer,
+ [in,out,ref] uint32 *buffer_size
+ );
+
+ /******************/
+ /* Function: 0x1e */
+ WERROR winreg_InitiateSystemShutdownEx(
+ [in] uint16 *hostname,
+ [in] initshutdown_String *message,
+ [in] uint32 timeout,
+ [in] uint8 force_apps,
+ [in] uint8 reboot,
+ [in] uint32 reason
+ );
+
+ /******************/
+ /* Function: 0x1f */
+ WERROR winreg_SaveKeyEx(
+ );
+
+ /******************/
+ /* Function: 0x20 */
+ WERROR winreg_OpenHKPT(
+ [in] uint16 *system_name,
+ [in] winreg_AccessMask access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x21 */
+ WERROR winreg_OpenHKPN(
+ [in] uint16 *system_name,
+ [in] winreg_AccessMask access_mask,
+ [out,ref] policy_handle *handle
+ );
+
+ /******************/
+ /* Function: 0x22 */
+ WERROR winreg_QueryMultipleValues2(
+ );
+}
diff --git a/source3/librpc/idl/wkssvc.idl b/source3/librpc/idl/wkssvc.idl
new file mode 100644
index 0000000000..a085265a41
--- /dev/null
+++ b/source3/librpc/idl/wkssvc.idl
@@ -0,0 +1,394 @@
+/*
+ wkssvc interface definitions
+*/
+
+[ uuid("6bffd098-a112-3610-9833-46c3f87e345a"),
+ version(1.0),
+ pointer_default(unique),
+ pointer_default_top(unique),
+ helpstring("Workstation Service"),
+ depends(srvsvc),
+ keepref
+] interface wkssvc
+{
+ declare [v1_enum] enum srvsvc_PlatformId;
+
+#define BOOL uint32
+
+ /******************/
+ /* Function: 0x00 */
+
+ typedef struct {
+ srvsvc_PlatformId platform_id;
+ [string,charset(UTF16)] uint16 *server_name;
+ [string,charset(UTF16)] uint16 *domain_name;
+ uint32 version_major;
+ uint32 version_minor;
+ } wkssvc_NetWkstaInfo100;
+
+ typedef struct {
+ srvsvc_PlatformId platform_id;
+ [string,charset(UTF16)] uint16 *server_name;
+ [string,charset(UTF16)] uint16 *domain_name;
+ uint32 version_major;
+ uint32 version_minor;
+ [string,charset(UTF16)] uint16 *lan_root;
+ } wkssvc_NetWkstaInfo101;
+
+ typedef struct {
+ srvsvc_PlatformId platform_id;
+ [string,charset(UTF16)] uint16 *server_name;
+ [string,charset(UTF16)] uint16 *domain_name;
+ uint32 version_major;
+ uint32 version_minor;
+ [string,charset(UTF16)] uint16 *lan_root;
+ uint32 logged_on_users;
+ } wkssvc_NetWkstaInfo102;
+
+ typedef struct {
+ uint32 char_wait;
+ uint32 collection_time;
+ uint32 maximum_collection_count;
+ uint32 keep_connection;
+ uint32 max_commands;
+ uint32 session_timeout;
+ uint32 size_char_buf;
+ uint32 max_threads;
+ uint32 lock_quota;
+ uint32 lock_increment;
+ uint32 lock_maximum;
+ uint32 pipe_increment;
+ uint32 pipe_maximum;
+ uint32 cache_file_timeout;
+ uint32 dormant_file_limit;
+ uint32 read_ahead_throughput;
+ uint32 num_mailslot_buffers;
+ uint32 num_srv_announce_buffers;
+ uint32 max_illegal_dgram_events;
+ uint32 dgram_event_reset_freq;
+ BOOL log_election_packets;
+ BOOL use_opportunistic_locking;
+ BOOL use_unlock_behind;
+ BOOL use_close_behind;
+ BOOL buf_named_pipes;
+ BOOL use_lock_read_unlock;
+ BOOL utilize_nt_caching;
+ BOOL use_raw_read;
+ BOOL use_raw_write;
+ BOOL use_write_raw_data;
+ BOOL use_encryption;
+ BOOL buf_files_deny_write;
+ BOOL buf_read_only_files;
+ BOOL force_core_create_mode;
+ BOOL use_512_byte_max_transfer;
+ } wkssvc_NetWkstaInfo502;
+
+ typedef struct {
+ uint32 char_wait;
+ } wkssvc_NetWkstaInfo1010;
+
+ typedef struct {
+ uint32 collection_time;
+ } wkssvc_NetWkstaInfo1011;
+
+ typedef struct {
+ uint32 maximum_collection_count;
+ } wkssvc_NetWkstaInfo1012;
+
+ typedef struct {
+ uint32 keep_connection;
+ } wkssvc_NetWkstaInfo1013;
+
+ typedef struct {
+ uint32 session_timeout;
+ } wkssvc_NetWkstaInfo1018;
+
+ typedef struct {
+ uint32 size_char_buf;
+ } wkssvc_NetWkstaInfo1023;
+
+ typedef struct {
+ uint32 errorlog_sz;
+ } wkssvc_NetWkstaInfo1027;
+
+ typedef struct {
+ uint32 max_threads;
+ } wkssvc_NetWkstaInfo1033;
+
+ typedef union {
+ [case(100)] wkssvc_NetWkstaInfo100 *info100;
+ [case(101)] wkssvc_NetWkstaInfo101 *info101;
+ [case(102)] wkssvc_NetWkstaInfo102 *info102;
+ [case(502)] wkssvc_NetWkstaInfo502 *info502;
+ [case(1010)] wkssvc_NetWkstaInfo1010 *info1010;
+ [case(1011)] wkssvc_NetWkstaInfo1011 *info1011;
+ [case(1012)] wkssvc_NetWkstaInfo1012 *info1012;
+ [case(1013)] wkssvc_NetWkstaInfo1013 *info1013;
+ [case(1018)] wkssvc_NetWkstaInfo1018 *info1018;
+ [case(1023)] wkssvc_NetWkstaInfo1023 *info1023;
+ [case(1027)] wkssvc_NetWkstaInfo1027 *info1027;
+ [case(1033)] wkssvc_NetWkstaInfo1033 *info1033;
+ [default] ;
+ } wkssvc_NetWkstaInfo;
+
+ WERROR wkssvc_NetWkstaGetInfo(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] uint32 level,
+ [out,switch_is(level),ref] wkssvc_NetWkstaInfo *info
+ );
+
+
+ /******************/
+ /* Function: 0x01 */
+ WERROR wkssvc_NetWkstaSetInfo(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] uint32 level,
+ [in,switch_is(level),ref] wkssvc_NetWkstaInfo *info,
+ [in,out,ref] uint32 *parm_error
+ );
+
+
+ /*****************************/
+ /* Function 0x02 */
+ typedef struct {
+ [string,charset(UTF16)] uint16 *user;
+ } USER_INFO_0;
+
+ typedef struct {
+ uint32 entries_read;
+ [size_is(entries_read)] USER_INFO_0 *user0;
+ } USER_INFO_0_CONTAINER;
+
+ typedef struct {
+ [string,charset(UTF16)] uint16 *user_name;
+ [string,charset(UTF16)] uint16 *logon_domain;
+ [string,charset(UTF16)] uint16 *other_domains;
+ [string,charset(UTF16)] uint16 *logon_server;
+ } USER_INFO_1;
+
+ typedef struct {
+ uint32 entries_read;
+ [size_is(entries_read)] USER_INFO_1 *user1;
+ } USER_INFO_1_CONTAINER;
+
+ typedef [switch_type(uint32)] union {
+ [case(0)] USER_INFO_0_CONTAINER *user0;
+ [case(1)] USER_INFO_1_CONTAINER *user1;
+ } WKS_USER_ENUM_UNION;
+
+ WERROR wkssvc_NetWkstaEnumUsers(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] uint32 level,
+ [in] [out] [ref] WKS_USER_ENUM_UNION *users,
+ [in] uint32 prefmaxlen,
+ [out] uint32 *entriesread,
+ [out] uint32 *totalentries,
+ [in] [out] [ref] uint32 *resumehandle
+ );
+
+ /*****************************/
+ /* Function 0x03 */
+ WERROR WKSSVC_NETRWKSTAUSERGETINFO ();
+
+ /*****************************/
+ /* Function 0x04 */
+ WERROR WKSSVC_NETRWKSTAUSERSETINFO ();
+
+
+ /*****************************/
+ /* Function 0x05 */
+
+ typedef struct {
+ uint32 quality_of_service;
+ uint32 vc_count;
+ [string,charset(UTF16)] uint16 *name;
+ [string,charset(UTF16)] uint16 *address;
+ uint32 wan_link;
+ } wkssvc_NetWkstaTransportInfo0;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] wkssvc_NetWkstaTransportInfo0 *array;
+ } wkssvc_NetWkstaTransportCtr0;
+
+ typedef union {
+ [case(0)] wkssvc_NetWkstaTransportCtr0 *ctr0;
+ [default] ;
+ } wkssvc_NetWkstaTransportCtr;
+
+ WERROR wkssvc_NetWkstaTransportEnum (
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in,out] uint32 level,
+ [in,out,switch_is(level),ref] wkssvc_NetWkstaTransportCtr *ctr,
+ [in] uint32 max_buffer,
+ [out] uint32 totalentries,
+ [in,out] uint32 *resume_handle
+ );
+
+
+ /*****************************/
+ /* Function 0x06 */
+ WERROR WKSSVC_NETRWKSTATRANSPORTADD ();
+
+ /*****************************/
+ /* Function 0x07 */
+ WERROR WKSSVC_NETRWKSTATRANSPORTDEL ();
+
+ /*****************************/
+ /* Function 0x08 */
+ WERROR WKSSVC_NETRUSEADD ();
+
+ /*****************************/
+ /* Function 0x09 */
+ WERROR WKSSVC_NETRUSEGETINFO ();
+
+ /*****************************/
+ /* Function 0x0a */
+ WERROR WKSSVC_NETRUSEDEL ();
+
+ /*****************************/
+ /* Function 0x0b */
+ WERROR WKSSVC_NETRUSEENUM ();
+
+ /*****************************/
+ /* Function 0x0c */
+ WERROR WKSSVC_NETRMESSAGEBUFFERSEND ();
+
+ /*****************************/
+ /* Function 0x0d */
+ WERROR WKSSVC_NETRWORKSTATIONSTATISTICSGET ();
+
+ /*****************************/
+ /* Function 0x0e */
+ WERROR WKSSVC_NETRLOGONDOMAINNAMEADD ();
+
+ /*****************************/
+ /* Function 0x0f */
+ WERROR WKSSVC_NETRLOGONDOMAINNAMEDEL ();
+
+ /*****************************/
+ /* Function 0x10 */
+ WERROR WKSSVC_NETRJOINDOMAIN ();
+
+ /*****************************/
+ /* Function 0x11 */
+ WERROR WKSSVC_NETRUNJOINDOMAIN ();
+
+ /*****************************/
+ /* Function 0x12 */
+ WERROR WKSSVC_NETRRENAMEMACHINEINDOMAIN ();
+
+ /*****************************/
+ /* Function 0x13 */
+ WERROR WKSSVC_NETRVALIDATENAME ();
+
+ /*****************************/
+ /* Function 0x14 */
+ WERROR WKSSVC_NETRGETJOININFORMATION ();
+
+ /*****************************/
+ /* Function 0x15 */
+ WERROR WKSSVC_NETRGETJOINABLEOUS ();
+
+ typedef struct {
+ uint8 data[524];
+ } wkssvc_PasswordBuffer;
+
+ typedef [bitmap32bit] bitmap {
+ /* TRUE: defer setting the SPN and dNSHostName until a rename operation */
+ WKSSVC_JOIN_FLAGS_DEFER_SPN = 0x00000100,
+
+ /* TRUE: set the machine password to the provided one after the join completes */
+ WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED = 0x00000080,
+
+ /* TRUE: perform an unsecured join */
+ WKSSVC_JOIN_FLAGS_JOIN_UNSECURE = 0x00000040,
+
+ /* TRUE: allow the join to complete even if the account already exists */
+ WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED = 0x00000020,
+
+ /* TRUE: this join is part of a w9x upgrade */
+ WKSSVC_JOIN_FLAGS_WIN9X_UPGRADE = 0x00000010,
+
+ /* TRUE: delete the account when the domain is left */
+ WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE = 0x00000004,
+
+ /* TRUE: create the account in the domain */
+ WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE = 0x00000002,
+
+ /* TRUE: join domain FALSE: join workgroup */
+ WKSSVC_JOIN_FLAGS_JOIN_TYPE = 0x00000001
+
+ } wkssvc_joinflags;
+
+ /*****************************/
+ /* Function 0x16 */
+ WERROR wkssvc_NetrJoinDomain2 (
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in] [string,charset(UTF16),ref] uint16 *domain_name,
+ [in] [string,charset(UTF16)] uint16 *account_name,
+ [in] [string,charset(UTF16)] uint16 *admin_account,
+ [in] wkssvc_PasswordBuffer *encrypted_password,
+ [in] wkssvc_joinflags join_flags
+ );
+
+ /*****************************/
+ /* Function 0x17 */
+ WERROR wkssvc_NetrUnjoinDomain2 (
+ [in] [unique] [string,charset(UTF16)] uint16 *server_name,
+ [in] [unique] [string,charset(UTF16)] uint16 *account,
+ [in] [unique] wkssvc_PasswordBuffer *encrypted_password,
+ [in] wkssvc_joinflags unjoin_flags
+ );
+
+ typedef [bitmap32bit] bitmap {
+ /* TRUE: create the account in the domain */
+ WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE = 0x00000002
+ } wkssvc_renameflags;
+
+ /*****************************/
+ /* Function 0x18 */
+ WERROR wkssvc_NetrRenameMachineInDomain2(
+ [in] [unique] [string,charset(UTF16)] uint16 *server_name,
+ [in] [unique] [string,charset(UTF16)] uint16 *NewMachineName,
+ [in] [unique] [string,charset(UTF16)] uint16 *Account,
+ [in] [unique] wkssvc_PasswordBuffer *EncryptedPassword,
+ [in] wkssvc_renameflags RenameOptions
+ );
+
+ /*****************************/
+ /* Function 0x19 */
+ WERROR WKSSVC_NETRVALIDATENAME2 ();
+
+ /*****************************/
+ /* Function 0x1a */
+ WERROR WKSSVC_NETRGETJOINABLEOUS2 ();
+
+ /*****************************/
+ /* Function 0x1b */
+ WERROR wkssvc_NetrAddAlternateComputerName(
+ [in] [unique] [string,charset(UTF16)] uint16 *server_name,
+ [in] [unique] [string,charset(UTF16)] uint16 *NewAlternateMachineName,
+ [in] [unique] [string,charset(UTF16)] uint16 *Account,
+ [in] [unique] wkssvc_PasswordBuffer *EncryptedPassword,
+ [in] uint32 Reserved
+ );
+
+ /*****************************/
+ /* Function 0x1c */
+ WERROR wkssvc_NetrRemoveAlternateComputerName(
+ [in] [unique] [string,charset(UTF16)] uint16 *server_name,
+ [in] [unique] [string,charset(UTF16)] uint16 *AlternateMachineNameToRemove,
+ [in] [unique] [string,charset(UTF16)] uint16 *Account,
+ [in] [unique] wkssvc_PasswordBuffer *EncryptedPassword,
+ [in] uint32 Reserved
+ );
+
+ /*****************************/
+ /* Function 0x1d */
+ WERROR WKSSVC_NETRSETPRIMARYCOMPUTERNAME ();
+
+ /*****************************/
+ /* Function 0x1e */
+ WERROR WKSSVC_NETRENUMERATECOMPUTERNAMES ();
+}
diff --git a/source3/script/build_idl.sh b/source3/script/build_idl.sh
index 627ab8c8be..d24f7601df 100644
--- a/source3/script/build_idl.sh
+++ b/source3/script/build_idl.sh
@@ -8,7 +8,7 @@ cd ${srcdir}
[ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
-PIDL="$PERL pidl/pidl ${PIDL_ARGS} ${PIDL_EXTRA_ARGS}"
+PIDL="pidl ${PIDL_ARGS} ${PIDL_EXTRA_ARGS}"
##
## Find newer files rather than rebuild all of them