diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-10-27 11:57:48 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-10-27 11:57:48 +0200 |
commit | acc95a43a1a8079dc41aa1dd882bdf7dd25a6cf2 (patch) | |
tree | e7ee4e9e86288ee788968970366eaa1197ff4a33 /source3 | |
parent | 5a57da8e37d84e8aefb2f348646adae1df1eecfb (diff) | |
download | samba-acc95a43a1a8079dc41aa1dd882bdf7dd25a6cf2.tar.gz samba-acc95a43a1a8079dc41aa1dd882bdf7dd25a6cf2.tar.bz2 samba-acc95a43a1a8079dc41aa1dd882bdf7dd25a6cf2.zip |
rerun make idl
metze
(This used to be commit 83b3ecde1312092fd9875a2a8628652ffa6b6aca)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/librpc/gen_ndr/ndr_dfs.c | 28 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_echo.c | 64 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_epmapper.c | 36 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_eventlog.c | 44 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_lsa.c | 468 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_netlogon.c | 280 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_srvsvc.c | 212 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_svcctl.c | 316 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_unixinfo.c | 24 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_winreg.c | 240 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_wkssvc.c | 60 |
11 files changed, 1325 insertions, 447 deletions
diff --git a/source3/librpc/gen_ndr/ndr_dfs.c b/source3/librpc/gen_ndr/ndr_dfs.c index 959abdc62d..bc76339bc3 100644 --- a/source3/librpc/gen_ndr/ndr_dfs.c +++ b/source3/librpc/gen_ndr/ndr_dfs.c @@ -3113,7 +3113,9 @@ _PUBLIC_ NTSTATUS ndr_push_dfs_GetManagerVersion(struct ndr_push *ndr, int flags if (flags & NDR_IN) { } if (flags & NDR_OUT) { - if (r->out.version == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.version == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dfs_ManagerVersion(ndr, NDR_SCALARS, *r->out.version)); } return NT_STATUS_OK; @@ -3167,12 +3169,16 @@ _PUBLIC_ void ndr_print_dfs_GetManagerVersion(struct ndr_print *ndr, const char static NTSTATUS ndr_push_dfs_Add(struct ndr_push *ndr, int flags, const struct dfs_Add *r) { if (flags & NDR_IN) { - if (r->in.path == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.path == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.path, ndr_charset_length(r->in.path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - if (r->in.server == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.server == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16))); @@ -3309,7 +3315,9 @@ _PUBLIC_ void ndr_print_dfs_Add(struct ndr_print *ndr, const char *name, int fla static NTSTATUS ndr_push_dfs_Remove(struct ndr_push *ndr, int flags, const struct dfs_Remove *r) { if (flags & NDR_IN) { - if (r->in.dfs_entry_path == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.dfs_entry_path == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfs_entry_path, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfs_entry_path, CH_UTF16))); @@ -3451,7 +3459,9 @@ static NTSTATUS ndr_push_dfs_SetInfo(struct ndr_push *ndr, int flags, const stru NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.sharename, ndr_charset_length(r->in.sharename, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); NDR_CHECK(ndr_push_dfs_Info(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); } @@ -3592,7 +3602,9 @@ static NTSTATUS ndr_push_dfs_GetInfo(struct ndr_push *ndr, int flags, const stru NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); NDR_CHECK(ndr_push_dfs_Info(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -4552,7 +4564,9 @@ _PUBLIC_ void ndr_print_dfs_RemoveStdRoot(struct ndr_print *ndr, const char *nam static NTSTATUS ndr_push_dfs_ManagerInitialize(struct ndr_push *ndr, int flags, const struct dfs_ManagerInitialize *r) { if (flags & NDR_IN) { - if (r->in.servername == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.servername == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); diff --git a/source3/librpc/gen_ndr/ndr_echo.c b/source3/librpc/gen_ndr/ndr_echo.c index 95157fb263..b678f9209b 100644 --- a/source3/librpc/gen_ndr/ndr_echo.c +++ b/source3/librpc/gen_ndr/ndr_echo.c @@ -643,7 +643,9 @@ static NTSTATUS ndr_push_echo_AddOne(struct ndr_push *ndr, int flags, const stru NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data)); } if (flags & NDR_OUT) { - if (r->out.out_data == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.out_data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.out_data)); } return NT_STATUS_OK; @@ -862,15 +864,21 @@ _PUBLIC_ void ndr_print_echo_SourceData(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_echo_TestCall(struct ndr_push *ndr, int flags, const struct echo_TestCall *r) { if (flags & NDR_IN) { - if (r->in.s1 == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.s1 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.s1, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.s1, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.s1, ndr_charset_length(r->in.s1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { - if (r->out.s2 == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->out.s2 == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.s2 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.s2 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -953,7 +961,9 @@ static NTSTATUS ndr_push_echo_TestCall2(struct ndr_push *ndr, int flags, const s NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); NDR_CHECK(ndr_push_echo_Info(ndr, NDR_SCALARS, r->out.info)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); @@ -1059,20 +1069,32 @@ _PUBLIC_ void ndr_print_echo_TestSleep(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_echo_TestEnum(struct ndr_push *ndr, int flags, const struct echo_TestEnum *r) { if (flags & NDR_IN) { - if (r->in.foo1 == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.foo1 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, *r->in.foo1)); - if (r->in.foo2 == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.foo2 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, r->in.foo2)); - if (r->in.foo3 == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.foo3 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.foo3, *r->in.foo1)); NDR_CHECK(ndr_push_echo_Enum3(ndr, NDR_SCALARS, r->in.foo3)); } if (flags & NDR_OUT) { - if (r->out.foo1 == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.foo1 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, *r->out.foo1)); - if (r->out.foo2 == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.foo2 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, r->out.foo2)); - if (r->out.foo3 == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.foo3 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.foo3, *r->out.foo1)); NDR_CHECK(ndr_push_echo_Enum3(ndr, NDR_SCALARS, r->out.foo3)); } @@ -1192,11 +1214,15 @@ _PUBLIC_ void ndr_print_echo_TestEnum(struct ndr_print *ndr, const char *name, i static NTSTATUS ndr_push_echo_TestSurrounding(struct ndr_push *ndr, int flags, const struct echo_TestSurrounding *r) { if (flags & NDR_IN) { - if (r->in.data == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_echo_Surrounding(ndr, NDR_SCALARS, r->in.data)); } if (flags & NDR_OUT) { - if (r->out.data == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_echo_Surrounding(ndr, NDR_SCALARS, r->out.data)); } return NT_STATUS_OK; @@ -1261,10 +1287,16 @@ _PUBLIC_ void ndr_print_echo_TestSurrounding(struct ndr_print *ndr, const char * static NTSTATUS ndr_push_echo_TestDoublePointer(struct ndr_push *ndr, int flags, const struct echo_TestDoublePointer *r) { if (flags & NDR_IN) { - if (r->in.data == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->in.data == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->in.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); - if (**r->in.data == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (**r->in.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ***r->in.data)); } diff --git a/source3/librpc/gen_ndr/ndr_epmapper.c b/source3/librpc/gen_ndr/ndr_epmapper.c index 43e26e8558..3ca7162014 100644 --- a/source3/librpc/gen_ndr/ndr_epmapper.c +++ b/source3/librpc/gen_ndr/ndr_epmapper.c @@ -1962,14 +1962,20 @@ static NTSTATUS ndr_push_epm_Lookup(struct ndr_push *ndr, int flags, const struc NDR_CHECK(ndr_push_rpc_if_id_t(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.interface_id)); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.vers_option)); - if (r->in.entry_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.entry_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.entry_handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_ents)); } if (flags & NDR_OUT) { - if (r->out.entry_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.entry_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.entry_handle)); - if (r->out.num_ents == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.num_ents == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ents)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_ents)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -2150,14 +2156,20 @@ _PUBLIC_ NTSTATUS ndr_push_epm_Map(struct ndr_push *ndr, int flags, const struct if (r->in.map_tower) { NDR_CHECK(ndr_push_epm_twr_t(ndr, NDR_SCALARS, r->in.map_tower)); } - if (r->in.entry_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.entry_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.entry_handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_towers)); } if (flags & NDR_OUT) { - if (r->out.entry_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.entry_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.entry_handle)); - if (r->out.num_towers == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.num_towers == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_towers)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_towers)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -2325,11 +2337,15 @@ _PUBLIC_ void ndr_print_epm_Map(struct ndr_print *ndr, const char *name, int fla static NTSTATUS ndr_push_epm_LookupHandleFree(struct ndr_push *ndr, int flags, const struct epm_LookupHandleFree *r) { if (flags & NDR_IN) { - if (r->in.entry_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.entry_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.entry_handle)); } if (flags & NDR_OUT) { - if (r->out.entry_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.entry_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.entry_handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); } @@ -2397,7 +2413,9 @@ _PUBLIC_ void ndr_print_epm_LookupHandleFree(struct ndr_print *ndr, const char * static NTSTATUS ndr_push_epm_InqObject(struct ndr_push *ndr, int flags, const struct epm_InqObject *r) { if (flags & NDR_IN) { - if (r->in.epm_object == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.epm_object == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.epm_object)); } if (flags & NDR_OUT) { diff --git a/source3/librpc/gen_ndr/ndr_eventlog.c b/source3/librpc/gen_ndr/ndr_eventlog.c index 42a846caca..7b4f701084 100644 --- a/source3/librpc/gen_ndr/ndr_eventlog.c +++ b/source3/librpc/gen_ndr/ndr_eventlog.c @@ -190,7 +190,9 @@ _PUBLIC_ void ndr_print_eventlog_Record(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_eventlog_ClearEventLogW(struct ndr_push *ndr, int flags, const struct eventlog_ClearEventLogW *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown)); if (r->in.unknown) { @@ -310,11 +312,15 @@ _PUBLIC_ void ndr_print_eventlog_BackupEventLogW(struct ndr_print *ndr, const ch static NTSTATUS ndr_push_eventlog_CloseEventLog(struct ndr_push *ndr, int flags, const struct eventlog_CloseEventLog *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -423,11 +429,15 @@ _PUBLIC_ void ndr_print_eventlog_DeregisterEventSource(struct ndr_print *ndr, co static NTSTATUS ndr_push_eventlog_GetNumRecords(struct ndr_push *ndr, int flags, const struct eventlog_GetNumRecords *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { - if (r->out.number == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.number == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.number)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -588,7 +598,9 @@ static NTSTATUS ndr_push_eventlog_OpenEventLogW(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown3)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -755,19 +767,27 @@ _PUBLIC_ void ndr_print_eventlog_OpenBackupEventLogW(struct ndr_print *ndr, cons static NTSTATUS ndr_push_eventlog_ReadEventLogW(struct ndr_push *ndr, int flags, const struct eventlog_ReadEventLogW *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offset)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.number_of_bytes)); } if (flags & NDR_OUT) { - if (r->out.data == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.number_of_bytes)); NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.number_of_bytes)); - if (r->out.sent_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sent_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sent_size)); - if (r->out.real_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.real_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.real_size)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -1362,7 +1382,9 @@ _PUBLIC_ void ndr_print_eventlog_GetLogIntormation(struct ndr_print *ndr, const static NTSTATUS ndr_push_eventlog_FlushEventLog(struct ndr_push *ndr, int flags, const struct eventlog_FlushEventLog *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { diff --git a/source3/librpc/gen_ndr/ndr_lsa.c b/source3/librpc/gen_ndr/ndr_lsa.c index 2b830ae97d..12e1ea5f00 100644 --- a/source3/librpc/gen_ndr/ndr_lsa.c +++ b/source3/librpc/gen_ndr/ndr_lsa.c @@ -3995,11 +3995,15 @@ _PUBLIC_ void ndr_print_lsa_TransSidArray3(struct ndr_print *ndr, const char *na static NTSTATUS ndr_push_lsa_Close(struct ndr_push *ndr, int flags, const struct lsa_Close *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -4067,7 +4071,9 @@ _PUBLIC_ void ndr_print_lsa_Close(struct ndr_print *ndr, const char *name, int f static NTSTATUS ndr_push_lsa_Delete(struct ndr_push *ndr, int flags, const struct lsa_Delete *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { @@ -4122,16 +4128,24 @@ _PUBLIC_ void ndr_print_lsa_Delete(struct ndr_print *ndr, const char *name, int static NTSTATUS ndr_push_lsa_EnumPrivs(struct ndr_push *ndr, int flags, const struct lsa_EnumPrivs *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_count)); } if (flags & NDR_OUT) { - if (r->out.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - if (r->out.privs == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.privs == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_PrivArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.privs)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -4227,7 +4241,9 @@ _PUBLIC_ void ndr_print_lsa_EnumPrivs(struct ndr_print *ndr, const char *name, i static NTSTATUS ndr_push_lsa_QuerySecurity(struct ndr_push *ndr, int flags, const struct lsa_QuerySecurity *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); } @@ -4397,12 +4413,16 @@ static NTSTATUS ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, int flags, const s if (r->in.system_name) { NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); } - if (r->in.attr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.attr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_ObjectAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.attr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -4493,7 +4513,9 @@ _PUBLIC_ void ndr_print_lsa_OpenPolicy(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_lsa_QueryInfoPolicy(struct ndr_push *ndr, int flags, const struct lsa_QueryInfoPolicy *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); } @@ -4662,14 +4684,20 @@ _PUBLIC_ void ndr_print_lsa_ClearAuditLog(struct ndr_print *ndr, const char *nam static NTSTATUS ndr_push_lsa_CreateAccount(struct ndr_push *ndr, int flags, const struct lsa_CreateAccount *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.acct_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.acct_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.acct_handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -4752,16 +4780,24 @@ _PUBLIC_ void ndr_print_lsa_CreateAccount(struct ndr_print *ndr, const char *nam static NTSTATUS ndr_push_lsa_EnumAccounts(struct ndr_push *ndr, int flags, const struct lsa_EnumAccounts *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_entries)); } if (flags & NDR_OUT) { - if (r->out.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - if (r->out.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -4860,14 +4896,20 @@ _PUBLIC_ void ndr_print_lsa_EnumAccounts(struct ndr_print *ndr, const char *name static NTSTATUS ndr_push_lsa_CreateTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomain *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.trustdom_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.trustdom_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trustdom_handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -4950,16 +4992,24 @@ _PUBLIC_ void ndr_print_lsa_CreateTrustedDomain(struct ndr_print *ndr, const cha static NTSTATUS ndr_push_lsa_EnumTrustDom(struct ndr_push *ndr, int flags, const struct lsa_EnumTrustDom *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_size)); } if (flags & NDR_OUT) { - if (r->out.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - if (r->out.domains == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_DomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -5059,7 +5109,9 @@ static NTSTATUS ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flags, const { uint32_t cntr_names_0; if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); @@ -5069,10 +5121,14 @@ static NTSTATUS ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flags, const for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); } - if (r->in.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransSidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); } if (flags & NDR_OUT) { @@ -5080,9 +5136,13 @@ static NTSTATUS ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flags, const if (r->out.domains) { NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); } - if (r->out.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransSidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -5242,14 +5302,22 @@ _PUBLIC_ void ndr_print_lsa_LookupNames(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_lsa_LookupSids(struct ndr_push *ndr, int flags, const struct lsa_LookupSids *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - if (r->in.names == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.names == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransNameArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.names)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); } if (flags & NDR_OUT) { @@ -5257,9 +5325,13 @@ static NTSTATUS ndr_push_lsa_LookupSids(struct ndr_push *ndr, int flags, const s if (r->out.domains) { NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); } - if (r->out.names == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.names == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransNameArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); - if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -5398,13 +5470,17 @@ _PUBLIC_ void ndr_print_lsa_LookupSids(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_lsa_CreateSecret(struct ndr_push *ndr, int flags, const struct lsa_CreateSecret *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.sec_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sec_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sec_handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -5477,14 +5553,20 @@ _PUBLIC_ void ndr_print_lsa_CreateSecret(struct ndr_print *ndr, const char *name static NTSTATUS ndr_push_lsa_OpenAccount(struct ndr_push *ndr, int flags, const struct lsa_OpenAccount *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.acct_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.acct_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.acct_handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -5567,7 +5649,9 @@ _PUBLIC_ void ndr_print_lsa_OpenAccount(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_lsa_EnumPrivsAccount(struct ndr_push *ndr, int flags, const struct lsa_EnumPrivsAccount *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { @@ -5648,9 +5732,13 @@ _PUBLIC_ void ndr_print_lsa_EnumPrivsAccount(struct ndr_print *ndr, const char * static NTSTATUS ndr_push_lsa_AddPrivilegesToAccount(struct ndr_push *ndr, int flags, const struct lsa_AddPrivilegesToAccount *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.privs == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.privs == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_PrivilegeSet(ndr, NDR_SCALARS, r->in.privs)); } if (flags & NDR_OUT) { @@ -5717,7 +5805,9 @@ _PUBLIC_ void ndr_print_lsa_AddPrivilegesToAccount(struct ndr_print *ndr, const static NTSTATUS ndr_push_lsa_RemovePrivilegesFromAccount(struct ndr_push *ndr, int flags, const struct lsa_RemovePrivilegesFromAccount *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.remove_all)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.privs)); @@ -5963,14 +6053,20 @@ _PUBLIC_ void ndr_print_lsa_SetSystemAccessAccount(struct ndr_print *ndr, const static NTSTATUS ndr_push_lsa_OpenTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_OpenTrustedDomain *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.trustdom_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.trustdom_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trustdom_handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -6053,7 +6149,9 @@ _PUBLIC_ void ndr_print_lsa_OpenTrustedDomain(struct ndr_print *ndr, const char static NTSTATUS ndr_push_lsa_QueryTrustedDomainInfo(struct ndr_push *ndr, int flags, const struct lsa_QueryTrustedDomainInfo *r) { if (flags & NDR_IN) { - if (r->in.trustdom_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.trustdom_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.trustdom_handle)); NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); } @@ -6181,13 +6279,17 @@ _PUBLIC_ void ndr_print_lsa_SetInformationTrustedDomain(struct ndr_print *ndr, c static NTSTATUS ndr_push_lsa_OpenSecret(struct ndr_push *ndr, int flags, const struct lsa_OpenSecret *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.sec_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sec_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sec_handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -6260,7 +6362,9 @@ _PUBLIC_ void ndr_print_lsa_OpenSecret(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_lsa_SetSecret(struct ndr_push *ndr, int flags, const struct lsa_SetSecret *r) { if (flags & NDR_IN) { - if (r->in.sec_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sec_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sec_handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_val)); if (r->in.new_val) { @@ -6363,7 +6467,9 @@ _PUBLIC_ void ndr_print_lsa_SetSecret(struct ndr_print *ndr, const char *name, i static NTSTATUS ndr_push_lsa_QuerySecret(struct ndr_push *ndr, int flags, const struct lsa_QuerySecret *r) { if (flags & NDR_IN) { - if (r->in.sec_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sec_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sec_handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_val)); if (r->in.new_val) { @@ -6604,13 +6710,19 @@ _PUBLIC_ void ndr_print_lsa_QuerySecret(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_lsa_LookupPrivValue(struct ndr_push *ndr, int flags, const struct lsa_LookupPrivValue *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); } if (flags & NDR_OUT) { - if (r->out.luid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.luid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_LUID(ndr, NDR_SCALARS, r->out.luid)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -6691,9 +6803,13 @@ _PUBLIC_ void ndr_print_lsa_LookupPrivValue(struct ndr_print *ndr, const char *n static NTSTATUS ndr_push_lsa_LookupPrivName(struct ndr_push *ndr, int flags, const struct lsa_LookupPrivName *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.luid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.luid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_LUID(ndr, NDR_SCALARS, r->in.luid)); } if (flags & NDR_OUT) { @@ -6786,11 +6902,17 @@ _PUBLIC_ void ndr_print_lsa_LookupPrivName(struct ndr_print *ndr, const char *na static NTSTATUS ndr_push_lsa_LookupPrivDisplayName(struct ndr_push *ndr, int flags, const struct lsa_LookupPrivDisplayName *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - if (r->in.language_id == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.language_id == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.language_id)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.unknown)); } @@ -6799,7 +6921,9 @@ static NTSTATUS ndr_push_lsa_LookupPrivDisplayName(struct ndr_push *ndr, int fla if (r->out.disp_name) { NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.disp_name)); } - if (r->out.language_id == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.language_id == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->out.language_id)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -6954,7 +7078,9 @@ _PUBLIC_ void ndr_print_lsa_DeleteObject(struct ndr_print *ndr, const char *name static NTSTATUS ndr_push_lsa_EnumAccountsWithUserRight(struct ndr_push *ndr, int flags, const struct lsa_EnumAccountsWithUserRight *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.name)); if (r->in.name) { @@ -6962,7 +7088,9 @@ static NTSTATUS ndr_push_lsa_EnumAccountsWithUserRight(struct ndr_push *ndr, int } } if (flags & NDR_OUT) { - if (r->out.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -7051,13 +7179,19 @@ _PUBLIC_ void ndr_print_lsa_EnumAccountsWithUserRight(struct ndr_print *ndr, con static NTSTATUS ndr_push_lsa_EnumAccountRights(struct ndr_push *ndr, int flags, const struct lsa_EnumAccountRights *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); } if (flags & NDR_OUT) { - if (r->out.rights == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.rights == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_RightSet(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rights)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -7138,11 +7272,17 @@ _PUBLIC_ void ndr_print_lsa_EnumAccountRights(struct ndr_print *ndr, const char static NTSTATUS ndr_push_lsa_AddAccountRights(struct ndr_push *ndr, int flags, const struct lsa_AddAccountRights *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - if (r->in.rights == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.rights == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_RightSet(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.rights)); } if (flags & NDR_OUT) { @@ -7221,12 +7361,18 @@ _PUBLIC_ void ndr_print_lsa_AddAccountRights(struct ndr_print *ndr, const char * static NTSTATUS ndr_push_lsa_RemoveAccountRights(struct ndr_push *ndr, int flags, const struct lsa_RemoveAccountRights *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); - if (r->in.rights == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.rights == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_RightSet(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.rights)); } if (flags & NDR_OUT) { @@ -7307,9 +7453,13 @@ _PUBLIC_ void ndr_print_lsa_RemoveAccountRights(struct ndr_print *ndr, const cha static NTSTATUS ndr_push_lsa_QueryTrustedDomainInfoBySid(struct ndr_push *ndr, int flags, const struct lsa_QueryTrustedDomainInfoBySid *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.dom_sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.dom_sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dom_sid)); NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); } @@ -7449,9 +7599,13 @@ _PUBLIC_ void ndr_print_lsa_SetTrustedDomainInfo(struct ndr_print *ndr, const ch static NTSTATUS ndr_push_lsa_DeleteTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_DeleteTrustedDomain *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.dom_sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.dom_sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dom_sid)); } if (flags & NDR_OUT) { @@ -7607,12 +7761,16 @@ static NTSTATUS ndr_push_lsa_OpenPolicy2(struct ndr_push *ndr, int flags, const NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.system_name, ndr_charset_length(r->in.system_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.attr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.attr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_ObjectAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.attr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -7877,7 +8035,9 @@ _PUBLIC_ void ndr_print_lsa_GetUserName(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_lsa_QueryInfoPolicy2(struct ndr_push *ndr, int flags, const struct lsa_QueryInfoPolicy2 *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); } @@ -8005,7 +8165,9 @@ _PUBLIC_ void ndr_print_lsa_SetInfoPolicy2(struct ndr_print *ndr, const char *na static NTSTATUS ndr_push_lsa_QueryTrustedDomainInfoByName(struct ndr_push *ndr, int flags, const struct lsa_QueryTrustedDomainInfoByName *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.trusted_domain)); NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); @@ -8095,7 +8257,9 @@ _PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfoByName(struct ndr_print *ndr, static NTSTATUS ndr_push_lsa_SetTrustedDomainInfoByName(struct ndr_push *ndr, int flags, const struct lsa_SetTrustedDomainInfoByName *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.trusted_domain)); NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); @@ -8183,16 +8347,24 @@ _PUBLIC_ void ndr_print_lsa_SetTrustedDomainInfoByName(struct ndr_print *ndr, co static NTSTATUS ndr_push_lsa_EnumTrustedDomainsEx(struct ndr_push *ndr, int flags, const struct lsa_EnumTrustedDomainsEx *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_size)); } if (flags & NDR_OUT) { - if (r->out.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - if (r->out.domains == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_DomainListEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8329,11 +8501,15 @@ _PUBLIC_ void ndr_print_lsa_CreateTrustedDomainEx(struct ndr_print *ndr, const c static NTSTATUS ndr_push_lsa_CloseTrustedDomainEx(struct ndr_push *ndr, int flags, const struct lsa_CloseTrustedDomainEx *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8401,7 +8577,9 @@ _PUBLIC_ void ndr_print_lsa_CloseTrustedDomainEx(struct ndr_print *ndr, const ch static NTSTATUS ndr_push_lsa_QueryDomainInformationPolicy(struct ndr_push *ndr, int flags, const struct lsa_QueryDomainInformationPolicy *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); } @@ -8488,7 +8666,9 @@ _PUBLIC_ void ndr_print_lsa_QueryDomainInformationPolicy(struct ndr_print *ndr, static NTSTATUS ndr_push_lsa_SetDomainInformationPolicy(struct ndr_push *ndr, int flags, const struct lsa_SetDomainInformationPolicy *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); @@ -8573,13 +8753,17 @@ _PUBLIC_ void ndr_print_lsa_SetDomainInformationPolicy(struct ndr_print *ndr, co static NTSTATUS ndr_push_lsa_OpenTrustedDomainByName(struct ndr_push *ndr, int flags, const struct lsa_OpenTrustedDomainByName *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.trustdom_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.trustdom_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trustdom_handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8693,14 +8877,22 @@ _PUBLIC_ void ndr_print_lsa_TestCall(struct ndr_print *ndr, const char *name, in static NTSTATUS ndr_push_lsa_LookupSids2(struct ndr_push *ndr, int flags, const struct lsa_LookupSids2 *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - if (r->in.names == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.names == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.names)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); @@ -8710,9 +8902,13 @@ static NTSTATUS ndr_push_lsa_LookupSids2(struct ndr_push *ndr, int flags, const if (r->out.domains) { NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); } - if (r->out.names == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.names == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); - if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8856,7 +9052,9 @@ static NTSTATUS ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int flags, const { uint32_t cntr_names_0; if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); @@ -8866,10 +9064,14 @@ static NTSTATUS ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int flags, const for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); } - if (r->in.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransSidArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); @@ -8879,9 +9081,13 @@ static NTSTATUS ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int flags, const if (r->out.domains) { NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); } - if (r->out.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransSidArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -9415,7 +9621,9 @@ static NTSTATUS ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int flags, const { uint32_t cntr_names_0; if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); @@ -9425,10 +9633,14 @@ static NTSTATUS ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int flags, const for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); } - if (r->in.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); @@ -9438,9 +9650,13 @@ static NTSTATUS ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int flags, const if (r->out.domains) { NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); } - if (r->out.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -9891,12 +10107,18 @@ _PUBLIC_ void ndr_print_lsa_CREDRRENAME(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_lsa_LookupSids3(struct ndr_push *ndr, int flags, const struct lsa_LookupSids3 *r) { if (flags & NDR_IN) { - if (r->in.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - if (r->in.names == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.names == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.names)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); @@ -9906,9 +10128,13 @@ static NTSTATUS ndr_push_lsa_LookupSids3(struct ndr_push *ndr, int flags, const if (r->out.domains) { NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); } - if (r->out.names == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.names == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); - if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -10048,10 +10274,14 @@ static NTSTATUS ndr_push_lsa_LookupNames4(struct ndr_push *ndr, int flags, const for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); } - if (r->in.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); @@ -10061,9 +10291,13 @@ static NTSTATUS ndr_push_lsa_LookupNames4(struct ndr_push *ndr, int flags, const if (r->out.domains) { NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); } - if (r->out.sids == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } diff --git a/source3/librpc/gen_ndr/ndr_netlogon.c b/source3/librpc/gen_ndr/ndr_netlogon.c index 116afd17f8..ec237fa883 100644 --- a/source3/librpc/gen_ndr/ndr_netlogon.c +++ b/source3/librpc/gen_ndr/ndr_netlogon.c @@ -7517,7 +7517,9 @@ static NTSTATUS ndr_push_netr_LogonUasLogoff(struct ndr_push *ndr, int flags, co NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.workstation, ndr_charset_length(r->in.workstation, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_UasLogoffInfo(ndr, NDR_SCALARS, r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -7648,10 +7650,14 @@ static NTSTATUS ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int flags, con if (r->out.return_authenticator) { NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); } - if (r->out.validation == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.validation == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.validation, r->in.validation_level)); NDR_CHECK(ndr_push_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation)); - if (r->out.authoritative == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.authoritative == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.authoritative)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8041,11 +8047,15 @@ static NTSTATUS ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, int flags NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - if (r->in.credentials == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.credentials == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); } if (flags & NDR_OUT) { - if (r->out.credentials == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.credentials == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.credentials)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8163,11 +8173,15 @@ static NTSTATUS ndr_push_netr_ServerAuthenticate(struct ndr_push *ndr, int flags NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - if (r->in.credentials == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.credentials == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); } if (flags & NDR_OUT) { - if (r->out.credentials == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.credentials == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.credentials)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8299,7 +8313,9 @@ static NTSTATUS ndr_push_netr_ServerPasswordSet(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.new_password)); } if (flags & NDR_OUT) { - if (r->out.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8413,17 +8429,25 @@ static NTSTATUS ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int flags, co NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); - if (r->in.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->in.database_id)); - if (r->in.sequence_num == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sequence_num == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->in.sequence_num)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.preferredmaximumlength)); } if (flags & NDR_OUT) { - if (r->out.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - if (r->out.sequence_num == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sequence_num == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->out.sequence_num)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array)); if (r->out.delta_enum_array) { @@ -8571,17 +8595,25 @@ static NTSTATUS ndr_push_netr_DatabaseSync(struct ndr_push *ndr, int flags, cons NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); - if (r->in.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->in.database_id)); - if (r->in.sync_context == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sync_context == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.sync_context)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.preferredmaximumlength)); } if (flags & NDR_OUT) { - if (r->out.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - if (r->out.sync_context == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sync_context == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array)); if (r->out.delta_enum_array) { @@ -8732,7 +8764,9 @@ static NTSTATUS ndr_push_netr_AccountDeltas(struct ndr_push *ndr, int flags, con NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); - if (r->in.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, &r->in.uas)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); @@ -8740,20 +8774,30 @@ static NTSTATUS ndr_push_netr_AccountDeltas(struct ndr_push *ndr, int flags, con NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffersize)); } if (flags & NDR_OUT) { - if (r->out.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - if (r->out.buffer == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } { struct ndr_push *_ndr_buffer; NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_buffer, 4, -1)); NDR_CHECK(ndr_push_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer)); NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_buffer, 4, -1)); } - if (r->out.count_returned == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count_returned == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count_returned)); - if (r->out.total_entries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.total_entries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_entries)); - if (r->out.recordid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.recordid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8938,31 +8982,47 @@ static NTSTATUS ndr_push_netr_AccountSync(struct ndr_push *ndr, int flags, const NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); - if (r->in.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reference)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffersize)); - if (r->in.recordid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.recordid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->in.recordid)); } if (flags & NDR_OUT) { - if (r->out.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - if (r->out.buffer == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } { struct ndr_push *_ndr_buffer; NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_buffer, 4, -1)); NDR_CHECK(ndr_push_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer)); NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_buffer, 4, -1)); } - if (r->out.count_returned == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count_returned == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count_returned)); - if (r->out.total_entries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.total_entries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_entries)); - if (r->out.next_reference == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.next_reference == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.next_reference)); - if (r->out.recordid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.recordid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -9171,8 +9231,12 @@ static NTSTATUS ndr_push_netr_GetDcName(struct ndr_push *ndr, int flags, const s } } if (flags & NDR_OUT) { - if (r->out.dcname == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->out.dcname == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.dcname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.dcname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -9289,7 +9353,9 @@ static NTSTATUS ndr_push_netr_LogonControl(struct ndr_push *ndr, int flags, cons NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -9395,8 +9461,12 @@ static NTSTATUS ndr_push_netr_GetAnyDCName(struct ndr_push *ndr, int flags, cons } } if (flags & NDR_OUT) { - if (r->out.dcname == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->out.dcname == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.dcname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.dcname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -9533,7 +9603,9 @@ static NTSTATUS ndr_push_netr_LogonControl2(struct ndr_push *ndr, int flags, con NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.data)); } if (flags & NDR_OUT) { - if (r->out.query == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.query == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.query, r->in.level)); NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -9643,15 +9715,23 @@ static NTSTATUS ndr_push_netr_ServerAuthenticate2(struct ndr_push *ndr, int flag NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - if (r->in.credentials == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.credentials == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); - if (r->in.negotiate_flags == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.negotiate_flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.negotiate_flags)); } if (flags & NDR_OUT) { - if (r->out.credentials == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.credentials == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.credentials)); - if (r->out.negotiate_flags == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.negotiate_flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.negotiate_flags)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -9797,18 +9877,26 @@ static NTSTATUS ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int flags, con NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); - if (r->in.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->in.database_id)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.restart_state)); - if (r->in.sync_context == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sync_context == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.sync_context)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.preferredmaximumlength)); } if (flags & NDR_OUT) { - if (r->out.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - if (r->out.sync_context == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sync_context == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array)); if (r->out.delta_enum_array) { @@ -9958,7 +10046,9 @@ static NTSTATUS ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int flags, cons NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); - if (r->in.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.change_log_entry)); if (r->in.change_log_entry) { @@ -9968,7 +10058,9 @@ static NTSTATUS ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int flags, cons NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.change_log_entry_size)); } if (flags & NDR_OUT) { - if (r->out.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array)); if (r->out.delta_enum_array) { @@ -10118,7 +10210,9 @@ static NTSTATUS ndr_push_netr_LogonControl2Ex(struct ndr_push *ndr, int flags, c NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.data)); } if (flags & NDR_OUT) { - if (r->out.query == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.query == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.query, r->in.level)); NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -10658,17 +10752,27 @@ static NTSTATUS ndr_push_netr_ServerAuthenticate3(struct ndr_push *ndr, int flag NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - if (r->in.credentials == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.credentials == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); - if (r->in.negotiate_flags == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.negotiate_flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.negotiate_flags)); } if (flags & NDR_OUT) { - if (r->out.credentials == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.credentials == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.credentials)); - if (r->out.negotiate_flags == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.negotiate_flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.negotiate_flags)); - if (r->out.rid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.rid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -11021,8 +11125,12 @@ static NTSTATUS ndr_push_netr_DsRGetSiteName(struct ndr_push *ndr, int flags, co } } if (flags & NDR_OUT) { - if (r->out.site == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->out.site == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.site == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.site == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -11131,18 +11239,26 @@ static NTSTATUS ndr_push_netr_LogonGetDomainInfo(struct ndr_push *ndr, int flags NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.credential == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.credential == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - if (r->in.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.query, r->in.level)); NDR_CHECK(ndr_push_netr_DomainQuery(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.query)); } if (flags & NDR_OUT) { - if (r->out.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); NDR_CHECK(ndr_push_netr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); @@ -11299,7 +11415,9 @@ static NTSTATUS ndr_push_netr_ServerPasswordSet2(struct ndr_push *ndr, int flags NDR_CHECK(ndr_push_netr_CryptPassword(ndr, NDR_SCALARS, &r->in.new_password)); } if (flags & NDR_OUT) { - if (r->out.return_authenticator == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -11938,16 +12056,24 @@ static NTSTATUS ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int flags, c NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.logon, r->in.logon_level)); NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level)); - if (r->in.flags == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.flags)); } if (flags & NDR_OUT) { - if (r->out.validation == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.validation == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.validation, r->in.validation_level)); NDR_CHECK(ndr_push_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation)); - if (r->out.authoritative == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.authoritative == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.authoritative)); - if (r->out.flags == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.flags)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -12116,12 +12242,18 @@ static NTSTATUS ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push *ndr, int NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->in.trust_flags)); } if (flags & NDR_OUT) { - if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); - if (r->out.trusts == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.trusts == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count)); for (cntr_trusts_1 = 0; cntr_trusts_1 < r->out.count; cntr_trusts_1++) { - if (r->out.trusts[cntr_trusts_1] == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.trusts[cntr_trusts_1] == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); } for (cntr_trusts_1 = 0; cntr_trusts_1 < r->out.count; cntr_trusts_1++) { @@ -12446,7 +12578,9 @@ static NTSTATUS ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push *ndr, int f NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.logon, r->in.logon_level)); NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level)); - if (r->in.flags == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.flags)); } if (flags & NDR_OUT) { @@ -12454,12 +12588,18 @@ static NTSTATUS ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push *ndr, int f if (r->out.return_authenticator) { NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); } - if (r->out.validation == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.validation == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.validation, r->in.validation_level)); NDR_CHECK(ndr_push_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation)); - if (r->out.authoritative == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.authoritative == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.authoritative)); - if (r->out.flags == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.flags)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } diff --git a/source3/librpc/gen_ndr/ndr_srvsvc.c b/source3/librpc/gen_ndr/ndr_srvsvc.c index e4fe6f6392..8bcb04c7ba 100644 --- a/source3/librpc/gen_ndr/ndr_srvsvc.c +++ b/source3/librpc/gen_ndr/ndr_srvsvc.c @@ -12976,9 +12976,13 @@ static NTSTATUS ndr_push_srvsvc_NetCharDevEnum(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_unc, ndr_charset_length(r->in.server_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level)); - if (r->in.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, *r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); @@ -12988,12 +12992,18 @@ static NTSTATUS ndr_push_srvsvc_NetCharDevEnum(struct ndr_push *ndr, int flags, } } if (flags & NDR_OUT) { - if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level)); - if (r->out.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level)); NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - if (r->out.totalentries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.totalentries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { @@ -13188,7 +13198,9 @@ static NTSTATUS ndr_push_srvsvc_NetCharDevGetInfo(struct ndr_push *ndr, int flag NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -13387,9 +13399,13 @@ static NTSTATUS ndr_push_srvsvc_NetCharDevQEnum(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.user, ndr_charset_length(r->in.user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level)); - if (r->in.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, *r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); @@ -13399,12 +13415,18 @@ static NTSTATUS ndr_push_srvsvc_NetCharDevQEnum(struct ndr_push *ndr, int flags, } } if (flags & NDR_OUT) { - if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level)); - if (r->out.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level)); NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - if (r->out.totalentries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.totalentries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { @@ -13629,7 +13651,9 @@ static NTSTATUS ndr_push_srvsvc_NetCharDevQGetInfo(struct ndr_push *ndr, int fla NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -14074,9 +14098,13 @@ static NTSTATUS ndr_push_srvsvc_NetConnEnum(struct ndr_push *ndr, int flags, con NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.path, ndr_charset_length(r->in.path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level)); - if (r->in.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, *r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetConnCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); @@ -14086,12 +14114,18 @@ static NTSTATUS ndr_push_srvsvc_NetConnEnum(struct ndr_push *ndr, int flags, con } } if (flags & NDR_OUT) { - if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level)); - if (r->out.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level)); NDR_CHECK(ndr_push_srvsvc_NetConnCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - if (r->out.totalentries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.totalentries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { @@ -14319,9 +14353,13 @@ static NTSTATUS ndr_push_srvsvc_NetFileEnum(struct ndr_push *ndr, int flags, con NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.user, ndr_charset_length(r->in.user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level)); - if (r->in.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, *r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetFileCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); @@ -14331,12 +14369,18 @@ static NTSTATUS ndr_push_srvsvc_NetFileEnum(struct ndr_push *ndr, int flags, con } } if (flags & NDR_OUT) { - if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level)); - if (r->out.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level)); NDR_CHECK(ndr_push_srvsvc_NetFileCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - if (r->out.totalentries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.totalentries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { @@ -14580,7 +14624,9 @@ static NTSTATUS ndr_push_srvsvc_NetFileGetInfo(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetFileInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -14768,9 +14814,13 @@ static NTSTATUS ndr_push_srvsvc_NetSessEnum(struct ndr_push *ndr, int flags, con NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.user, ndr_charset_length(r->in.user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level)); - if (r->in.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, *r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetSessCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); @@ -14780,12 +14830,18 @@ static NTSTATUS ndr_push_srvsvc_NetSessEnum(struct ndr_push *ndr, int flags, con } } if (flags & NDR_OUT) { - if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level)); - if (r->out.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level)); NDR_CHECK(ndr_push_srvsvc_NetSessCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - if (r->out.totalentries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.totalentries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { @@ -15296,9 +15352,13 @@ static NTSTATUS ndr_push_srvsvc_NetShareEnumAll(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_unc, ndr_charset_length(r->in.server_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level)); - if (r->in.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, *r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetShareCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); @@ -15308,12 +15368,18 @@ static NTSTATUS ndr_push_srvsvc_NetShareEnumAll(struct ndr_push *ndr, int flags, } } if (flags & NDR_OUT) { - if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level)); - if (r->out.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level)); NDR_CHECK(ndr_push_srvsvc_NetShareCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - if (r->out.totalentries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.totalentries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { @@ -15508,7 +15574,9 @@ static NTSTATUS ndr_push_srvsvc_NetShareGetInfo(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -15938,7 +16006,9 @@ static NTSTATUS ndr_push_srvsvc_NetShareCheck(struct ndr_push *ndr, int flags, c NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.device_name, ndr_charset_length(r->in.device_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { - if (r->out.type == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.type == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_srvsvc_ShareType(ndr, NDR_SCALARS, *r->out.type)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -16039,7 +16109,9 @@ static NTSTATUS ndr_push_srvsvc_NetSrvGetInfo(struct ndr_push *ndr, int flags, c NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetSrvInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -16266,7 +16338,9 @@ static NTSTATUS ndr_push_srvsvc_NetDiskEnum(struct ndr_push *ndr, int flags, con NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_unc, ndr_charset_length(r->in.server_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_srvsvc_NetDiskInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.maxlen)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); @@ -16275,9 +16349,13 @@ static NTSTATUS ndr_push_srvsvc_NetDiskEnum(struct ndr_push *ndr, int flags, con } } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_srvsvc_NetDiskInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - if (r->out.totalentries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.totalentries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { @@ -16449,7 +16527,9 @@ static NTSTATUS ndr_push_srvsvc_NetServerStatisticsGet(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.options)); } if (flags & NDR_OUT) { - if (r->out.stats == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.stats == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_srvsvc_Statistics(ndr, NDR_SCALARS, r->out.stats)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -16652,9 +16732,13 @@ static NTSTATUS ndr_push_srvsvc_NetTransportEnum(struct ndr_push *ndr, int flags NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_unc, ndr_charset_length(r->in.server_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level)); - if (r->in.transports == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.transports == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.transports, *r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.transports)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); @@ -16664,12 +16748,18 @@ static NTSTATUS ndr_push_srvsvc_NetTransportEnum(struct ndr_push *ndr, int flags } } if (flags & NDR_OUT) { - if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level)); - if (r->out.transports == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.transports == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.transports, *r->out.level)); NDR_CHECK(ndr_push_srvsvc_NetTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.transports)); - if (r->out.totalentries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.totalentries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { @@ -17157,7 +17247,9 @@ static NTSTATUS ndr_push_srvsvc_NetPathType(struct ndr_push *ndr, int flags, con NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.pathflags)); } if (flags & NDR_OUT) { - if (r->out.pathtype == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.pathtype == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pathtype)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -17266,14 +17358,18 @@ static NTSTATUS ndr_push_srvsvc_NetPathCanonicalize(struct ndr_push *ndr, int fl NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.prefix, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.prefix, ndr_charset_length(r->in.prefix, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - if (r->in.pathtype == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.pathtype == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.pathtype)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.pathflags)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.maxbuf)); NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.can_path, r->in.maxbuf)); - if (r->out.pathtype == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.pathtype == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pathtype)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -17742,9 +17838,13 @@ static NTSTATUS ndr_push_srvsvc_NetShareEnum(struct ndr_push *ndr, int flags, co NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_unc, ndr_charset_length(r->in.server_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level)); - if (r->in.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, *r->in.level)); NDR_CHECK(ndr_push_srvsvc_NetShareCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); @@ -17754,12 +17854,18 @@ static NTSTATUS ndr_push_srvsvc_NetShareEnum(struct ndr_push *ndr, int flags, co } } if (flags & NDR_OUT) { - if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level)); - if (r->out.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level)); NDR_CHECK(ndr_push_srvsvc_NetShareCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - if (r->out.totalentries == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.totalentries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { diff --git a/source3/librpc/gen_ndr/ndr_svcctl.c b/source3/librpc/gen_ndr/ndr_svcctl.c index fd6dc1b20c..6209259a13 100644 --- a/source3/librpc/gen_ndr/ndr_svcctl.c +++ b/source3/librpc/gen_ndr/ndr_svcctl.c @@ -298,11 +298,15 @@ _PUBLIC_ void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *nam static NTSTATUS ndr_push_svcctl_CloseServiceHandle(struct ndr_push *ndr, int flags, const struct svcctl_CloseServiceHandle *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -370,12 +374,16 @@ _PUBLIC_ void ndr_print_svcctl_CloseServiceHandle(struct ndr_print *ndr, const c static NTSTATUS ndr_push_svcctl_ControlService(struct ndr_push *ndr, int flags, const struct svcctl_ControlService *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.control)); } if (flags & NDR_OUT) { - if (r->out.service_status == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.service_status == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -446,7 +454,9 @@ _PUBLIC_ void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char static NTSTATUS ndr_push_svcctl_DeleteService(struct ndr_push *ndr, int flags, const struct svcctl_DeleteService *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { @@ -501,11 +511,15 @@ _PUBLIC_ void ndr_print_svcctl_DeleteService(struct ndr_print *ndr, const char * static NTSTATUS ndr_push_svcctl_LockServiceDatabase(struct ndr_push *ndr, int flags, const struct svcctl_LockServiceDatabase *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { - if (r->out.lock == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.lock == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -656,11 +670,15 @@ _PUBLIC_ void ndr_print_svcctl_SetServiceObjectSecurity(struct ndr_print *ndr, c static NTSTATUS ndr_push_svcctl_QueryServiceStatus(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceStatus *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { - if (r->out.service_status == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.service_status == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -770,11 +788,15 @@ _PUBLIC_ void ndr_print_svcctl_SetServiceStatus(struct ndr_print *ndr, const cha static NTSTATUS ndr_push_svcctl_UnlockServiceDatabase(struct ndr_push *ndr, int flags, const struct svcctl_UnlockServiceDatabase *r) { if (flags & NDR_IN) { - if (r->in.lock == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.lock == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.lock)); } if (flags & NDR_OUT) { - if (r->out.lock == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.lock == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -883,7 +905,9 @@ _PUBLIC_ void ndr_print_svcctl_NotifyBootConfigStatus(struct ndr_print *ndr, con static NTSTATUS ndr_push_svcctl_SCSetServiceBitsW(struct ndr_push *ndr, int flags, const struct svcctl_SCSetServiceBitsW *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bits)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bitson)); @@ -947,7 +971,9 @@ _PUBLIC_ void ndr_print_svcctl_SCSetServiceBitsW(struct ndr_print *ndr, const ch static NTSTATUS ndr_push_svcctl_ChangeServiceConfigW(struct ndr_push *ndr, int flags, const struct svcctl_ChangeServiceConfigW *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start)); @@ -996,7 +1022,9 @@ static NTSTATUS ndr_push_svcctl_ChangeServiceConfigW(struct ndr_push *ndr, int f } } if (flags & NDR_OUT) { - if (r->out.tag_id == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.tag_id == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.tag_id)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -1227,7 +1255,9 @@ _PUBLIC_ void ndr_print_svcctl_ChangeServiceConfigW(struct ndr_print *ndr, const static NTSTATUS ndr_push_svcctl_CreateServiceW(struct ndr_push *ndr, int flags, const struct svcctl_CreateServiceW *r) { if (flags & NDR_IN) { - if (r->in.scmanager_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.scmanager_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.scmanager_handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -1284,7 +1314,9 @@ static NTSTATUS ndr_push_svcctl_CreateServiceW(struct ndr_push *ndr, int flags, if (r->out.TagId) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.TagId)); } - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -1547,7 +1579,9 @@ _PUBLIC_ void ndr_print_svcctl_CreateServiceW(struct ndr_print *ndr, const char static NTSTATUS ndr_push_svcctl_EnumDependentServicesW(struct ndr_push *ndr, int flags, const struct svcctl_EnumDependentServicesW *r) { if (flags & NDR_IN) { - if (r->in.service == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.service == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.service)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.state)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); @@ -1557,9 +1591,13 @@ static NTSTATUS ndr_push_svcctl_EnumDependentServicesW(struct ndr_push *ndr, int if (r->out.service_status) { NDR_CHECK(ndr_push_ENUM_SERVICE_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.service_status)); } - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); - if (r->out.services_returned == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.services_returned == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.services_returned)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -1666,7 +1704,9 @@ _PUBLIC_ void ndr_print_svcctl_EnumDependentServicesW(struct ndr_print *ndr, con static NTSTATUS ndr_push_svcctl_EnumServicesStatusW(struct ndr_push *ndr, int flags, const struct svcctl_EnumServicesStatusW *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.state)); @@ -1679,9 +1719,13 @@ static NTSTATUS ndr_push_svcctl_EnumServicesStatusW(struct ndr_push *ndr, int fl if (flags & NDR_OUT) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.service, r->in.buf_size)); - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); - if (r->out.services_returned == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.services_returned == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.services_returned)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { @@ -1836,7 +1880,9 @@ static NTSTATUS ndr_push_svcctl_OpenSCManagerW(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -1947,7 +1993,9 @@ _PUBLIC_ void ndr_print_svcctl_OpenSCManagerW(struct ndr_print *ndr, const char static NTSTATUS ndr_push_svcctl_OpenServiceW(struct ndr_push *ndr, int flags, const struct svcctl_OpenServiceW *r) { if (flags & NDR_IN) { - if (r->in.scmanager_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.scmanager_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.scmanager_handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -1956,7 +2004,9 @@ static NTSTATUS ndr_push_svcctl_OpenServiceW(struct ndr_push *ndr, int flags, co NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -2035,13 +2085,17 @@ _PUBLIC_ void ndr_print_svcctl_OpenServiceW(struct ndr_print *ndr, const char *n static NTSTATUS ndr_push_svcctl_QueryServiceConfigW(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceConfigW *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.query, r->in.buf_size)); - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -2115,14 +2169,20 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceConfigW(struct ndr_print *ndr, const static NTSTATUS ndr_push_svcctl_QueryServiceLockStatusW(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceLockStatusW *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); } if (flags & NDR_OUT) { - if (r->out.lock_status == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.lock_status == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_SERVICE_LOCK_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock_status)); - if (r->out.required_buf_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.required_buf_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.required_buf_size)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -2207,7 +2267,9 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceLockStatusW(struct ndr_print *ndr, co static NTSTATUS ndr_push_svcctl_StartServiceW(struct ndr_push *ndr, int flags, const struct svcctl_StartServiceW *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.NumArgs)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Arguments)); @@ -2298,7 +2360,9 @@ _PUBLIC_ void ndr_print_svcctl_StartServiceW(struct ndr_print *ndr, const char * static NTSTATUS ndr_push_svcctl_GetServiceDisplayNameW(struct ndr_push *ndr, int flags, const struct svcctl_GetServiceDisplayNameW *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); if (r->in.service_name) { @@ -2313,8 +2377,12 @@ static NTSTATUS ndr_push_svcctl_GetServiceDisplayNameW(struct ndr_push *ndr, int } } if (flags & NDR_OUT) { - if (r->out.display_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->out.display_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.display_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.display_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -2466,7 +2534,9 @@ _PUBLIC_ void ndr_print_svcctl_GetServiceDisplayNameW(struct ndr_print *ndr, con static NTSTATUS ndr_push_svcctl_GetServiceKeyNameW(struct ndr_push *ndr, int flags, const struct svcctl_GetServiceKeyNameW *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); if (r->in.service_name) { @@ -2481,8 +2551,12 @@ static NTSTATUS ndr_push_svcctl_GetServiceKeyNameW(struct ndr_push *ndr, int fla } } if (flags & NDR_OUT) { - if (r->out.key_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->out.key_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.key_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.key_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -2634,7 +2708,9 @@ _PUBLIC_ void ndr_print_svcctl_GetServiceKeyNameW(struct ndr_print *ndr, const c static NTSTATUS ndr_push_svcctl_SCSetServiceBitsA(struct ndr_push *ndr, int flags, const struct svcctl_SCSetServiceBitsA *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bits)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bitson)); @@ -2698,7 +2774,9 @@ _PUBLIC_ void ndr_print_svcctl_SCSetServiceBitsA(struct ndr_print *ndr, const ch static NTSTATUS ndr_push_svcctl_ChangeServiceConfigA(struct ndr_push *ndr, int flags, const struct svcctl_ChangeServiceConfigA *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start)); @@ -2747,7 +2825,9 @@ static NTSTATUS ndr_push_svcctl_ChangeServiceConfigA(struct ndr_push *ndr, int f } } if (flags & NDR_OUT) { - if (r->out.tag_id == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.tag_id == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.tag_id)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -2978,7 +3058,9 @@ _PUBLIC_ void ndr_print_svcctl_ChangeServiceConfigA(struct ndr_print *ndr, const static NTSTATUS ndr_push_svcctl_CreateServiceA(struct ndr_push *ndr, int flags, const struct svcctl_CreateServiceA *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ServiceName)); if (r->in.ServiceName) { @@ -3302,7 +3384,9 @@ _PUBLIC_ void ndr_print_svcctl_CreateServiceA(struct ndr_print *ndr, const char static NTSTATUS ndr_push_svcctl_EnumDependentServicesA(struct ndr_push *ndr, int flags, const struct svcctl_EnumDependentServicesA *r) { if (flags & NDR_IN) { - if (r->in.service == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.service == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.service)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.state)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); @@ -3312,9 +3396,13 @@ static NTSTATUS ndr_push_svcctl_EnumDependentServicesA(struct ndr_push *ndr, int if (r->out.service_status) { NDR_CHECK(ndr_push_ENUM_SERVICE_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.service_status)); } - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); - if (r->out.services_returned == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.services_returned == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.services_returned)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -3421,7 +3509,9 @@ _PUBLIC_ void ndr_print_svcctl_EnumDependentServicesA(struct ndr_print *ndr, con static NTSTATUS ndr_push_svcctl_EnumServicesStatusA(struct ndr_push *ndr, int flags, const struct svcctl_EnumServicesStatusA *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.state)); @@ -3434,9 +3524,13 @@ static NTSTATUS ndr_push_svcctl_EnumServicesStatusA(struct ndr_push *ndr, int fl if (flags & NDR_OUT) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.service, r->in.buf_size)); - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); - if (r->out.services_returned == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.services_returned == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.services_returned)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { @@ -3591,7 +3685,9 @@ static NTSTATUS ndr_push_svcctl_OpenSCManagerA(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -3702,7 +3798,9 @@ _PUBLIC_ void ndr_print_svcctl_OpenSCManagerA(struct ndr_print *ndr, const char static NTSTATUS ndr_push_svcctl_OpenServiceA(struct ndr_push *ndr, int flags, const struct svcctl_OpenServiceA *r) { if (flags & NDR_IN) { - if (r->in.scmanager_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.scmanager_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.scmanager_handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ServiceName)); if (r->in.ServiceName) { @@ -3793,13 +3891,17 @@ _PUBLIC_ void ndr_print_svcctl_OpenServiceA(struct ndr_print *ndr, const char *n static NTSTATUS ndr_push_svcctl_QueryServiceConfigA(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceConfigA *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.query, r->in.buf_size)); - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -3873,14 +3975,20 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceConfigA(struct ndr_print *ndr, const static NTSTATUS ndr_push_svcctl_QueryServiceLockStatusA(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceLockStatusA *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); } if (flags & NDR_OUT) { - if (r->out.lock_status == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.lock_status == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_SERVICE_LOCK_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock_status)); - if (r->out.required_buf_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.required_buf_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.required_buf_size)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -3965,7 +4073,9 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceLockStatusA(struct ndr_print *ndr, co static NTSTATUS ndr_push_svcctl_StartServiceA(struct ndr_push *ndr, int flags, const struct svcctl_StartServiceA *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.NumArgs)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Arguments)); @@ -4056,7 +4166,9 @@ _PUBLIC_ void ndr_print_svcctl_StartServiceA(struct ndr_print *ndr, const char * static NTSTATUS ndr_push_svcctl_GetServiceDisplayNameA(struct ndr_push *ndr, int flags, const struct svcctl_GetServiceDisplayNameA *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); if (r->in.service_name) { @@ -4071,8 +4183,12 @@ static NTSTATUS ndr_push_svcctl_GetServiceDisplayNameA(struct ndr_push *ndr, int } } if (flags & NDR_OUT) { - if (r->out.display_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->out.display_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.display_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.display_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -4224,7 +4340,9 @@ _PUBLIC_ void ndr_print_svcctl_GetServiceDisplayNameA(struct ndr_print *ndr, con static NTSTATUS ndr_push_svcctl_GetServiceKeyNameA(struct ndr_push *ndr, int flags, const struct svcctl_GetServiceKeyNameA *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); if (r->in.service_name) { @@ -4239,8 +4357,12 @@ static NTSTATUS ndr_push_svcctl_GetServiceKeyNameA(struct ndr_push *ndr, int fla } } if (flags & NDR_OUT) { - if (r->out.key_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->out.key_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.key_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.key_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -4474,7 +4596,9 @@ _PUBLIC_ void ndr_print_svcctl_EnumServiceGroupW(struct ndr_print *ndr, const ch static NTSTATUS ndr_push_svcctl_ChangeServiceConfig2A(struct ndr_push *ndr, int flags, const struct svcctl_ChangeServiceConfig2A *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); @@ -4556,7 +4680,9 @@ _PUBLIC_ void ndr_print_svcctl_ChangeServiceConfig2A(struct ndr_print *ndr, cons static NTSTATUS ndr_push_svcctl_ChangeServiceConfig2W(struct ndr_push *ndr, int flags, const struct svcctl_ChangeServiceConfig2W *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); @@ -4638,14 +4764,18 @@ _PUBLIC_ void ndr_print_svcctl_ChangeServiceConfig2W(struct ndr_print *ndr, cons static NTSTATUS ndr_push_svcctl_QueryServiceConfig2A(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceConfig2A *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buf_size)); - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -4721,14 +4851,18 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceConfig2A(struct ndr_print *ndr, const static NTSTATUS ndr_push_svcctl_QueryServiceConfig2W(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceConfig2W *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buf_size)); - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -4804,14 +4938,18 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceConfig2W(struct ndr_print *ndr, const static NTSTATUS ndr_push_svcctl_QueryServiceStatusEx(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceStatusEx *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buf_size)); - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -4887,7 +5025,9 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceStatusEx(struct ndr_print *ndr, const static NTSTATUS ndr_push_EnumServicesStatusExA(struct ndr_push *ndr, int flags, const struct EnumServicesStatusExA *r) { if (flags & NDR_IN) { - if (r->in.scmanager == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.scmanager == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.scmanager)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); @@ -4900,16 +5040,24 @@ static NTSTATUS ndr_push_EnumServicesStatusExA(struct ndr_push *ndr, int flags, } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.services, r->in.buf_size)); - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); - if (r->out.service_returned == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.service_returned == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.service_returned)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); } - if (r->out.group_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->out.group_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.group_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.group_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -5070,7 +5218,9 @@ _PUBLIC_ void ndr_print_EnumServicesStatusExA(struct ndr_print *ndr, const char static NTSTATUS ndr_push_EnumServicesStatusExW(struct ndr_push *ndr, int flags, const struct EnumServicesStatusExW *r) { if (flags & NDR_IN) { - if (r->in.scmanager == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.scmanager == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.scmanager)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); @@ -5083,16 +5233,24 @@ static NTSTATUS ndr_push_EnumServicesStatusExW(struct ndr_push *ndr, int flags, } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.services, r->in.buf_size)); - if (r->out.bytes_needed == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.bytes_needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.bytes_needed)); - if (r->out.service_returned == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.service_returned == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.service_returned)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle)); if (r->out.resume_handle) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); } - if (r->out.group_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; - if (*r->out.group_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.group_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.group_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_ref_ptr(ndr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); diff --git a/source3/librpc/gen_ndr/ndr_unixinfo.c b/source3/librpc/gen_ndr/ndr_unixinfo.c index a26b6a6d2d..06da66a8ce 100644 --- a/source3/librpc/gen_ndr/ndr_unixinfo.c +++ b/source3/librpc/gen_ndr/ndr_unixinfo.c @@ -66,7 +66,9 @@ static NTSTATUS ndr_push_unixinfo_SidToUid(struct ndr_push *ndr, int flags, cons NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid)); } if (flags & NDR_OUT) { - if (r->out.uid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.uid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -128,7 +130,9 @@ static NTSTATUS ndr_push_unixinfo_UidToSid(struct ndr_push *ndr, int flags, cons NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid)); } if (flags & NDR_OUT) { - if (r->out.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -190,7 +194,9 @@ static NTSTATUS ndr_push_unixinfo_SidToGid(struct ndr_push *ndr, int flags, cons NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid)); } if (flags & NDR_OUT) { - if (r->out.gid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.gid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -252,7 +258,9 @@ static NTSTATUS ndr_push_unixinfo_GidToSid(struct ndr_push *ndr, int flags, cons NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid)); } if (flags & NDR_OUT) { - if (r->out.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -313,7 +321,9 @@ static NTSTATUS ndr_push_unixinfo_GetPWUid(struct ndr_push *ndr, int flags, cons uint32_t cntr_uids_0; uint32_t cntr_infos_0; if (flags & NDR_IN) { - if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) { @@ -321,7 +331,9 @@ static NTSTATUS ndr_push_unixinfo_GetPWUid(struct ndr_push *ndr, int flags, cons } } if (flags & NDR_OUT) { - if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); for (cntr_infos_0 = 0; cntr_infos_0 < *r->out.count; cntr_infos_0++) { diff --git a/source3/librpc/gen_ndr/ndr_winreg.c b/source3/librpc/gen_ndr/ndr_winreg.c index 336e338966..c973403ac9 100644 --- a/source3/librpc/gen_ndr/ndr_winreg.c +++ b/source3/librpc/gen_ndr/ndr_winreg.c @@ -522,7 +522,9 @@ static NTSTATUS ndr_push_winreg_OpenHKCR(struct ndr_push *ndr, int flags, const NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -608,7 +610,9 @@ static NTSTATUS ndr_push_winreg_OpenHKCU(struct ndr_push *ndr, int flags, const NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -694,7 +698,9 @@ static NTSTATUS ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -780,7 +786,9 @@ static NTSTATUS ndr_push_winreg_OpenHKPD(struct ndr_push *ndr, int flags, const NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -866,7 +874,9 @@ static NTSTATUS ndr_push_winreg_OpenHKU(struct ndr_push *ndr, int flags, const s NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -945,11 +955,15 @@ _PUBLIC_ void ndr_print_winreg_OpenHKU(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_winreg_CloseKey(struct ndr_push *ndr, int flags, const struct winreg_CloseKey *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -1017,7 +1031,9 @@ _PUBLIC_ void ndr_print_winreg_CloseKey(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct winreg_CreateKey *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyclass)); @@ -1033,7 +1049,9 @@ static NTSTATUS ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const } } if (flags & NDR_OUT) { - if (r->out.new_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.new_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.new_handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.action_taken)); if (r->out.action_taken) { @@ -1172,7 +1190,9 @@ _PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name static NTSTATUS ndr_push_winreg_DeleteKey(struct ndr_push *ndr, int flags, const struct winreg_DeleteKey *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.key)); } @@ -1230,7 +1250,9 @@ _PUBLIC_ void ndr_print_winreg_DeleteKey(struct ndr_print *ndr, const char *name static NTSTATUS ndr_push_winreg_DeleteValue(struct ndr_push *ndr, int flags, const struct winreg_DeleteValue *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value)); } @@ -1288,10 +1310,14 @@ _PUBLIC_ void ndr_print_winreg_DeleteValue(struct ndr_print *ndr, const char *na static NTSTATUS ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct winreg_EnumKey *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index)); - if (r->in.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.keyclass)); if (r->in.keyclass) { @@ -1303,7 +1329,9 @@ static NTSTATUS ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const s } } if (flags & NDR_OUT) { - if (r->out.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.keyclass)); if (r->out.keyclass) { @@ -1469,10 +1497,14 @@ _PUBLIC_ void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_winreg_EnumValue(struct ndr_push *ndr, int flags, const struct winreg_EnumValue *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index)); - if (r->in.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_winreg_ValNameBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.type)); if (r->in.type) { @@ -1495,7 +1527,9 @@ static NTSTATUS ndr_push_winreg_EnumValue(struct ndr_push *ndr, int flags, const } } if (flags & NDR_OUT) { - if (r->out.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_winreg_ValNameBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.type)); if (r->out.type) { @@ -1608,11 +1642,11 @@ static NTSTATUS ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struc NDR_PULL_ALLOC(ndr, r->out.name); *r->out.name = *r->in.name; if (r->in.value) { - if (r->in.size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()"); NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.value, *r->in.size)); } if (r->in.value) { - if (r->in.length == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()"); NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.value, *r->in.length)); } } @@ -1680,11 +1714,11 @@ static NTSTATUS ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struc } NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); if (r->out.value) { - if (r->out.size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()"); NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.value, *r->out.size)); } if (r->out.value) { - if (r->out.length == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()"); NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.value, *r->out.length)); } } @@ -1778,7 +1812,9 @@ _PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name static NTSTATUS ndr_push_winreg_FlushKey(struct ndr_push *ndr, int flags, const struct winreg_FlushKey *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { @@ -1833,14 +1869,20 @@ _PUBLIC_ void ndr_print_winreg_FlushKey(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_winreg_GetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_GetKeySecurity *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); - if (r->in.sd == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sd == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd)); } if (flags & NDR_OUT) { - if (r->out.sd == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.sd == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sd)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -1922,7 +1964,9 @@ _PUBLIC_ void ndr_print_winreg_GetKeySecurity(struct ndr_print *ndr, const char static NTSTATUS ndr_push_winreg_LoadKey(struct ndr_push *ndr, int flags, const struct winreg_LoadKey *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.keyname)); if (r->in.keyname) { @@ -2025,7 +2069,9 @@ _PUBLIC_ void ndr_print_winreg_LoadKey(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *ndr, int flags, const struct winreg_NotifyChangeKeyValue *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.watch_subtree)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.notify_filter)); @@ -2098,14 +2144,18 @@ _PUBLIC_ void ndr_print_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const static NTSTATUS ndr_push_winreg_OpenKey(struct ndr_push *ndr, int flags, const struct winreg_OpenKey *r) { if (flags & NDR_IN) { - if (r->in.parent_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.parent_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.parent_handle)); NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyname)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -2180,29 +2230,51 @@ _PUBLIC_ void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const struct winreg_QueryInfoKey *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.classname == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.classname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.classname)); } if (flags & NDR_OUT) { - if (r->out.classname == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.classname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.classname)); - if (r->out.num_subkeys == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.num_subkeys == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_subkeys)); - if (r->out.max_subkeylen == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.max_subkeylen == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_subkeylen)); - if (r->out.max_classlen == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.max_classlen == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_classlen)); - if (r->out.num_values == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.num_values == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_values)); - if (r->out.max_valnamelen == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.max_valnamelen == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_valnamelen)); - if (r->out.max_valbufsize == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.max_valbufsize == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_valbufsize)); - if (r->out.secdescsize == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.secdescsize == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.secdescsize)); - if (r->out.last_changed_time == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.last_changed_time == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->out.last_changed_time)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -2394,7 +2466,9 @@ _PUBLIC_ void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *n static NTSTATUS ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struct winreg_QueryValue *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value_name)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.type)); @@ -2519,11 +2593,11 @@ static NTSTATUS ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, stru NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_length_0, 0); } if (r->in.data) { - if (r->in.data_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.data_size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()"); NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, *r->in.data_size)); } if (r->in.data) { - if (r->in.value_length == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.value_length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()"); NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.data, *r->in.value_length)); } } @@ -2584,11 +2658,11 @@ static NTSTATUS ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, stru } NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); if (r->out.data) { - if (r->out.data_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.data_size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()"); NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, *r->out.data_size)); } if (r->out.data) { - if (r->out.value_length == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.value_length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()"); NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.data, *r->out.value_length)); } } @@ -2715,9 +2789,13 @@ _PUBLIC_ void ndr_print_winreg_ReplaceKey(struct ndr_print *ndr, const char *nam static NTSTATUS ndr_push_winreg_RestoreKey(struct ndr_push *ndr, int flags, const struct winreg_RestoreKey *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.filename == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.filename == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); } @@ -2787,9 +2865,13 @@ _PUBLIC_ void ndr_print_winreg_RestoreKey(struct ndr_print *ndr, const char *nam static NTSTATUS ndr_push_winreg_SaveKey(struct ndr_push *ndr, int flags, const struct winreg_SaveKey *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - if (r->in.filename == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.filename == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.sec_attrib)); if (r->in.sec_attrib) { @@ -2880,10 +2962,14 @@ _PUBLIC_ void ndr_print_winreg_SaveKey(struct ndr_print *ndr, const char *name, static NTSTATUS ndr_push_winreg_SetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_SetKeySecurity *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - if (r->in.sd == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.sd == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd)); } if (flags & NDR_OUT) { @@ -2952,11 +3038,15 @@ _PUBLIC_ void ndr_print_winreg_SetKeySecurity(struct ndr_print *ndr, const char static NTSTATUS ndr_push_winreg_SetValue(struct ndr_push *ndr, int flags, const struct winreg_SetValue *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type)); - if (r->in.data == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.size)); NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, r->in.size)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.size)); @@ -3235,11 +3325,15 @@ _PUBLIC_ void ndr_print_winreg_AbortSystemShutdown(struct ndr_print *ndr, const static NTSTATUS ndr_push_winreg_GetVersion(struct ndr_push *ndr, int flags, const struct winreg_GetVersion *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { - if (r->out.version == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.version == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.version)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -3315,7 +3409,9 @@ static NTSTATUS ndr_push_winreg_OpenHKCC(struct ndr_push *ndr, int flags, const NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -3401,7 +3497,9 @@ static NTSTATUS ndr_push_winreg_OpenHKDD(struct ndr_push *ndr, int flags, const NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -3481,9 +3579,13 @@ static NTSTATUS ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int fl { uint32_t cntr_values_1; if (flags & NDR_IN) { - if (r->in.key_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.key_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.key_handle)); - if (r->in.values == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.values == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_values)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_values)); @@ -3501,11 +3603,15 @@ static NTSTATUS ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int fl NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.buffer_size)); NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, *r->in.buffer_size)); } - if (r->in.buffer_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.buffer_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.buffer_size)); } if (flags & NDR_OUT) { - if (r->out.values == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.values == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_values)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_values)); @@ -3522,7 +3628,9 @@ static NTSTATUS ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int fl NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.buffer_size)); NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, *r->out.buffer_size)); } - if (r->out.buffer_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.buffer_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.buffer_size)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -3896,7 +4004,9 @@ static NTSTATUS ndr_push_winreg_OpenHKPT(struct ndr_push *ndr, int flags, const NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -3982,7 +4092,9 @@ static NTSTATUS ndr_push_winreg_OpenHKPN(struct ndr_push *ndr, int flags, const NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { - if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } diff --git a/source3/librpc/gen_ndr/ndr_wkssvc.c b/source3/librpc/gen_ndr/ndr_wkssvc.c index 0e0a31e7a3..818eb3fc00 100644 --- a/source3/librpc/gen_ndr/ndr_wkssvc.c +++ b/source3/librpc/gen_ndr/ndr_wkssvc.c @@ -2187,7 +2187,9 @@ static NTSTATUS ndr_push_wkssvc_NetWkstaGetInfo(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - if (r->out.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -2283,14 +2285,20 @@ static NTSTATUS ndr_push_wkssvc_NetWkstaSetInfo(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - if (r->in.parm_error == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.parm_error == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_error)); } if (flags & NDR_OUT) { - if (r->out.parm_error == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.parm_error == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_error)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -2408,14 +2416,20 @@ static NTSTATUS ndr_push_wkssvc_NetWkstaEnumUsers(struct ndr_push *ndr, int flag NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.users == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.users == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_WKS_USER_ENUM_UNION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.users)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.prefmaxlen)); - if (r->in.resumehandle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.resumehandle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resumehandle)); } if (flags & NDR_OUT) { - if (r->out.users == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.users == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_WKS_USER_ENUM_UNION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.users)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.entriesread)); if (r->out.entriesread) { @@ -2425,7 +2439,9 @@ static NTSTATUS ndr_push_wkssvc_NetWkstaEnumUsers(struct ndr_push *ndr, int flag if (r->out.totalentries) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); } - if (r->out.resumehandle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.resumehandle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resumehandle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -2677,26 +2693,38 @@ static NTSTATUS ndr_push_wkssvc_NetWkstaTransportEnum(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level)); - if (r->in.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, *r->in.level)); NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); - if (r->in.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); } if (flags & NDR_OUT) { - if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.level == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level)); - if (r->out.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level)); NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.totalentries)); if (r->out.totalentries) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries)); } - if (r->out.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->out.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -3529,7 +3557,9 @@ static NTSTATUS ndr_push_wkssvc_NetrJoinDomain2(struct ndr_push *ndr, int flags, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->in.domain_name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; + if (r->in.domain_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16))); |